- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm attempting to merge a fortran and a C++ code, a process that has been fraught with errors. The most recent one however has me stumped and I can't figure out what's wrong/how to fix it. I'm including everything I've seen requested for similar errors i've found. let me know if there's any other information that is useful for figuring out what this is.
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 hraded INCLUDE = -I/physics/username/mstl/include \ -I/physics/username/mstl/include/physics \ -I/physics/username/mstl/include/math2 \ -I/physics/username/mstl/include/math2/algebra \ -I/physics/username/mstl/include/math2/analysis \ -I/physics/username/mstl/include/math2/data \ -I/physics/username/mstl/include/math2/geometry \ -I/physics/username/mstl/include/math2/group \ -I/physics/username/mstl/include/math2/spline \ -I/physics/username/mstl/include/math2/probabilityandstatistics LIBRARY = -L/physics/username/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 -fpstkchk -C -warn interfaces #f debug flags OPTIONS = -O -loops -lstdc++ -lmstl.icc #c compile flags LKOPS = -icc -lstdc++ -lmstl.icc -cxxlib -lintlc #c lib linking options COMP = $(FC) $(OF) # fortran compiler CMP = $(CC) $(LIBRARY) $(INCLUDE) $(OPTIONS) #c compiler LINK = $(LK) $(OF) 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 startup file:
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
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)
I'm running with ifort version: 12.1.4 20120410
and icc version:
16.0.3 20160415
When I execute the above makefile, the code compiles and I get my executable, however when I attempt to run the program I get the following error:
./../abXX: symbol lookup error: ./../abXX: undefined symbol: _intel_fast_memmove
The fortran code without the c++ code added in will compile and run just fine. I also used the nm command to look at all undefined symbols and the both the code with and without the c is crawling with _intel_fast_memset and _intel_fast_memcpy as undefined symbols. Only the c code has an instance of _intel_fast_memmove missing.
Any help in resolving this would be greatly appreciated,
CS
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you try to re-build the fortran code with the same version of 16 as the C++ compiler?
Thanks,
Xiaoping Duan
Intel Customer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That isn't an option as far as I know. I'm on a university network, and as far as I can tell we only have the v12 ifort and the v16 icc compilers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We recommend using the same major version of icc and ifort in mixed language program. The gap between v12 ifort and v16 icc may cause this issue. Can you append "-Xlinker --cref" to "LINK" setting, re-direct the linkage output to a file and then check the file to see how the missing symbol was resolved during the linkage?
Thanks,
Xiaoping Duan
Intel Customer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If combining different versions of Intel compilers, you must take care to link against the libraries from the newer one. As pointed out above, you are taking this to extremes, and may be better off using ifort with g++ if you don't have a matching icpc.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page