GOTM compiling problem

266 views
Skip to first unread message

soheila

unread,
Feb 8, 2012, 10:00:06 PM2/8/12
to GETM-users
Hi All

I’m on my way to compile and use GETM and I have started pretty much
from scratch.

I am using 64 bit system and had no problem compiling fortran,
hdf5.1.8.6 and Netcdf4.1.3 all in Linux default folders, so I have
libnetcdf.a and libnetcdff.a in usr/local/lib.
Here is the way I set the environment variables to compile GOTM 4.0.0
(some might be redundant):

export FC=/opt/intel/bin/ifort;export F77=/opt/intel/bin/ifort;export
F90=/opt/intel/bin/ifort
export FORTRAN_COMPILER=IFORT;export IFORTVARS=/opt/intel/bin/
ifortvars.sh ia32
NETCDF_VERSION=NETCDF4;export NETCDFDIR=/usr/local;export NETCDFINC=
$NETCDFDIR/include;export NETCDFLIBNAME=$NETCDFDIR/lib/libnetcdf.a
export GOTMDIR=/home/taeila/GOTM/gotm-4.0.0
source /opt/intel/bin/compilervars.sh ia32 (or source /opt/intel/
bin/ifortvars.sh ia32)
make

It does some stuff and gives me this error, looks like netcdf problem:
…………
ifort: command line remark #10010: option '-w95' is deprecated and
will be removed in a future release. See '-help deprecated'
/home/taeila/GOTM/gotm-4.0.0/lib/IFORT/liboutput_prod.a(ncdfout.o): In
function `ncdfout_mp_do_ncdf_out_':
ncdfout.F90:(.text+0x19c0): undefined reference to `nf_sync_'
ncdfout.F90:(.text+0x1a07): undefined reference to `nf_strerror_'
/home/taeila/GOTM/gotm-4.0.0/lib/IFORT/liboutput_prod.a(ncdfout.o): In
function `ncdfout_mp_store_data_.':
ncdfout.F90:(.text+0x1de4): undefined reference to `nf_put_var_int_'
ncdfout.F90:(.text+0x1e41): undefined reference to `nf_put_vara_int_'
ncdfout.F90:(.text+0x1f26): undefined reference to `nf_strerror_'
ncdfout.F90:(.text+0x201d): undefined reference to `nf_put_vara_real_'
ncdfout.F90:(.text+0x209a): undefined reference to `nf_put_vara_real_'
ncdfout.F90:(.text+0x217b): undefined reference to `nf_put_var_real_'
ncdfout.F90:(.text+0x2392): undefined reference to `nf_put_vara_real_'
/home/taeila/GOTM/gotm-4.0.0/lib/IFORT/liboutput_prod.a(ncdfout.o): In
function `ncdfout_mp_close_ncdf_':
ncdfout.F90:(.text+0x254a): undefined reference to `nf_close_'
ncdfout.F90:(.text+0x2589): undefined reference to `nf_strerror_'
/home/taeila/GOTM/gotm-4.0.0/lib/IFORT/liboutput_prod.a(ncdfout.o): In
function `ncdfout_mp_define_mode_':
ncdfout.F90:(.text+0x2605): undefined reference to `nf_redef_'
ncdfout.F90:(.text+0x2610): undefined reference to `nf_enddef_'
/home/taeila/GOTM/gotm-4.0.0/lib/IFORT/liboutput_prod.a(ncdfout.o): In
function `ncdfout_mp_new_nc_variable_':
ncdfout.F90:(.text+0x274f): undefined reference to `nf_def_var_'
ncdfout.F90:(.text+0x279c): undefined reference to `nf_strerror_'
/home/taeila/GOTM/gotm-4.0.0/lib/IFORT/liboutput_prod.a(ncdfout.o): In
function `ncdfout_mp_set_attributes_.':
ncdfout.F90:(.text+0x2873): undefined reference to `nf_put_att_text_'
….and many more error lines….
make: *** [gotm_prod_IFORT] Error 1

I recompiled netcdf (+ zlib+ hdf) with ifort and still no
progress….any help is very much appreciated.

Thanks
Soheila

Casper Boon

unread,
Feb 9, 2012, 12:36:33 AM2/9/12
to getm-...@googlegroups.com
Hi Soheila,

I use something like :

export NETCDFHOME=/usr/local/lib
export NETCDF_VERSION=NETCDF4

export NETCDFINC=$NETCDFHOME/include
export NETCDFLIBDIR=$NETCDFHOME/lib
export NETCDFLIBNAME="-lnetcdff -lnetcdf"


Note the additional netcdff library.

Casper


On 09/02/12 11:00, soheila wrote:
> Hi All
>
> I�m on my way to compile and use GETM and I have started pretty much


> from scratch.
>
> I am using 64 bit system and had no problem compiling fortran,
> hdf5.1.8.6 and Netcdf4.1.3 all in Linux default folders, so I have
> libnetcdf.a and libnetcdff.a in usr/local/lib.
> Here is the way I set the environment variables to compile GOTM 4.0.0
> (some might be redundant):
>
> export FC=/opt/intel/bin/ifort;export F77=/opt/intel/bin/ifort;export
> F90=/opt/intel/bin/ifort
> export FORTRAN_COMPILER=IFORT;export IFORTVARS=/opt/intel/bin/
> ifortvars.sh ia32
> NETCDF_VERSION=NETCDF4;export NETCDFDIR=/usr/local;export NETCDFINC=
> $NETCDFDIR/include;export NETCDFLIBNAME=$NETCDFDIR/lib/libnetcdf.a
> export GOTMDIR=/home/taeila/GOTM/gotm-4.0.0
> source /opt/intel/bin/compilervars.sh ia32 (or source /opt/intel/
> bin/ifortvars.sh ia32)
> make
>
> It does some stuff and gives me this error, looks like netcdf problem:

> ����

> �.and many more error lines�.


> make: *** [gotm_prod_IFORT] Error 1
>
> I recompiled netcdf (+ zlib+ hdf) with ifort and still no

> progress�.any help is very much appreciated.
>
> Thanks
> Soheila
>

--
Casper Boon
Senior Software Engineer
School of Earth & Environment (M004)
University of Western Australia
35 Stirling Highway, Crawley WA 6009
tel: +61 8 6488 8011

Mahdi Mohammadi

unread,
Feb 9, 2012, 1:45:22 AM2/9/12
to getm-...@googlegroups.com

Hi Soheila,
Try
export NETCDFLIBNAME="-lnetcdf -lnetcdff"
it might be the  case.
Regrads,
Mahdi


From: soheila <sl.t...@gmail.com>
To: GETM-users <getm-...@googlegroups.com>
Sent: Thursday, February 9, 2012 4:00 AM
Subject: [getm-users: 1594] GOTM compiling problem

soheila

unread,
Feb 9, 2012, 2:21:30 AM2/9/12
to GETM-users
Thanks guys. I think I am one step ahead by adding that line. The
error has changed to:

ipo: warning #11010: file format not recognized for /usr/local/lib/
libnetcdff.so
ipo: warning #11010: file format not recognized for /usr/local/lib/
libnetcdf.so
ld: skipping incompatible /usr/local/lib/libnetcdff.so when searching
for -lnetcdff
ld: skipping incompatible /usr/local/lib/libnetcdff.a when searching
for -lnetcdff
ld: cannot find -lnetcdff
make: *** [gotm_prod_IFORT] Error 1

My netcdf doesn't seem to be compatible. That's how I've compiled the
netcdf before:

export FC=/opt/intel/bin/ifort;export F77=/opt/intel/bin/ifort;export
F90=/opt/intel/bin/ifort;source /opt/intel/bin/compilervars.sh ia32
export CPPFLAGS=-I/home/taeila/hdf5/hdf5-1.8.6/hdf5/include
export LDFLAGS=-L/home/taeila/hdf5/hdf5-1.8.6/hdf5/lib
export LD_LIBRARY_PATH=/home/taeila/hdf5/hdf5-1.8.6/hdf5/lib:/opt/
intel/lib/intel64/

./configure
make check install

Any idea what is wrong with my netcdf?

Thanks
Soheila

On Feb 9, 2:45 pm, Mahdi Mohammadi <mahdiar...@yahoo.com> wrote:
> Hi Soheila,
> Try
>
> export NETCDFLIBNAME="-lnetcdf -lnetcdff"
>
> it might be the  case.
> Regrads,
> Mahdi
>
> ________________________________
>  From: soheila <sl.ta...@gmail.com>

Casper A Boon

unread,
Feb 9, 2012, 4:03:13 AM2/9/12
to getm-...@googlegroups.com
I'm wondering if you compiled the netcdf/hdf5 libraries as 64 bit
because the line :

> F90=/opt/intel/bin/ifort;source /opt/intel/bin/compilervars.sh ia32

is selecting the 32 bit compiler. It's easy to tell, at a command
prompt type :

file /usr/local/lib/libnetcdff.so

which will tell you it's a symbolic link to another file so just use the
file command on that file - eg :

file /usr/local/lib/libnetcdff.so.5.0.0

If it tells you it a 64 bit ELF then change your env to do :

F90=/opt/intel/bin/ifort;source /opt/intel/bin/compilervars.sh intel64

and recompile

C

>> I�m on my way to compile and use GETM and I have started pretty much


>> from scratch.
>>
>> I am using 64 bit system and had no problem compiling fortran,
>> hdf5.1.8.6 and Netcdf4.1.3 all in Linux default folders, so I have
>> libnetcdf.a and libnetcdff.a in usr/local/lib.
>> Here is the way I set the environment variables to compile GOTM 4.0.0
>> (some might be redundant):
>>
>> export FC=/opt/intel/bin/ifort;export F77=/opt/intel/bin/ifort;export
>> F90=/opt/intel/bin/ifort
>> export FORTRAN_COMPILER=IFORT;export IFORTVARS=/opt/intel/bin/
>> ifortvars.sh ia32
>> NETCDF_VERSION=NETCDF4;export NETCDFDIR=/usr/local;export NETCDFINC=
>> $NETCDFDIR/include;export NETCDFLIBNAME=$NETCDFDIR/lib/libnetcdf.a
>> export GOTMDIR=/home/taeila/GOTM/gotm-4.0.0
>> source /opt/intel/bin/compilervars.sh ia32 (or source /opt/intel/
>> bin/ifortvars.sh ia32)
>> make
>>
>> It does some stuff and gives me this error, looks like netcdf problem:

>> ����

>> �.and many more error lines�.


>> make: *** [gotm_prod_IFORT] Error 1
>>
>> I recompiled netcdf (+ zlib+ hdf) with ifort and still no

>> progress�.any help is very much appreciated.
>>
>> Thanks
>> Soheila

--

Casper Boon
Senior Software Engineer
School of Earth & Environment (M004)
University of Western Australia
35 Stirling Highway, Crawley WA 6009
tel: +61 8 6488 8011

www.uwa.edu.au/people/casper.boon

Knut

unread,
Feb 9, 2012, 4:10:00 AM2/9/12
to getm-...@googlegroups.com
Hi soheila,

> Here is the way I set the environment variables to compile GOTM 4.0.0
> (some might be redundant):
>
>

> NETCDF_VERSION=NETCDF4
>

I hope this is a type? Of course it must be "export NETCDF_VERSION=NETCDF4".

Which executable is shown for "which nc-config"?
It must be your compiled one.

In newer netcdf versions you might have nf-config instead of nc-config.


Regards,
Knut

soheila

unread,
Feb 9, 2012, 9:28:11 PM2/9/12
to GETM-users
PROBLEM SOLVED!

Thanks a lot Casper. Intel 64 solved my problem, and thanks Knut.
There was a typo in my post and it is nc-config when I do which, so I
don't think it was the problem.

Cheers
Soheila

Knut

unread,
Feb 10, 2012, 4:04:50 AM2/10/12
to getm-...@googlegroups.com
Dear Soheila,

> PROBLEM SOLVED!
>

Thanks for your feedback.

> and it is nc-config when I do which, so I
> don't think it was the problem.
>

Good. GETM (still) calls nc-config. GOTM already nf-config.

Regards,
Knut

soheila

unread,
Feb 15, 2012, 11:58:01 PM2/15/12
to GETM-users
Hi everyone

I managed to compile getm and gotm the other day, but I get this error
when I run getm_prod_IFORT in the getm folder or in compiled examples:

./getm_prod_IFORT: error while loading shared libraries: libnetcdff.so.
5: cannot open shared object file: No such file or directory

The library exists in /usr/local/lib and it has been set in my
environmental variables before compiling this way:

export NETCDFHOME=/usr/local
export NETCDFLIBDIR=$NETCDFHOME/lib

Will be great to have your advice about this problem.

Regards
Soheila

Knut

unread,
Feb 16, 2012, 4:25:11 AM2/16/12
to getm-...@googlegroups.com
Hi Soheila,

> Hi everyone
>
> I managed to compile getm and gotm the other day, but I get this error
> when I run getm_prod_IFORT in the getm folder or in compiled examples:
>

only running from the test cases provides the mandatory getm.inp.

> ./getm_prod_IFORT: error while loading shared libraries: libnetcdff.so.
> 5: cannot open shared object file: No such file or directory
>
> The library exists in /usr/local/lib and it has been set in my
> environmental variables before compiling this way:
>
> export NETCDFHOME=/usr/local
> export NETCDFLIBDIR=$NETCDFHOME/lib
>

Once again, if you export NETCDF_VERSION=NETCDF4 (and thus use nc-config
for GETM and nf-config for GOTM) the setting of NETCDFHOME, NETCDFLIBDIR
is meaningless.

> Will be great to have your advice about this problem.
>

Regarding the shared library have you add your NETCDFLIB to the
LD_LIBRARY_PATH?

> Regards
> Soheila
>

Knut

soheila

unread,
Feb 17, 2012, 3:05:08 AM2/17/12
to GETM-users
Thanks Knut.

I recompiled getm without some lines (NETCDFHOME...) and it works
fine. Looks like I need to reset all path in LD_LIBRARY_PATH when I
switch my computer on. They all clear up when I turn the computer off.
Now I have problem with parallel computing. Will send it in another
post with proper title.

Regards
Soheila
Reply all
Reply to author
Forward
0 new messages