Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

Problem compilling with ifort, error message:undefined reference to `lunits_mp_logdev_'

nseror
Beginner
1,968 Views
Hi,

I try to compile with ifort a programm written by the members of my lab to modify netcdf file using IOAPI library. This programm is ussually compile with pgf without any problems, however we need to use it on our new cluster using ifort. Then we get this error message:

ifort -openmp -I /global/home/users/nseror/install/lib/ioapi/ioapi/fixed_src -o changestime.exe changestime.F fdescstruct.o -L/global/home/users/nseror/install/lib/ioapi/Linux2_x86_64ifort -lioapi -L/global/software/centos-5.x86_64/modules/netcdf/4.0-intel/lib -lnetcdf
/tmp/ifortn8G15K.o: In function `MAIN__':
changestime.F:(.text+0xb2): undefined reference to `lunits_mp_logdev_'
changestime.F:(.text+0xfc): undefined reference to `lunits_mp_logdev_'
changestime.F:(.text+0x125): undefined reference to `lunits_mp_logdev_'
changestime.F:(.text+0x4de): undefined reference to `lunits_mp_logdev_'
changestime.F:(.text+0x617): undefined reference to `lunits_mp_logdev_'
changestime.F:(.text+0x691): undefined reference to `lunits_mp_lunconch_'
changestime.F:(.text+0xb2f): undefined reference to `lunits_mp_logdev_'
fdescstruct.o: In function `fdesc3_compare_':
fdescstruct.F:(.text+0xf3): undefined reference to `lunits_mp_lunconch_'
fdescstruct.F:(.text+0x258): undefined reference to `lunits_mp_lunconch_'
fdescstruct.F:(.text+0x3bd): undefined reference to `lunits_mp_lunconch_'
fdescstruct.F:(.text+0x522): undefined reference to `lunits_mp_lunconch_'
fdescstruct.F:(.text+0x687): undefined reference to `lunits_mp_lunconch_'
fdescstruct.o:fdescstruct.F:(.text+0x7ec): more undefined references to `lunits_mp_lunconch_' follow
exit 0

It seems to be a flag problem, the optional command I use to compile it are:

ifort -openmp -I /global/home/users/nseror/install/lib/ioapi/ioapi/fixed_src -o changestime.exe changestime.F fdescstruct.o -L/global/home/users/nseror/install/lib/ioapi/Linux2_x86_64ifort -lioapi -L/global/software/centos-5.x86_64/modules/netcdf/4.0-intel/lib -lnetcdf

Someone could help me please

Thanks
0 Kudos
1 Solution
Steven_L_Intel1
Employee
1,968 Views
These errors indicate that you have not also linked in the .o file created when module LUNITS was compiled. That is required.

View solution in original post

0 Kudos
4 Replies
Steven_L_Intel1
Employee
1,969 Views
These errors indicate that you have not also linked in the .o file created when module LUNITS was compiled. That is required.
0 Kudos
nseror
Beginner
1,968 Views
Thank you very much
0 Kudos
erandall
Beginner
1,968 Views
I'm having the same problem, how do I link the .o file?

Thanks,
Eric
0 Kudos
mecej4
Honored Contributor III
1,968 Views
The standard command for linking is

... -L -l -l ...

where <..> is text that you supply, using the following rules:

is the name of the Fortran compiler driver (ifort).

... are the names of object files produced by compiling your Fortran sources

is used to link in library "liblibA.a" or "liblibA.so", etc.

and any other needed compiler options are placed after .

This topic is well covered in the Fortran Users Guide.

0 Kudos
Reply