[MOAB-dev] r1496 - MOAB/trunk/parallel

dcthomp at mcs.anl.gov dcthomp at mcs.anl.gov
Thu Dec 27 20:27:27 CST 2007


Author: dcthomp
Date: 2007-12-27 20:27:27 -0600 (Thu, 27 Dec 2007)
New Revision: 1496

Modified:
   MOAB/trunk/parallel/CMakeLists.txt
   MOAB/trunk/parallel/MBProcConfig.hpp
Log:
COMP: Try to fix some MPICH2 on MacOS X issues reported
      by malkhafa at mcs.anl.gov.


Modified: MOAB/trunk/parallel/CMakeLists.txt
===================================================================
--- MOAB/trunk/parallel/CMakeLists.txt	2007-12-27 23:40:02 UTC (rev 1495)
+++ MOAB/trunk/parallel/CMakeLists.txt	2007-12-28 02:27:27 UTC (rev 1496)
@@ -18,10 +18,23 @@
   )
 endif ( MOAB_USE_HDF AND MOAB_HDF_HAVE_PARALLEL )
 
+# On Mac OS X, shared libraries may not have circular
+# dependencies (e.g., MOAB depends on MOABpar depends on MOAB).
+# Force a static MOABpar library in this case.
+if ( APPLE AND BUILD_SHARED_LIBS )
+  set ( MOABpar_LIB_TYPE "STATIC" )
+else ( APPLE AND BUILD_SHARED_LIBS )
+  if ( BUILD_SHARED_LIBS )
+    set ( MOABpar_LIB_TYPE "SHARED" )
+  else ( BUILD_SHARED_LIBS )
+    set ( MOABpar_LIB_TYPE "STATIC" )
+  endif ( BUILD_SHARED_LIBS )
+endif ( APPLE AND BUILD_SHARED_LIBS )
+
 set_source_files_properties( ${moab_PARALLEL_SRCS}
   COMPILE_FLAGS "-DIS_BUILDING_MB ${MOAB_DEFINES}"
 )
-add_library( MOABpar
+add_library( MOABpar ${MOABpar_LIB_TYPE}
   ${moab_PARALLEL_SRCS}
 )
 

Modified: MOAB/trunk/parallel/MBProcConfig.hpp
===================================================================
--- MOAB/trunk/parallel/MBProcConfig.hpp	2007-12-27 23:40:02 UTC (rev 1495)
+++ MOAB/trunk/parallel/MBProcConfig.hpp	2007-12-28 02:27:27 UTC (rev 1496)
@@ -23,7 +23,28 @@
 
 
 #ifdef USE_MPI
+/* MPICH2 will fail if SEEK_* macros are defined
+ * because they are also C++ enums. Undefine them
+ * when including mpi.h and then redefine them
+ * for sanity.
+ */
+#  ifdef SEEK_SET
+#    define MB_SEEK_SET SEEK_SET
+#    define MB_SEEK_CUR SEEK_CUR
+#    define MB_SEEK_END SEEK_END
+#    undef SEEK_SET
+#    undef SEEK_CUR
+#    undef SEEK_END
+#  endif
 #include "mpi.h"
+#  ifdef MB_SEEK_SET
+#    define SEEK_SET MB_SEEK_SET
+#    define SEEK_CUR MB_SEEK_CUR
+#    define SEEK_END MB_SEEK_END
+#    undef MB_SEEK_SET
+#    undef MB_SEEK_CUR
+#    undef MB_SEEK_END
+#  endif
 extern "C" 
 {
 #include "types.h"




More information about the moab-dev mailing list