对“__intel_sse4_atol”问题的未定义引用

对“__intel_sse4_atol”问题的未定义引用

我正在尝试为 Xeon Phi 构建 OpenFOAM,但出现定义错误这里

icpc -std=c++0x -Dlinux64 -DWM_DP -wd327,525,654,819,1125,1476,1505,1572 -xHost -O2 -no-prec-div  -DNoRepository -I.. -I/root/OpenFOAM/OpenFOAM-2.3.0/src/transportModels/twoPhaseMixture/lnInclude -I/root/OpenFOAM/OpenFOAM-2.3.0/src/transportModels -I/root/OpenFOAM/OpenFOAM-2.3.0/src/transportModels/incompressible/lnInclude -I/root/OpenFOAM/OpenFOAM-2.3.0/src/transportModels/interfaceProperties/lnInclude -I/root/OpenFOAM/OpenFOAM-2.3.0/src/turbulenceModels/incompressible/turbulenceModel -I/root/OpenFOAM/OpenFOAM-2.3.0/src/finiteVolume/lnInclude -I/root/OpenFOAM/OpenFOAM-2.3.0/src/meshTools/lnInclude -I/root/OpenFOAM/OpenFOAM-2.3.0/src/fvOptions/lnInclude -I/root/OpenFOAM/OpenFOAM-2.3.0/src/sampling/lnInclude -IlnInclude -I. -I/root/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude -I/root/OpenFOAM/OpenFOAM-2.3.0/src/OSspecific/POSIX/lnInclude   -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64IccDPOpt/porousInterFoam.o -L/root/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64IccDPOpt/lib \
             -ltwoPhaseMixture -linterfaceProperties -ltwoPhaseProperties -lincompressibleTransportModels -lincompressibleTurbulenceModel -lincompressibleRASModels -lincompressibleLESModels -lfiniteVolume -lmeshTools -lfvOptions -lsampling -lOpenFOAM -ldl   -L/lib -lm -o /root/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64IccDPOpt/bin/porousInterFoam
ld: warning: libimf.so, needed by /root/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64IccDPOpt/lib/libtwoPhaseMixture.so, not found (try using -rpath or -rpath-link)
ld: warning: libsvml.so, needed by /root/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64IccDPOpt/lib/libtwoPhaseMixture.so, not found (try using -rpath or -rpath-link)
ld: warning: libirng.so, needed by /root/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64IccDPOpt/lib/libtwoPhaseMixture.so, not found (try using -rpath or -rpath-link)
ld: warning: libintlc.so.5, needed by /root/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64IccDPOpt/lib/libtwoPhaseMixture.so, not found (try using -rpath or -rpath-link)
/root/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64IccDPOpt/lib/libtriSurface.so: undefined reference to `__intel_sse4_atol'

我搜索了 libimf.so,在这里找到了它:

/opt/intel/composer_xe_2013_sp1.1.106/compiler/lib/mic/libimf.so
/opt/intel/composer_xe_2013_sp1.1.106/compiler/lib/ia32/libimf.so
/opt/intel/composer_xe_2013_sp1.1.106/compiler/lib/intel64/libimf.so
/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/mic/libimf.so
/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/ia32/libimf.so
/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/intel64/libimf.so

我应该把-rpath or -rpath-link旗帜放在哪里?

或者我应该先运行这个命令?

/opt/intel/composer_xe_2013_sp1.2.144/bin/compilervars_arch.sh mic

答案1

您应该bin/compilervars.sh在进行编译之前获取脚本。这将设置所有必需的环境变量。

在您的情况下最重要的是它LD_LIBRARY_PATH应该包含对路径的引用:

/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/mic
/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/intel64"

Compilervars 脚本将对此进行设置。

我不建议设置rpathrpath-link手动,因为如果您采购compilervars.sh.

相关内容