**************************************************************************** BUILD NOTES FOR SAMRAI-v2.1.0 on Mac OS X (10.4.9) Compilers: GCC 4 + gfortran Kevin T. Chu (Princeton University) 2007/05/20 Acknowledgements: These notes are based on a very similar set of notes by Kevin T. Chu and Daniel Thorpe (2006/04/01). **************************************************************************** ----------------------------------------------------------------------------- - Problem: Mac OS X installs malloc.h in a slightly unusual location (/usr/include/malloc/malloc.h) Fix (temporary): (1) Add the absolute path to malloc.h to the MemoryUtilities.C (2) Alternatively, added /usr/include/malloc to CPATH environment variable to add it to the standard search path used by GCC to find header files. Fix (permanent): Modify configure script to check if /usr/include/malloc needs to be added to the include path. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- - Problem: mallinfo structure is not defined on Mac OS X platform. Fix: added "#ifdef HAVE_TAU" wrapper to MemoryUtilties::printMemoryInfo(). (line 63 of toolbox/memory/MemoryUtilities.C) ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- - Problem: Mac OS X is case insensitive, so SAMRAI's MPI.h gets mixed up with the MPI header file mpi.h Fix: changed #include "mpi.h" to #include so that the system header file is found first ----------------------------------------------------------------------------- ---------------------------------------------------------------------------- - Problem: ISO C++ standard does not include isnan() in . Fix: In toolbox/base/IEEE.C and toolbox/templates/special/MathUtilitiesSpecial.C, explicitly access definitions of isnan() defined in the C header file math.h. For GCC 3, replace isnan() with: __isnan() and __isnand() For GCC 4 on Intel, replace isnan() with: __inline_isnan() and __inline_isnand() For GCC 4 on PPC, replace isnan() with: __isnan() and __isnand() For float version, added the following lines: ========================================================== #if defined(__APPLE__) #if defined(__GNUC__) && (__GNUC__ >= 4) && (defined(__ppc__) || defined(__ppc64__)) int i = __isnanf(f); #elif defined(__GNUC__) && (__GNUC__ >= 4) && (defined (__i386__) || defined( __x86_64__ )) int i = __inline_isnanf(f); #elif defined(__GNUC__) int i = __isnanf(f); #else int i = isnan(f); #endif #else int i = isnan(f); #endif ========================================================== For double version, added the following lines: ========================================================== #if defined(__APPLE__) #if defined(__GNUC__) && (__GNUC__ >= 4) && (defined(__ppc__) || defined(__ppc64__)) int i = __isnand(d); #elif defined(__GNUC__) && (__GNUC__ >= 4) && (defined (__i386__) || defined( __x86_64__ )) int i = __inline_isnand(d); #elif defined(__GNUC__) int i = __isnand(d); #else int i = isnan(d); #endif #else int i = isnan(d); #endif ========================================================== ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- - Problem: Configure process explicitly specifies system libraries causing confusion for the linker. Fix (temporary): Post-processing of config/Makefile.config after the configure script is run to remove offending libraries. Unfortunately, Paul Henning's fix only takes care of the problem when the configure script determines the fortran libraries. If the libraries for other software packages are not explicitly specified (e.g. MPI), then we get the same problem anyways. Fix (permanent): fix the configure script to check for the Mac OS X architecture (darwin) and strip out the offending libraries. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- - Problem: 'make install' does not work ... it just returns comment "make: `install' is up to date." The reason for this is that the file system on Mac OS X is not case sensitive, so the make system gets "install" mixed-up with the file "INSTALL" Fix: changed the name of install target in the Makefile after running the configure script. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- - Problem: Special considerations for gfortran compiler (2) Need to use "--with-fortran-libs=-lgfortran" to correctly pick up the math library functions during the link stage. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- Problem: Using H5T_NATIVE_CHAR for "data_is_defined" field of VisIt causes VisIt data files to be unreadable by VisIt. Fix: Change the HDF5 data type to H5T_NATIVE_INT for "data_is_defined" field in SAMRAI/source/apputils/plotting/VisItDataWriter.C -----------------------------------------------------------------------------