undefined symbol: netcdf_mp_nf90_open_

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
youngstor
Posts: 29
Joined: Mon Mar 01, 2010 2:11 pm
Location: Georgia

undefined symbol: netcdf_mp_nf90_open_

#1 Unread post by youngstor »

Hi,

I guess my question is very similar to this one:
viewtopic.php?f=31&t=1992

But the difference is that I was able to compile ROMS successfully. The error showed when I ran ROMS.

I was able to compile ROMS (as part of COAWST. ROMS only with no coupling) using ifort with no errors. However, when I ran it, I got the following error:

Code: Select all

./coawstG: symbol lookup error: ./coawstG: undefined symbol: netcdf_mp_nf90_open_
I have already changed Compilers/Linux-ifort.mk from

Code: Select all

LIBS += -L$(NETCDF_LIBDIR) -lnetcdf
to

Code: Select all

LIBS += -L$(NETCDF_LIBDIR) -lnetcdff -lnetcdf
.

In my .bashrc, I defined the following:

Code: Select all

NETCDF_INCDIR=/usr/local/packages/netcdf/4.2/mvapich2-1.6/intel-11.1.059/include
NETCDF_LIBDIR=/usr/local/packages/netcdf/4.2/mvapich2-1.6/intel-11.1.059/lib
export NETCDF_INCDIR
export NETCDF_LIBDIR
In the directory of

Code: Select all

/usr/local/packages/netcdf/4.2/mvapich2-1.6/intel-11.1.059/lib
, I have run the following tests:

Code: Select all

$ nm libnetcdf.a | grep -i nf90_open
$

Code: Select all

$ nm libnetcdff.a | grep -i nf90_open
0000000000000290 T netcdf_mp_nf90_open_
00000000000000c0 T netcdf_mp_nf90_open_mp_
000000000004e110 T netcdf_mp_nf90_open_par_
It apparently shows

Code: Select all

netcdf_mp_nf90_open_
is right there. I remember I had a very similar error during compiling, but the error disappeared once I changed

Code: Select all

LIBS += -L$(NETCDF_LIBDIR) -lnetcdf
to

Code: Select all

LIBS += -L$(NETCDF_LIBDIR) -lnetcdff -lnetcdf
'.

Attached is the build log for your reference. Can someone help me point out what went wrong?

Thanks,
Xiufeng
Attachments
build.log
(313.96 KiB) Downloaded 373 times

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: undefined symbol: netcdf_mp_nf90_open_

#2 Unread post by kate »

Congratulations on getting this far! Your next problem is likely due to your LD_LIBRARY_PATH environment variable. Mine is long:

Code: Select all

pacman3 371% printenv LD_LIBRARY_PATH
/usr/local/pkg/geos/geos-3.3.8.gnu-4.7.3/lib:/usr/local/pkg/proj/proj-4.8.0.gnu-4.7.3/lib:/usr/local/pkg/gdal/gdal-1.10.0.gnu-4.7.3/lib:/usr/local/pkg/netcdf/netcdf-4.3.0.pgi-13.4/lib:/usr/local/pkg/openmpi/openmpi-1.4.3.pgi-13.4/lib:/usr/local/pkg/pgi/pgi-13.4/linux86-64/13.4/lib:/usr/local/pkg/pgi/pgi-13.4/linux86-64/13.4/libso:/usr/local/pkg/openmpi/openmpi-1.4.3.gnu-4.7.3/lib:/usr/local/pkg/gcc/gcc-4.7.3/lib:/usr/local/pkg/gcc/gcc-4.7.3/lib64:/usr/local/pkg/python/python-2.7.4/lib:/u1/uaf/kate/lib:/u1/uaf/kate/Python/lib:/usr/local/pkg/gcc/gcc-4.5.1/lib:/usr/local/pkg/gcc/gcc-4.5.1/lib64:/usr/local/pgi/lib:/usr/local/lib
On Mac this would be:

Code: Select all

DYLD_LIBRARY_PATH=/usr/local/gfortran/lib/gcc/x86_64-apple-darwin10/4.6.2:/Users/kate/lib
Your library path needs to include the location of all shared libraries you need, such as libnetcdff.so (or libnetcdff.dylib).

youngstor
Posts: 29
Joined: Mon Mar 01, 2010 2:11 pm
Location: Georgia

Re: undefined symbol: netcdf_mp_nf90_open_

#3 Unread post by youngstor »

Hi Kate,

I did what you suggested, and added the netcdf library to the LD_LIBRARY_PATH. I then did a test run, and got the following errors:

Code: Select all

 Initial basin volumes: TotVolume =  1.3165844712E+12 m3
                        MinVolume =  1.1469543535E+04 m3
                        MaxVolume =  1.0121271461E+09 m3
                          Max/Min =  8.8244762571E+04

forrtl: error (65): floating invalid
Image              PC                Routine            Line        Source             
coawstG            000000000078FA44  interpolate_mod_m         384  interpolate.f90
coawstG            00000000006661C6  get_2dparent_data         344  get_2dparent_data.f90
coawstG            00000000006582D3  get_2dparent_data          58  get_2dparent_data.f90
coawstG            000000000040F2FA  initial_                  288  initial.f90
coawstG            000000000040B8A4  ocean_control_mod         107  ocean_control.f90
coawstG            000000000040B406  MAIN__                     97  master.f90
coawstG            000000000040B1BC  Unknown               Unknown  Unknown
libc.so.6          000000399BA1ED1D  Unknown               Unknown  Unknown
coawstG            000000000040B0B9  Unknown               Unknown  Unknown
Aborted
Do you have any idea what this error implies?
Thanks,
Xiufeng
kate wrote:Congratulations on getting this far! Your next problem is likely due to your LD_LIBRARY_PATH environment variable. Mine is long:

Code: Select all

pacman3 371% printenv LD_LIBRARY_PATH
/usr/local/pkg/geos/geos-3.3.8.gnu-4.7.3/lib:/usr/local/pkg/proj/proj-4.8.0.gnu-4.7.3/lib:/usr/local/pkg/gdal/gdal-1.10.0.gnu-4.7.3/lib:/usr/local/pkg/netcdf/netcdf-4.3.0.pgi-13.4/lib:/usr/local/pkg/openmpi/openmpi-1.4.3.pgi-13.4/lib:/usr/local/pkg/pgi/pgi-13.4/linux86-64/13.4/lib:/usr/local/pkg/pgi/pgi-13.4/linux86-64/13.4/libso:/usr/local/pkg/openmpi/openmpi-1.4.3.gnu-4.7.3/lib:/usr/local/pkg/gcc/gcc-4.7.3/lib:/usr/local/pkg/gcc/gcc-4.7.3/lib64:/usr/local/pkg/python/python-2.7.4/lib:/u1/uaf/kate/lib:/u1/uaf/kate/Python/lib:/usr/local/pkg/gcc/gcc-4.5.1/lib:/usr/local/pkg/gcc/gcc-4.5.1/lib64:/usr/local/pgi/lib:/usr/local/lib
On Mac this would be:

Code: Select all

DYLD_LIBRARY_PATH=/usr/local/gfortran/lib/gcc/x86_64-apple-darwin10/4.6.2:/Users/kate/lib
Your library path needs to include the location of all shared libraries you need, such as libnetcdff.so (or libnetcdff.dylib).

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: undefined symbol: netcdf_mp_nf90_open_

#4 Unread post by kate »

It's something like a divide by zero in the interpolate code. It even gave you the line number!

youngstor
Posts: 29
Joined: Mon Mar 01, 2010 2:11 pm
Location: Georgia

Re: undefined symbol: netcdf_mp_nf90_open_

#5 Unread post by youngstor »

UPDATE: Problem solved!
The cluster I am using has several different versions of ifort and NETCDF installed.
Apparently I have to match the version numbers (if I use compiler ifort -v12.0.0.084, then I have to use the NETCDF that was compiled with the exactly same version of ifort, i.e. -v12.0.0.084. Even using ifort -v11.1.059 will cause above error)!

========================================================
Hi Kate,

Are you suggesting that I should modify the interpolate source code?

Actually, I was able to compile and run the exactly same code with the same input files with no problem by using gfortran compiler. Now I am trying to re-compile and re-run the exactly same case by using ifort compiler instead because I was told switching to ifort will speed up the model run.

Therefore, I believe the error shouldn't be from the source code, but should be related to switching to the intel compiler.

What do you think?

Thanks again,
Xiufeng
kate wrote:It's something like a divide by zero in the interpolate code. It even gave you the line number!

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: undefined symbol: netcdf_mp_nf90_open_

#6 Unread post by kate »

Yes, you have to match versions. Sometimes you get a compile-time error with mis-matched versions. If it's working now, no worries.

Post Reply