I'm working with the intel 17.0.1 20161005 compiler suite (icc, icpc, ifort) on NCAR's cheyenne machine (GNU/linux OS, Linux kernel 3.12.62-60.64.8-default, x86_64 architecture).
I'm getting a strange link error:
ld: ../../lib/libufo.so: undefined reference to symbol 'abort_'
/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin/libifport.so.5: error adding symbols: DSO missing from command line
mpas/mains/CMakeFiles/mpas_forecast.x.dir/build.make:120: recipe for target 'bin/mpas_forecast.x' failed
make: *** [bin/mpas_forecast.x] Error 1
The string 'abort_' does not appear in any of the source code so it must be put there by the compiler. I'm using SGI's MPT software library, if that matters. The application is mixed C++ and Fortran.
Any ideas where this is coming from? Thanks!
What is libufo.so? The Intel compiler would not insert a call to a routine named "abort_" unless 1) You had a call to "abort". 2) you used -assume underscore. My guess is that this reference comes from one of the libraries you are using and it makes some unwarranted assumptions about the environment.
I admit that I am not a Linux expert, but I don't think that the mention of libifport in the second error message indicates that's where the reference is.
Thanks Steve - You're right - libufo is an application built from source and it does indeed call an abort function. That does not give an error on other platforms but it's a good lead. I'll look into that further.
Indeed, abort is not an intrinsic procedure in Intel Fortran. The call might work with other compilers that supply a library routine named abort_. The trailing underscore is a Linux and MacOS convention for Fortran routines (I was mistaken above about your needing a switch to enable it.) While ifort offers an abort routine, it doesn't go by the name abort_ externally, so you need to USE IFPORT to get the right name.
Hopefully the last question on this thread -
How do I include the ifport module?
I'm on an HPC system so I enable the intel compilers through module load commands. I do not see ifport.f90 anywhere in the $INTEL_BASE_PATH or the $INTEL_COMPILER_BASE_PATH.
However, for this particular version I do see ifport.f90 here:
I could hardwire this into my build script but then I'd have to do some more detective work every time I load a new intel module/version.
If I do nothing, I get a "module not found" error when I "use ifport"
What is the best way to include to the ifort include directories?
The word "module" is used in this thread with two different meanings, and readers should guard against confusing the two. The first meaning is "Fortran module", typically a *.MOD file that is provided by the compiler vendor (or one that is generated by compiling a Fortran source file containing the declarations and routine bodies). The second meaning is "Linux environment module" , see http://modules.sourceforge.net/ .
Indeed - Thanks @mecj4 for the clarification.
In any case, this issue isn't resolved yet - I'm still getting a link error even when I "use ifport". My latest suspicion is that it's coming from the mixed C++/Fortran code base - I think it's using icc to do the linking - I'm going to try to switch that to ifort and see if that works.