Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29261 Discussions

Problems compiling netcdf 4.1.3 with ifort

basuradek
Beginner
2,362 Views
Hi all.

I am trying to compile netcdf 4.1.3 (http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.1.3.tar.gz) with ifort (intel fortran composer XE for linux) and gcc. I try to follow the instructions from netcdf and from intel (http://software.intel.com/en-us/articles/performance-tools-for-software-developers-building-netcdf-with-the-intel-compilers/). What I do it's the following:

$ ./configure --prefix=/usr/local --disable-netcdf-4 CC=gcc CXX=g++ CFLAGS='-O2 -m64' CXXFLAGS='-O2 -m64' F77=/opt/intel/bin/ifort FC=/opt/intel/bin/ifort F90=/opt/intel/bin/ifort FFLAGS='-O3 -xT -ip -no-prec-div -m64'
$ make
$ make check

after some tests the output shows the following:

[...]
/bin/bash ../libtool --tag=FC --mode=link /opt/intel/bin/ifort -I../fortran -I../f90 -I../f90 -I../include -g -o tst_f90 tst_f90.o ../fortran/libnetcdff.la -lm
libtool: link: /opt/intel/bin/ifort -I../fortran -I../f90 -I../f90 -I../include -g -o .libs/tst_f90 tst_f90.o ../fortran/.libs/libnetcdff.so /home/kiko/Descargas/netcdf-4.1.3/liblib/.libs/libnetcdf.so -lm
ld: warning: libifcore.so.5, needed by ../fortran/.libs/libnetcdff.so, not found (try using -rpath or -rpath-link)
ld: warning: libimf.so, needed by ../fortran/.libs/libnetcdff.so, not found (try using -rpath or -rpath-link)
ld: warning: libsvml.so, needed by ../fortran/.libs/libnetcdff.so, not found (try using -rpath or -rpath-link)
ld: warning: libintlc.so.5, needed by ../fortran/.libs/libnetcdff.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/libifport.so.5: undefined reference to `__intel_sse2_strrchr'
/usr/local/lib/libifport.so.5: undefined reference to `__FFresetseed'
/usr/local/lib/libifport.so.5: undefined reference to `flushqq_'
/usr/local/lib/libifport.so.5: undefined reference to `_status87'
/usr/local/lib/libifport.so.5: undefined reference to `__msportlib_set_posix_io_flag'
/usr/local/lib/libifport.so.5: undefined reference to `_clearfp'
/usr/local/lib/libifport.so.5: undefined reference to `__msportlib_d_readchar'
/usr/local/lib/libifport.so.5: undefined reference to `__msportlib_d_gethandle'
/usr/local/lib/libifport.so.5: undefined reference to `__FFsetseed'
/usr/local/lib/libifport.so.5: undefined reference to `for_errsns_load'
/usr/local/lib/libifport.so.5: undefined reference to `__FFfrand'
/usr/local/lib/libifport.so.5: undefined reference to `__msportlib_d_curpos'
/usr/local/lib/libifport.so.5: undefined reference to `__FFirand'
/usr/local/lib/libifport.so.5: undefined reference to `for_secnds_t'
/usr/local/lib/libifport.so.5: undefined reference to `_statusfp'
/usr/local/lib/libifport.so.5: undefined reference to `_controlfp'
/usr/local/lib/libifport.so.5: undefined reference to `_clear87'
/usr/local/lib/libifport.so.5: undefined reference to `for_getarg'
/usr/local/lib/libifport.so.5: undefined reference to `__msportlib_d_curpos_i8'
/usr/local/lib/libifport.so.5: undefined reference to `for_nargs'
/usr/local/lib/libifport.so.5: undefined reference to `__msportlib_d_writechar'
/usr/local/lib/libifport.so.5: undefined reference to `for_fdopen'
/usr/local/lib/libifport.so.5: undefined reference to `_control87'
/usr/local/lib/libifport.so.5: undefined reference to `__msportlib_d_fseek'
/usr/local/lib/libifport.so.5: undefined reference to `commitqq_'
/usr/local/lib/libifport.so.5: undefined reference to `__FFdrand'
/usr/local/lib/libifport.so.5: undefined reference to `__msportlib_d_fseek_i8'
/usr/local/lib/libifport.so.5: undefined reference to `__intel_sse2_strtok'
/usr/local/lib/libifport.so.5: undefined reference to `__FFgetseed'
make[2]: *** [tst_f90] Error 1
make[2]: se sale del directorio /home/user/Downloads/netcdf-4.1.3/nf_test
make[1]: *** [check-am] Error 2
make[1]: se sale del directorio /home/user/Downloads/netcdf-4.1.3/nf_test
make: *** [check-recursive] Error 1

I'm on Ubuntu 11.10 64 bits.

What i'm doing wrong?

Thanks in advance for any help.

Best.
0 Kudos
2 Replies
TimP
Honored Contributor III
2,362 Views
You should set up the ifort environment acccording to instructions (e.g. by sourceing ifortvars). I don't care to research whether NetCDF supports Ubuntu install, or may require script modification; that's your job. It looks a bit like you headed off into a Windows configuration.
0 Kudos
mecej4
Honored Contributor III
2,362 Views
You have probably messed up LD_LIBRARY_PATH. Have you seen this page with tips on getting NetCDF to work ? See also this thread on similar problems.
0 Kudos
Reply