- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am very much a beginner at this kind of thing so if anyone could help me out that would be great.
I have been trying to build the netcdf libraries on my Mac OS 10.6.7 system for a while now. I am using the intel C++ (version 12.0.3) and ifort (version 11.1) compilers. Everything seem to be fine and following all the online notes I have a lib directory with a number of library files. However, when it comes to running my fortran code I get this error
Undefined symbols:
"_netcdf_mp_nf90_open_", referenced from:
_MAIN__ in run_rttov.o
ld: symbol(s) not found
It is a very simple code I am running, I am just testing the setup by having the program open a netcdf file.
I run it will the following command
ifort -c -I/usr/local/include -L/usr/local/lib -lnetcdf -lcurl simple.F90
This work but then when I take the next step
ifort -I/usr/local/include -L/usr/local/lib -lnetcdf -lcurl simple.o
If anyone has an idea of where I am going wrong I would really appreciate the help
Thanks
I have been trying to build the netcdf libraries on my Mac OS 10.6.7 system for a while now. I am using the intel C++ (version 12.0.3) and ifort (version 11.1) compilers. Everything seem to be fine and following all the online notes I have a lib directory with a number of library files. However, when it comes to running my fortran code I get this error
Undefined symbols:
"_netcdf_mp_nf90_open_", referenced from:
_MAIN__ in run_rttov.o
ld: symbol(s) not found
It is a very simple code I am running, I am just testing the setup by having the program open a netcdf file.
I run it will the following command
ifort -c -I/usr/local/include -L/usr/local/lib -lnetcdf -lcurl simple.F90
This work but then when I take the next step
ifort -I/usr/local/include -L/usr/local/lib -lnetcdf -lcurl simple.o
If anyone has an idea of where I am going wrong I would really appreciate the help
Thanks
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We can decipher that missing symbol to help us;
_netcdf_mp_nf90_open_
"mp" tells us this is a Module Procedure. 'netcdf' is the module, and the procedure is 'nf90_open' that is missing.
Do you have a USE netcdf in the code calling netcdf? And in the netcdf sources, is procedure nf90_open defined?
if you
nm libnetcdf.a | grep -i nf90_open
do the symbol appear and does it have the Target attibute "T" and not the undefined reference "U"?
ron
_netcdf_mp_nf90_open_
"mp" tells us this is a Module Procedure. 'netcdf' is the module, and the procedure is 'nf90_open' that is missing.
Do you have a USE netcdf in the code calling netcdf? And in the netcdf sources, is procedure nf90_open defined?
if you
nm libnetcdf.a | grep -i nf90_open
do the symbol appear and does it have the Target attibute "T" and not the undefined reference "U"?
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I do have the use netcdf in my program yes
If I do nm libnetcdf.a | grep -i nf90_open
I see nothing but if I do that on
nm libnetcdff.a | grep -i nf90_open
I get
000000000000148a T _netcdf_mp_nf90_open_
0000000000003f9e T _netcdf_mp_nf90_open_mp_
Does that mean I'm looking in the wrong place?
Thanks
Lara
I do have the use netcdf in my program yes
If I do nm libnetcdf.a | grep -i nf90_open
I see nothing but if I do that on
nm libnetcdff.a | grep -i nf90_open
I get
000000000000148a T _netcdf_mp_nf90_open_
0000000000003f9e T _netcdf_mp_nf90_open_mp_
Does that mean I'm looking in the wrong place?
Thanks
Lara
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Thanks for your help I just fixed it I think.
I just need to call it like this
ifort -I/... -L/... -lnetcdf -lnetcdff -lcurl simple.F90
That seems to have worked.
Thanks
Lara
Thanks for your help I just fixed it I think.
I just need to call it like this
ifort -I/... -L/... -lnetcdf -lnetcdff -lcurl simple.F90
That seems to have worked.
Thanks
Lara
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
cool, no, it means you need to link in this Fortran interface to netcdf with the other libraries, -lnetcdff
OPPS you beat me to the solution. :)
ron
OPPS you beat me to the solution. :)
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think the recommended order is -lnetcdff -lnetcdf
We all seem to be hitting the same question; current netcdf has this separate Fortran library, which isn't mentioned in the build instructions of individual applications.
We all seem to be hitting the same question; current netcdf has this separate Fortran library, which isn't mentioned in the build instructions of individual applications.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page