Symbol lookup error: _FileName_: undefined symbol: _intel_fast_memmove

时光怂恿深爱的人放手 提交于 2019-12-10 11:20:01

问题


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:

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

error message:

./../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

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.

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.

EDIT: As requested:

results of 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

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)

回答1:


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.

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.



来源:https://stackoverflow.com/questions/41227312/symbol-lookup-error-filename-undefined-symbol-intel-fast-memmove

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!