我正在尝试编译一个包,但它在 math.h 上出错。请参阅下面的日志文件。
我正在使用 OS X Mavericks 和 Xcode 5.0.1。我按照本教程安装了 Open MPI 。
port install openmpi
暂时不适用于 OS X Mavericks。
可能是我缺少一个库或编译器有问题吗?
它在另一台机器上成功编译。我认为它有 OS X 10.8,并且 openmpi 是通过该机器上的端口安装的。
Compiling TemperatureFieldToolsForComptonHeating.C
Compiling WritePhotonSources.C
Compiling hydro_rk/ModifiedBesselFunctions.C
Compiling hydro_rk/AGNDiskInitialize.C
mpic++ -c -o hydro_rk/AGNDiskInitialize.o -DLINUX -DH5_USE_16_API -D__max_subgrids=100000 -D__max_baryons=30 -D__max_cpu_per_node=8 -D__memory_pool_size=100000 -DINITS64 -DLARGE_INTS -DCONFIG_PINT_8 -DIO_32 -DUSE_MPI -DCONFIG_PFLOAT_8 -DCONFIG_BFLOAT_8 -DUSE_HDF5_GROUPS -DTRANSFER -DNEW_GRID_IO -DFAST_SIB -DENZO_PERFORMANCE -DSAB -g -I/Users/tangqi/soucecode/enzo-stable/yt-x86_64/include -I/Developer/CUDA/common/inc -I/usr/local/include -I. hydro_rk/AGNDiskInitialize.C
In file included from hydro_rk/AGNDiskInitialize.C:11:
In file included from /usr/local/include/Grid.h:62:
In file included from /usr/local/include/ovector.h:47:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:662:1: error: redefinition of 'abs' abs(double __x) _NOEXCEPT {return fabs(__x);}
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:658:1: note: previous definition is here abs(float __x) _NOEXCEPT {return fabsf(__x);}
...