Netcdf error during compiling

243 views
Skip to first unread message

Aneesh Subramanian

unread,
Feb 9, 2015, 1:39:34 PM2/9/15
to gotm-...@googlegroups.com
Hi,

 I'm getting a netcdf error while trying to compile GOTM on a new machine. Am unsure if its a problem with the netcdf libraries and the fortran compiler. 

 I'm using the gfortran compiler and the netcdf version is: 4.3.1. The error I'm getting is:

________________________________________________________________________________________________________________________
/home/subramanian/GOTM/gotm-git/lib/GFORTRAN/liboutput_prod.a(ncdfout.o): In function `__ncdfout_MOD_init_ncdf':
ncdfout.F90:(.text+0x81d5): undefined reference to `__netcdf_MOD_nf90_put_att_text'
ncdfout.F90:(.text+0x8314): undefined reference to `__netcdf_MOD_nf90_put_att_text'
ncdfout.F90:(.text+0x8339): undefined reference to `__netcdf_MOD_nf90_put_att_text'
ncdfout.F90:(.text+0x835b): undefined reference to `__netcdf_MOD_nf90_enddef'
ncdfout.F90:(.text+0x83cc): undefined reference to `__netcdf_MOD_nf90_sync'
ncdfout.F90:(.text+0x84bc): undefined reference to `__netcdf_MOD_nf90_def_var_manydims'
ncdfout.F90:(.text+0x8641): undefined reference to `__netcdf_MOD_nf90_def_dim'
ncdfout.F90:(.text+0x8928): undefined reference to `__netcdf_MOD_nf90_def_var_manydims'
ncdfout.F90:(.text+0x89f3): undefined reference to `__netcdf_MOD_nf90_def_var_manydims'
ncdfout.F90:(.text+0x8b53): undefined reference to `__netcdf_MOD_nf90_strerror'
/home/subramanian/GOTM/gotm-git/lib/GFORTRAN/liboutput_prod.a(ncdfout.o): In function `__ncdfout_MOD_check_err.part.0':
ncdfout.F90:(.text.unlikely+0x44): undefined reference to `__netcdf_MOD_nf90_strerror'
collect2: ld returned 1 exit status
make: *** [gotm_prod_GFORTRAN] Error 1
________________________________________________________________________________________________________________________

 Has anyone else had this problem before ? 

Thanks,
Aneesh

Knut

unread,
Feb 9, 2015, 2:19:28 PM2/9/15
to gotm-...@googlegroups.com
Hi Aneesh,

I assume you are using the traditional Makefiles? Did you export NETCDF_VERSION=NETCDF4, in order that nf-config will provide all necessary information?

Regarding your error message, it would be helpful to see the link command that caused the error.

Cheers,
Knut
--
You received this message because you are subscribed to the Google Groups "GOTM-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gotm-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aneesh Subramanian

unread,
Feb 9, 2015, 2:30:26 PM2/9/15
to gotm-...@googlegroups.com
Hi Knut,

 Thanks for your reply. Yes, I am using the traditional Makefile in the src directory. 

 It looks like the error is occurring even earlier. The compile error starts with "nf-config: Command not found". I missed this earlier.

 Please see the full error below. I just tried with export NETCDF_VERSION=NETCDF4, but this didn't help the compiling. I get the same error. Any advice ?
___________________________________________________________________________________________
make -C gotm all
make[1]: Entering directory `/plumdata2/PLUM_SHARED/OceanMixing/GOTM/gotm-git/src/gotm'
make[1]: `all' is up to date.
make[1]: Leaving directory `/plumdata2/PLUM_SHARED/OceanMixing/GOTM/gotm-git/src/gotm'
make: nf-config: Command not found
make: nf-config: Command not found
gfortran -o gotm_prod_GFORTRAN ./gotm/main.o  -DGFORTRAN -DNETCDF_FMT -DNETCDF4 -DSEAGRASS -DNO_0D_BIO -DPRODUCTION  -DFORTRAN2003 -DREAL_4B=real\(4\) -O3  -J/plumdat\
a1/home/aneeshcs/OceanMixing/GOTM/gotm-git/modules/GFORTRAN  -I -I/usr/local/include -I/plumdata1/home/aneeshcs/OceanMixing/GOTM/gotm-git/include -I/plumdata1/home/an\
eeshcs/OceanMixing/GOTM/gotm-git/modules/GFORTRAN -ffree-form -Wall -std=f2003 -pedantic -ffree-line-length-none -I/usr/local/include -L/usr/local/lib -lnetcdf -Wno-u\
nused -L/plumdata1/home/aneeshcs/OceanMixing/GOTM/gotm-git/lib/GFORTRAN -lgotm_prod  -lseagrass_prod -lairsea_prod -lmeanflow_prod -lturbulence_prod -lobservations_pr\
od -loutput_prod -linput_prod -lutil_prod
/plumdata1/home/aneeshcs/OceanMixing/GOTM/gotm-git/lib/GFORTRAN/liboutput_prod.a(ncdfout.o): In function `__ncdfout_MOD_define_mode':
ncdfout.F90:(.text+0x14): undefined reference to `__netcdf_MOD_nf90_enddef'
ncdfout.F90:(.text+0x21): undefined reference to `__netcdf_MOD_nf90_redef'
___________________________________________________________________________________________

Thanks,
Aneesh

--
You received this message because you are subscribed to a topic in the Google Groups "GOTM-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gotm-users/QGSNHdr4EaQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gotm-users+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Aneesh C. Subramanian

        Homepage
 

Knut

unread,
Feb 9, 2015, 2:36:05 PM2/9/15
to gotm-...@googlegroups.com
On 02/09/2015 08:30 PM, Aneesh Subramanian wrote:
Hi Knut,

 Thanks for your reply. Yes, I am using the traditional Makefile in the src directory. 

 It looks like the error is occurring even earlier. The compile error starts with "nf-config: Command not found". I missed this earlier.
good. seems that you already exported NETCDF_VERSION=NETCDF4 :-)
just go to your $HOME/bin and "ln -s `which nc-config` nf-config"
(create a symbolic link $HOME/bin/nf-config pointing to your nc-config).

Does this help?

Aneesh Subramanian

unread,
Feb 9, 2015, 2:51:16 PM2/9/15
to gotm-...@googlegroups.com
Hi Knut,

 Looks like the symbolic link in my bin directory to nc-config got rid of the netcdf error, but now I am getting a "/plumdata1/home/aneeshcs/bin/nf-config: fork: retry: Resource temporarily unavailable" message confinuously. 

 It doesn't stop even with Ctrl-C. 

Thanks,
Aneesh

Knut

unread,
Feb 9, 2015, 2:53:01 PM2/9/15
to gotm-...@googlegroups.com
On 02/09/2015 08:50 PM, Aneesh Subramanian wrote:
Hi Knut,

 Looks like the symbolic link in my bin directory to nc-config got rid of the netcdf error, but now I am getting a "/plumdata1/home/aneeshcs/bin/nf-config: fork: retry: Resource temporarily unavailable" message confinuously.
can you show me the output of "ls -l $HOME/bin/nf-config" please?

Aneesh Subramanian

unread,
Feb 9, 2015, 2:58:29 PM2/9/15
to gotm-...@googlegroups.com
Hi Knut,

 I seem to have got into some error loop. Even when I query the nf-config, it gives me the fork error. I created a soft link to the location of the nc-config. Should I have created a soft link to the command 'which nc-config' instead ? Here is the output/

$ ls -l $HOME/bin/nf-config
bash: fork: retry: Resource temporarily unavailable
bash: fork: retry: Resource temporarily unavailable
bash: fork: retry: Resource temporarily unavailable

Thanks,
Aneesh

Knut

unread,
Feb 9, 2015, 3:05:40 PM2/9/15
to gotm-...@googlegroups.com
the command `which nc-config` was with backticks (don't know whether they are really called like this...). On my system I could have also written:

ln -s /usr/bin/nc-config nf-config

Is this clearer now?

Aneesh Subramanian

unread,
Feb 9, 2015, 3:24:50 PM2/9/15
to gotm-...@googlegroups.com
Hi Knut,

 I got the sys-admin to kill the processes. Here is the output for the ls -l command

ls -l $HOME/bin/nf-config
lrwxrwxrwx 1 aneeshcs users 24 Feb  9 11:38 /plumdata1/home/aneeshcs/bin/nf-config -> /usr/local/bin/nc-config

 Did I define it wrongly ?

Thanks,
Aneesh

Karsten Bolding

unread,
Feb 9, 2015, 3:47:12 PM2/9/15
to gotm-...@googlegroups.com
Hi Aneesh

Try:
type nf-config

I get:
kb@orca ~/GOTM/gotm-git/src $ type nf-config
nf-config is /opt/netcdff-4.4.1-ifort-13.1.3/bin/nf-config


if you get a full path then try:
nf-config --all

should give you a lot of info on the NetCDF installation

And finally try
echo $NETCDF_VERSION
should give NETCDF4

apart from all this I'll suggest you try the CMake based building instead.

Karsten

Karsten 

Aneesh Subramanian

unread,
Feb 9, 2015, 5:58:36 PM2/9/15
to gotm-...@googlegroups.com
Hi Karsten,

 Thanks for the suggestions. I don't have a nf-config except for the softlink to the nc-config. But when I checked for the nc-config details, I get these configs for netcdf. It seems like the netcdf was configured with no --has-f90 option. Could this be a problem ? :
________________________________________________________________________

Mon Feb 09 14:53:37@plum>GOTM $nc-config --all

This netCDF 4.3.1-rc4 has been built with the following features: 

  --cc        -> gcc

  --cflags    ->  -I/usr/local/include -I/usr/local/include

  --libs      -> -L/usr/local/lib -lnetcdf

  --has-c++   -> no

  --cxx       -> 

  --has-c++4  -> no

  --cxx4      -> 

  --fc        -> 

  --fflags    -> 

  --flibs     -> 

  --has-f90   -> no

  --has-dap   -> yes

  --has-nc2   -> yes

  --has-nc4   -> yes

  --has-hdf5  -> yes

  --has-hdf4  -> no

  --has-pnetcdf-> no

  --prefix    -> /usr/local

  --includedir-> /usr/local/include

  --version   -> netCDF 4.3.1-rc4

________________________________________________________________________

Thanks,

Aneesh  

 


Knut

unread,
Feb 9, 2015, 6:24:49 PM2/9/15
to gotm-...@googlegroups.com
Dear Aneesh,
> Hi Karsten,
>
> Thanks for the suggestions. I don't have a nf-config except for the
> softlink to the nc-config. But when I checked for the nc-config
> details, I get these configs for netcdf. It seems like the netcdf was
> configured with no --has-f90 option. Could this be a problem ? :
of course this is a problem for GOTM (it is linking the Fortran libs)!
However, this should not cause the strange errors when calling your
nf-config...

Knut

Aneesh Subramanian

unread,
Feb 9, 2015, 6:34:52 PM2/9/15
to gotm-...@googlegroups.com
Dear Knut,

 Thanks for letting me know. I have asked the system admin to install netcdf4 with fortran lib support. Am not sure why the nf-config was giving me the fork error. 

 Will try this again with the new netcdf installation and let you know if it works.

Thanks,
Aneesh

Knut

unread,
Feb 9, 2015, 6:36:43 PM2/9/15
to gotm-...@googlegroups.com
ok.
please check, whether the netcdf version your admin installed already ships with its own nf-config...
--

Aneesh Subramanian

unread,
Feb 9, 2015, 7:00:06 PM2/9/15
to gotm-...@googlegroups.com
Hi Knut, Karsten,

 Thanks again for all the help. I was able to compile the code with a new version of netcdf with its own nf-config.

Knut

unread,
Feb 9, 2015, 7:04:13 PM2/9/15
to gotm-...@googlegroups.com
On 02/10/2015 01:00 AM, Aneesh Subramanian wrote:
> Hi Knut, Karsten,
>
> Thanks again for all the help. I was able to compile the code with a
> new version of netcdf with its own nf-config.
excellent.
(Does your admin have an idea why the strange error appeared?)

and now you can go for cmake... :-)
Reply all
Reply to author
Forward
0 new messages