netcdf and hdf5 in different folders

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
majomarin
Posts: 2
Joined: Wed Feb 20, 2013 9:02 pm
Location: INP

netcdf and hdf5 in different folders

#1 Unread post by majomarin »

Hi!
I'm trying to run ROMS in our supercomputer and am having problems telling ROMS where the libraries are. I have netcdf-fortran and hdf5 in separate folders, and it seems like that is the problem.
I have tried to give build.bash the two folders, but despite using && or " " or ' ', it keeps telling me

./build.bash: line 298: export: `-lnetcdff': not a valid identifier
./build.bash: line 298: export: `../../../../../../packages/hdf5/1.8.19/lib': not a valid identifier
./build.bash: line 298: export: `-lnetcdf': not a valid identifier

What can I do? :shock:

Thanks in advance!
MariaJose

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

Re: netcdf and hdf5 in different folders

#2 Unread post by kate »

Do you have USE_NETCDF4 turned on? That can often solve all these problems for you.

c.drinkorn
Posts: 110
Joined: Thu Mar 08, 2018 2:47 am
Location: German Research Centre for Geosciences

Re: netcdf and hdf5 in different folders

#3 Unread post by c.drinkorn »

Hi,

if you do not want to use NetCDF4, it may be necessary to change the library path settings in the compiler file.
In the respective file (according to your system and fortran compiler) in the 'Library locations' section you may paste the output of
"path/to/your/nf-config -flibs"
into the "ifdef USE_NETCDF4 ... else ... LIBS" line.
The "nf-config -flibs" output (or "nc-config -libs", respectively) should contain all flagged paths to the libraries needed.
You can find the config files in the bin folder of your netcdf_fortran (or netcdf_c) library path.
The compiler files are stored in the Compilers folder of your src path.

There are various ways of defining the right library paths, either in the compiler file, the makefile or the bash file already. Some definitions are added to others, or are only set if they are no yet defined, others are even overwritten. It is therefore worthwhile to take the time and get familiar with the structure of the various files used to compile ROMS. It took me a while, at least. :wink:

Good luck! :idea:

majomarin
Posts: 2
Joined: Wed Feb 20, 2013 9:02 pm
Location: INP

Re: netcdf and hdf5 in different folders

#4 Unread post by majomarin »

Thank you so much! :D
The netcdf ON fix did it.
I will try the other suggestion too!

Post Reply