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

dcthomp at mcs.anl.gov dcthomp at mcs.anl.gov
Wed Oct 24 15:38:49 CDT 2007


Author: dcthomp
Date: 2007-10-24 15:38:48 -0500 (Wed, 24 Oct 2007)
New Revision: 1334

Added:
   MOAB/trunk/parallel/CMakeLists.txt
Modified:
   MOAB/trunk/CMakeLists.txt
   MOAB/trunk/MBEntityHandle.h.in
   MOAB/trunk/config.h.cmake
Log:
ENH: Add MOABpar to the CMake build.


Modified: MOAB/trunk/CMakeLists.txt
===================================================================
--- MOAB/trunk/CMakeLists.txt	2007-10-24 20:38:21 UTC (rev 1333)
+++ MOAB/trunk/CMakeLists.txt	2007-10-24 20:38:48 UTC (rev 1334)
@@ -72,9 +72,7 @@
 
   # MPI
   option ( MOAB_USE_MPI "Should MOAB be compiled with MPI support?" OFF )
-  if ( MOAB_USE_MPI )
-    find_package( MPI )
-  endif ( MOAB_USE_MPI )
+  option ( MOAB_USE_HDF            "Include HDF I/O in the build?"        OFF )
 
   # NetCDF
   # Documentation
@@ -92,8 +90,6 @@
   option ( MOAB_BUILD_MBZOLTAN     "Build the mbzoltan partitioner?"      OFF )
   option ( MOAB_BUILD_DAGMC        "Build the dagmc tool?"                ON )
 
-  option ( MOAB_USE_HDF            "Include HDF I/O in the build?"        OFF )
-
   # iMesh
   option ( MOAB_BUILD_IMESH        "Build the iMesh interface?"           ON )
 
@@ -174,19 +170,38 @@
     endif ( HDF5_FOUND )
   endif ( MOAB_USE_HDF )
 
+  if ( MOAB_USE_MPI )
+    find_package( MPI )
+    # CMake FindMPI script is sorely lacking:
+    if ( MPI_LIBRARY AND MPI_INCLUDE_PATH )
+      set( MPI_FOUND 1 )
+    endif ( MPI_LIBRARY AND MPI_INCLUDE_PATH )
+
+    if ( MPI_FOUND )
+      include_directories(
+        ${MPI_INCLUDE_PATH}
+        ${MOAB_SOURCE_DIR}/parallel
+      )
+    endif ( MPI_FOUND )
+  endif ( MOAB_USE_MPI )
+
   set_source_files_properties( ${MOAB_LIB_SRCS}
     COMPILE_FLAGS "-DIS_BUILDING_MB"
   )
-  add_library( moab
+  add_library( MOAB
     ${MOAB_LIB_SRCS}
   )
   if ( MOAB_USE_HDF AND HDF5_FOUND )
-    target_link_libraries( moab
+    target_link_libraries( MOAB
       mhdf
       ${HDF5_LIBRARIES}
     )
   endif ( MOAB_USE_HDF AND HDF5_FOUND )
 
+  if ( MOAB_USE_MPI AND MPI_FOUND )
+    add_subdirectory( parallel )
+  endif ( MOAB_USE_MPI AND MPI_FOUND )
+
   ## Tools/libraries dependent on MOAB:
 
   # Zoltan

Modified: MOAB/trunk/MBEntityHandle.h.in
===================================================================
--- MOAB/trunk/MBEntityHandle.h.in	2007-10-24 20:38:21 UTC (rev 1333)
+++ MOAB/trunk/MBEntityHandle.h.in	2007-10-24 20:38:48 UTC (rev 1334)
@@ -1,6 +1,9 @@
 #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 */
@@ -40,6 +43,14 @@
 /* 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)

Modified: MOAB/trunk/config.h.cmake
===================================================================
--- MOAB/trunk/config.h.cmake	2007-10-24 20:38:21 UTC (rev 1333)
+++ MOAB/trunk/config.h.cmake	2007-10-24 20:38:48 UTC (rev 1334)
@@ -20,13 +20,6 @@
 /* Define to 1 if you have the <gvc.h> header file. */
 #undef HAVE_GVC_H
 
-/* Define to 1 if you have the <hdf5.h> header file. */
-#cmakedefine HDF5_FOUND
-#ifdef HDF5_FOUND
-#  define HAVE_HDF5_H
-#  define HDF5_FILE
-#endif /* HDF5_FOUND */
-
 /* Define to 1 if you have the <inttypes.h> header file. */
 #cmakedefine HAVE_INTTYPES_H
 
@@ -105,6 +98,16 @@
 /* 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
+#  define HDF5_FILE
+#endif /* HDF5_FOUND */
+
 /* Use int32_t for handles */
 #cmakedefine MOAB_FORCE_32_BIT_HANDLES
 
@@ -132,6 +135,8 @@
 /* MOAB qualified HAVE_SYS_TYPES_H */
 #cmakedefine MOAB_HAVE_SYS_TYPES_H
 
+#endif /* Already included MBEntityHandle.h */
+
 /* Name of package */
 #define PACKAGE "${PROJECT_NAME}"
 

Added: MOAB/trunk/parallel/CMakeLists.txt
===================================================================
--- MOAB/trunk/parallel/CMakeLists.txt	                        (rev 0)
+++ MOAB/trunk/parallel/CMakeLists.txt	2007-10-24 20:38:48 UTC (rev 1334)
@@ -0,0 +1,32 @@
+set( moab_PARALLEL_SRCS
+  MBParallelComm.cpp
+  MBProcConfig.cpp
+  MBParallelData.cpp
+  ReadParallel.cpp
+  crystal.c
+  errmem.c
+  transfer.c
+  gs.c
+  tuple_list.c
+  sort.c
+)
+
+if ( MOAB_USE_HDF AND MOAB_HDF_HAVE_PARALLEL )
+  set( moab_PARALLEL_SRCS
+    ${moab_PARALLEL_SRCS}
+    WriteHDF5Parallel.cpp
+  )
+endif ( MOAB_USE_HDF AND MOAB_HDF_HAVE_PARALLEL )
+
+set_source_files_properties( ${moab_PARALLEL_SRCS}
+  COMPILE_FLAGS "-DIS_BUILDING_MB"
+)
+add_library( MOABpar
+  ${moab_PARALLEL_SRCS}
+)
+
+target_link_libraries( MOABpar
+  MOAB
+  ${MPI_LIBRARY}
+  ${MPI_EXTRA_LIBRARY}
+)




More information about the moab-dev mailing list