[MOAB-dev] r1337 - in MOAB/trunk: . parallel

dcthomp at mcs.anl.gov dcthomp at mcs.anl.gov
Wed Oct 24 17:26:15 CDT 2007


Author: dcthomp
Date: 2007-10-24 17:26:15 -0500 (Wed, 24 Oct 2007)
New Revision: 1337

Removed:
   MOAB/trunk/config.h.cmake
Modified:
   MOAB/trunk/CMakeLists.txt
   MOAB/trunk/MBEntityHandle.h.in
   MOAB/trunk/parallel/CMakeLists.txt
Log:
STYLE: Use compiler flags instead of config file for build options.


Modified: MOAB/trunk/CMakeLists.txt
===================================================================
--- MOAB/trunk/CMakeLists.txt	2007-10-24 21:10:48 UTC (rev 1336)
+++ MOAB/trunk/CMakeLists.txt	2007-10-24 22:26:15 UTC (rev 1337)
@@ -72,7 +72,7 @@
 
   # MPI
   option ( MOAB_USE_MPI "Should MOAB be compiled with MPI support?" OFF )
-  option ( MOAB_USE_HDF            "Include HDF I/O in the build?"        OFF )
+  option ( MOAB_USE_HDF "Include HDF I/O in the build?"             OFF )
 
   # NetCDF
   # Documentation
@@ -93,6 +93,9 @@
   # iMesh
   option ( MOAB_BUILD_IMESH        "Build the iMesh interface?"           ON )
 
+  # Compiler defines... this should really be in a config file.
+  set( MOAB_DEFINES "" )
+
   # MOAB Library
   set ( MOAB_LIB_SRCS
     AEntityFactory.cpp
@@ -156,6 +159,7 @@
     # HDF5
     find_package( HDF5 )
     if ( HDF5_FOUND )
+      set ( MOAB_DEFINES "${MOAB_DEFINES} -DHDF5_FILE" )
       check_function_exists( H5Pset_fapl_mpio MOAB_HDF_HAVE_PARALLEL )
       set ( MOAB_LIB_SRCS
         ${MOAB_LIB_SRCS}
@@ -178,6 +182,7 @@
     endif ( MPI_LIBRARY AND MPI_INCLUDE_PATH )
 
     if ( MPI_FOUND )
+      set ( MOAB_DEFINES "${MOAB_DEFINES} -DUSE_MPI" )
       include_directories(
         ${MPI_INCLUDE_PATH}
         ${MOAB_SOURCE_DIR}/parallel
@@ -186,8 +191,9 @@
   endif ( MOAB_USE_MPI )
 
   set_source_files_properties( ${MOAB_LIB_SRCS}
-    COMPILE_FLAGS "-DIS_BUILDING_MB"
+    COMPILE_FLAGS "-DIS_BUILDING_MB ${MOAB_DEFINES}"
   )
+  message( "MOAB_DEFINES=\"${MOAB_DEFINES}\"" )
   add_library( MOAB
     ${MOAB_LIB_SRCS}
   )
@@ -200,6 +206,9 @@
 
   if ( MOAB_USE_MPI AND MPI_FOUND )
     add_subdirectory( parallel )
+    target_link_libraries( MOAB
+      MOABpar
+    )
   endif ( MOAB_USE_MPI AND MPI_FOUND )
 
   ## Tools/libraries dependent on MOAB:
@@ -226,12 +235,18 @@
   set( MB_VERSION_PATCH  ${MOAB_VERSION_PATCH} )
   set( MB_VERSION_STRING "\"${MOAB_VERSION_STRING}\"" )
 
-  # Best we can do for now since there's no config.h.in in the repository...
-  configure_file( ${MOAB_SOURCE_DIR}/config.h.cmake      ${MOAB_BINARY_DIR}/config.h )
-  # ... but the line below is what should *really* happen
-  #autoconf_header( ${MOAB_SOURCE_DIR}/config.h.in ${MOAB_BINARY_DIR}/config.h )
-
   autoconf_header( ${MOAB_SOURCE_DIR}/MBVersion.h.in ${MOAB_BINARY_DIR}/MBVersion.h )
   autoconf_header( ${MOAB_SOURCE_DIR}/MBEntityHandle.h.in ${MOAB_BINARY_DIR}/MBEntityHandle.h )
 
 
+# Testing
+  # Always build tests
+  enable_testing()
+  # Point to the input decks for the tests
+  configure_file( ${MOAB_SOURCE_DIR}/cmake/TestingConfig.h.in ${MOAB_BINARY_DIR}/testdir.h )
+
+  add_executable( moab_test MBTest.cpp )
+  target_link_libraries( moab_test MOAB )
+  add_test( moab_test moab_test )
+  # FIXME: moab_test depends on: test/mb_big_test.g test/cell1.gen test/cell2.gen
+

Modified: MOAB/trunk/MBEntityHandle.h.in
===================================================================
--- MOAB/trunk/MBEntityHandle.h.in	2007-10-24 21:10:48 UTC (rev 1336)
+++ MOAB/trunk/MBEntityHandle.h.in	2007-10-24 22:26:15 UTC (rev 1337)
@@ -1,21 +1,6 @@
 #ifndef MB_ENTITY_HANDLE_H
 #define MB_ENTITY_HANDLE_H
 
-/* If config.h has already been included, skip this bit. */
-#ifndef PACKAGE
-
-/* Are we building with HDF? */
-/* autoconf may only set HAVE_HDF5_H and not HDF5_FOUND. */
-/* CMake may only set HDF5_FOUND. Having either implies HDF5_FILE */
-#undef HDF5_FOUND
-#undef HAVE_HDF5_H
-#ifdef HDF5_FOUND
-#  define HAVE_HDF5_H
-#endif
-#if defined(HAVE_HDF5_H) && !defined(HDF5_FILE)
-#  define HDF5_FILE
-#endif
-
 /* MOAB qualified HAVE_INTTYPES_H */
 #undef MOAB_HAVE_INTTYPES_H
 
@@ -43,14 +28,6 @@
 /* System provides size_t typedef */
 #undef MOAB_HAVE_SIZE_T
 
-#endif /* Already had config.h */
-
-/* Built with MPI? */
-#undef MOAB_USE_MPI
-#ifdef MOAB_USE_MPI
-#  define USE_MPI
-#endif /* MOAB_USE_MPI */
-
 #ifdef MOAB_HAVE_INTTYPES_H
 # include <inttypes.h>
 #elif defined (MOAB_HAVE_STDINT_H)

Deleted: MOAB/trunk/config.h.cmake
===================================================================
--- MOAB/trunk/config.h.cmake	2007-10-24 21:10:48 UTC (rev 1336)
+++ MOAB/trunk/config.h.cmake	2007-10-24 22:26:15 UTC (rev 1337)
@@ -1,167 +0,0 @@
-/* config.h.cmake.  Generated from thin air by dcthomp.  */
-
-/* Define to dummy `main' function (if any) required to link to the Fortran
-   libraries. */
-#undef FC_DUMMY_MAIN
-
-/* Define if F77 and FC dummy `main' functions are identical. */
-#undef FC_DUMMY_MAIN_EQ_F77
-
-/* Define to a macro mangling the given C identifier (in lower and upper
-   case), which must not contain underscores, for linking with Fortran. */
-#undef FC_FUNC
-
-/* As FC_FUNC, but for C identifiers containing underscores. */
-#undef FC_FUNC_
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you have the <gvc.h> header file. */
-#undef HAVE_GVC_H
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#cmakedefine HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `chaco' library (-lchaco). */
-#cmakedefine HAVE_LIBCHACO
-
-/* Define to 1 if you have the `gvc' library (-lgvc). */
-#cmakedefine HAVE_LIBGVC
-
-/* Define to 1 if you have the <memory.h> header file. */
-#cmakedefine HAVE_MEMORY_H
-
-/* Define to 1 if you have the <netcdf.h> header file. */
-#cmakedefine HAVE_NETCDF_H
-
-/* Define to 1 if you have the <qapplication.h> header file. */
-#cmakedefine HAVE_QAPPLICATION_H
-
-/* Define to 1 if you have the <qevent.h> header file. */
-#cmakedefine HAVE_QEVENT_H
-
-/* Define to 1 if you have the <qlineedit.h> header file. */
-#cmakedefine HAVE_QLINEEDIT_H
-
-/* Define to 1 if you have the <qmetaobject.h> header file. */
-#cmakedefine HAVE_QMETAOBJECT_H
-
-/* Define to 1 if you have the <qobject.h> header file. */
-#cmakedefine HAVE_QOBJECT_H
-
-/* Define to 1 if you have the <qpixmap.h> header file. */
-#cmakedefine HAVE_QPIXMAP_H
-
-/* Define to 1 if you have the <qtimer.h> header file. */
-#cmakedefine HAVE_QTIMER_H
-
-/* Define to 1 if you have the <qwidgetplugin.h> header file. */
-#cmakedefine HAVE_QWIDGETPLUGIN_H
-
-/* Define to 1 if you have the <qwidget.h> header file. */
-#cmakedefine HAVE_QWIDGET_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#cmakedefine HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#cmakedefine HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#cmakedefine HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#cmakedefine HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#cmakedefine HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#cmakedefine HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#cmakedefine HAVE_UNISTD_H
-
-/* MOAB Version */
-#define MB_VERSION @MOAB_VERSION@
-
-/* MOAB Major Version */
-#define MB_VERSION_MAJOR @MOAB_VERSION_MAJOR@
-
-/* MOAB Minor Version */
-#define MB_VERSION_MINOR @MOAB_VERSION_MINOR@
-
-/* MOAB Patch Level */
-#define MB_VERSION_PATCH @MOAB_VERSION_PATCH@
-
-/* MOAB Version String */
-#define MB_VERSION_STRING "@MOAB_VERSION_STRING@"
-
-/* Skip the next bit if we've already included MBEntityHandle.h */
-#ifndef MB_ENTITY_HANDLE_H
-
-/* Define to 1 if you have the <hdf5.h> header file. */
-#cmakedefine HDF5_FOUND
-#ifdef HDF5_FOUND
-#  define HAVE_HDF5_H
-#  ifndef HDF5_FILE
-#    define HDF5_FILE
-#  endif /* HDF5_FILE */
-#endif /* HDF5_FOUND */
-
-/* Use int32_t for handles */
-#cmakedefine MOAB_FORCE_32_BIT_HANDLES
-
-/* Use int64_t for handles */
-#cmakedefine MOAB_FORCE_64_BIT_HANDLES
-
-/* MOAB qualified HAVE_INTTYPES_H */
-#cmakedefine MOAB_HAVE_INTTYPES_H
-
-/* System provides ptrdiff_t typedef */
-#cmakedefine MOAB_HAVE_PTRDIFF_T
-
-/* System provides size_t typedef */
-#cmakedefine MOAB_HAVE_SIZE_T
-
-/* MOAB qualified HAVE_STDDEF_H */
-#cmakedefine MOAB_HAVE_STDDEF_H
-
-/* MOAB qualified HAVE_STDINT_H */
-#cmakedefine MOAB_HAVE_STDINT_H
-
-/* MOAB qualified HAVE_STDLIB_H */
-#cmakedefine MOAB_HAVE_STDLIB_H
-
-/* MOAB qualified HAVE_SYS_TYPES_H */
-#cmakedefine MOAB_HAVE_SYS_TYPES_H
-
-#endif /* Already included MBEntityHandle.h */
-
-/* Name of package */
-#define PACKAGE "${PROJECT_NAME}"
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "${PROJECT_NAME}"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "${PROJECT_NAME} ${${PROJECT_NAME}_VERSION_STRING}"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "${PROJECT_NAME}"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "${${PROJECT_NAME}_VERSION_STRING}"
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Version number of package */
-#undef VERSION
-
-/* Define to 1 if the X Window System is missing or not being used. */
-#undef X_DISPLAY_MISSING

Modified: MOAB/trunk/parallel/CMakeLists.txt
===================================================================
--- MOAB/trunk/parallel/CMakeLists.txt	2007-10-24 21:10:48 UTC (rev 1336)
+++ MOAB/trunk/parallel/CMakeLists.txt	2007-10-24 22:26:15 UTC (rev 1337)
@@ -19,14 +19,13 @@
 endif ( MOAB_USE_HDF AND MOAB_HDF_HAVE_PARALLEL )
 
 set_source_files_properties( ${moab_PARALLEL_SRCS}
-  COMPILE_FLAGS "-DIS_BUILDING_MB"
+  COMPILE_FLAGS "-DIS_BUILDING_MB ${MOAB_DEFINES}"
 )
 add_library( MOABpar
   ${moab_PARALLEL_SRCS}
 )
 
 target_link_libraries( MOABpar
-  MOAB
   ${MPI_LIBRARY}
   ${MPI_EXTRA_LIBRARY}
 )




More information about the moab-dev mailing list