符号查找错误:_FileName_:未定义的符号:_intel_fast_memmove [英] Symbol lookup error: _FileName_: undefined symbol: _intel_fast_memmove

查看:635
本文介绍了符号查找错误:_FileName_:未定义的符号:_intel_fast_memmove的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在努力将Fortran和C ++代码链接在一起,并且在尝试运行可执行文件时遇到上述错误.我已经在寻找其他解决方案,但是到目前为止,我发现的所有内容都没有帮助.我会尽力将所有内容都包括在内,但是我对这种东西不是很好,所以如果还有其他需要/有用的地方,请告诉我,我将继续研究.

So I'm working on linking together a Fortran and a C++ code, and I'm getting the above error when I try and run the executable. I've done some searching for other solutions, and none of the things I've found so far have helped. I'll try and include everything, but I'm not that great with this kind of stuff so if there's anything else that is needed/useful to see let me know and I'll go grab it.

Makefile:

LDLIBS = -I/share/apps/intel/composer_xe_2011.sp1.10.319/mkl/include \
         -L/share/apps/intel/composer_xe_2011_sp1.10.319/mkl/lib/intel64 \
         -I/share/apps/intel/composer_xe_2011_sp1.10.319/mkl/interfaces/lapack95/source\
         -mkl -openmp -reentrancy threaded

INCLUDE = -I/path/mstl/include \
          -I/path/mstl/include/physics \
          -I/path/mstl/include/math2 \
          -I/path/mstl/include/math2/algebra \
          -I/path/mstl/include/mat2/analysis \
          -I/path/mstl/include/math2/data \
          -I/path/mstl/include/math2/geometry \
          -I/path/mstl/include/math2/group \
          -I/path/mstl/include/math2/spline \
          -I/path/mstl/include/math2/probabilityandstatistics

LIBRARY = -L/path/mstl/lib

FC = ifort -c             #f compiler
CC = icc -c               #c compiler
LK = ifort -v -o ../abXX  #linker

CF = -mcmodel=large -i-dynamic -no-ipo -r8 -xW -traceback -fpe0 #f compile flags
OF = $(CF) -O2                                                  #f optimization flags
DF = $(CF) -g -debug -fpskchk -C -warn interfaces               #f debug flags

OPTIONS = -O -loops -lstdc++ -lmstl.icc          #c compile flags
LKOPS = -icc -lstdc++ -lmstl.icc -cxxlib -lintlc #linking options for C libs

COMP = $(FC) $(OF)                               #fortran compiler
CMP = $(CC) $(LIBRARY) $(INCLUDE) $(OPTIONS)     #C++ compiler
LINK = $(LK) $(OF)                               #program linker

MODULES = list of all fortran .o files here. 

COBJS = list of all c++ .o files here.

.cpp.o:
       $(CMP) $<

.f.o:
       $(COMP) $<

../abXX: $(MODULES) $(COBJS)
        $(LINK) $(MODULES) $(COBJS) $(LDLIBS) $(LIBRARY) $(INCLUDE) $(LKOPS)

clean:
      rm -v -f *.o *.mod ../abXX

.mybashrc:

.mybashrc:

echo "I exist in mybashrc"

export PATH=$PATH:/opt/intel/composer_xe_2011_sp1/bin
export PATH=$PATH:/opt/INTEL/bin

source /opt/INTEL/bin/compilervars.sh intel64
export LD_LIBRARY_PATH = $LD_LIBRARY_PATH:/opt/intel/composerxe/mkl/lib/intel64/
export LD_LIBRARY_PATH = /opt/intel/composer_xe_2011_sp1.10.319/compiler/lib/intel64/:$LD_LIB_PATH

export INTEL_LICENSE_FILE = /opt/INTEL/licenses/client.lic

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/mkl/lib/intel64

错误消息:

./../abXX: symbol lookup error: ./../abXX: undefined symbol: _intel_fast_memmove

我还运行了以下小脚本来寻找其他未定义的符号:

I've also run the following little script looking for other undefined symbols:

nm --line-numbers --print-file-name --undefined-only --no-sort *.o > errorlist.txt
grep _intel_fast_ errorlist.txt > intelerrors.txt

执行此操作时,我实际上发现在Fortran文件中有大量对_intel_fast_memcpy和_intel_fast_memset的未定义引用. _intel_fast_memmove仅在其中一个cpp文件中显示为丢失.

When I do this I actually find that there are a large number of undefined references to _intel_fast_memcpy and _intel_fast_memset among the Fortran files. the _intel_fast_memmove only appears as missing in one of the cpp files.

我也发现这很奇怪,因为不带c的Fortran代码运行得很好.我没有对Fortran代码进行任何更改.我只是从指定的make文件中删除了INCLUDE,LIBRARY,CC,OPTIONS,LKOPS,CMP和COBJS的定义,../abXX的配方就变成了

I also found this weird because the Fortran code without the c runs just fine. I don't make any changes to the Fortran code. I just remove the definition of INCLUDE, LIBRARY, CC, OPTIONS, LKOPS, CMP, and COBJS from the specified make file and the recipe for ../abXX becomes

$(LINK) $(MODULES) $(LDLIBS)

我认为我已经将我看到的所有内容都包含在其他因类似错误而查看的线程中,我还可以发布其他可能有用的内容.

I think I've included everything I've seen asked for on other threads I've looked at with similar errors, I can post anything else that might be useful as well.

根据要求:

echo $LD_LIBRARY_PATH的结果:

/opt/intel/composer_xe_2011_sp1.10.319/compiler/lib/intel64/:/opt/INTEL/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64:/opt/INTEL/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64_lin:/opt/INTEL/compilers_and_libraries_2016.3.210/linux/ipp/lib/intel64:/opt/INTEL/compilers_and_libraries_2016.3.210/linux/compiler/lib/intel64:/opt/INTEL/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64:/opt/INTEL/compilers_and_libraries_2016.3.210/linux/tbb/lib/intel64/gcc4.4:/opt/INTEL/debugger_2016/libipt/intel64/lib:/opt/INTEL/compilers_and_libraries_2016.3.210/linux/daal/lib/intel64_lin:/opt/INTEL/compilers_and_libraries_2016.3.210/linux/daal/../tbb/lib/intel64_lin/gcc4.4:/opt/INTEL/compilers_and_libraries_2016.3.210/linux/daal/../compiler/lib/intel64_lin::/opt/intel/composerxe/mkl/lib/intel64/:/opt/intel/composerxe/mkl/lib/intel64/:/opt/intel/mkl/lib/intel64

ldd ../abXX'的结果

results of `ldd ../abXX'

linux-vdso.so.1 =>  (0x00007fffb51b8000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003171800000)
libintlc.so.5 => /opt/intel/composer_xe_2011_sp1.10.319/compiler/lib/intel64/libintlc.so.5 (0x00007fc93b678000)
libmkl_intel_lp64.so => /opt/INTEL/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64/libmkl_intel_lp64.so (0x00007fc93ab68000)
libmkl_intel_thread.so => /opt/INTEL/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64/libmkl_intel_thread.so (0x00007fc939238000)
libmkl_core.so => /opt/INTEL/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64/libmkl_core.so (0x00007fc937820000)
libiomp5.so => /opt/intel/composer_xe_2011_sp1.10.319/compiler/lib/intel64/libiomp5.so (0x00007fc937528000)
libifport.so.5 => /opt/intel/composer_xe_2011_sp1.10.319/compiler/lib/intel64/libifport.so.5 (0x00007fc9373f0000)
libifcoremt.so.5 => /opt/intel/composer_xe_2011_sp1.10.319/compiler/lib/intel64/libifcoremt.so.5 (0x00007fc937178000)
libimf.so => /opt/intel/composer_xe_2011_sp1.10.319/compiler/lib/intel64/libimf.so (0x00007fc936da8000)
libsvml.so => /opt/intel/composer_xe_2011_sp1.10.319/compiler/lib/intel64/libsvml.so (0x00007fc936628000)
libm.so.6 => /lib64/libm.so.6 (0x000000316b000000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003171400000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x000000316b400000)
libdl.so.2 => /lib64/libdl.so.2 (0x000000316b800000)
libc.so.6 => /lib64/libc.so.6 (0x000000316ac00000)
/lib64/ld-linux-x86-64.so.2 (0x000000316a800000)

推荐答案

Intel编译器随附安装程序外壳文件.对于bash,这些将是ifortvars.shiccvars.sh.采购那些具有正确环境(此处为LD_LIBRARY_PATH)设置的设备.

Intel compilers come with a setup shell file. For bash, those will be ifortvars.sh and iccvars.sh. Source those to have the environment (here, the LD_LIBRARY_PATH) setup properly.

检查使用ldd生成的文件.如果您的环境未正确设置,它将告诉您未找到哪些.so文件.

Check the file that you produce with ldd. If your environment is not properly setup it will tell you which .so files are not found.

这篇关于符号查找错误:_FileName_:未定义的符号:_intel_fast_memmove的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆