check library version netcdf linux
netCDF provides the nc-config
command line tool for this purpose.
To print the version.
nc-config --version
To print more information on the netCDF build you have:
nc-config --all
How to get the path where the library is installed
If you wish you can fix the path at compile time. Something like
gfortran -cpp mylib.f90 -DPREFIX=\"/usr/local/\"
open(newunit=u,file=PREFIX//'mylib/initialise.dat')
You must than make sure the library is indeed installed in that place PREFIX/mylib/
You can create an environment variable containing the path of your data. This variable can be set by hand, in your .bashrc
or .bash_profile
or in the system /etc/profile.d/
or /etc/bash.bashrc
, there are manyways and they depend if the library is just for one user or for all users of some large computer.
For exampleexport MYLIB_PATH='/usr/local/mylib'
Then you can read the variable in Fortran as
CALL get_environment_variable("MYLIB_PATH", mylib_path, status=stat)
and the path is now in variable mylib_path
. You can check the success by checking if stat==0
.
This is not the only possible approach. You can also have a configuration file for your library in your home directory:
mkdir $HOME/.config/mylib/
echo "/usr/local/mylib" > $HOME/.config/mylib/path
and then you can try to read the path from this file if the environment variable was not set
if (stat/=0) then
CALL get_environment_variable("HOME", home_dir)
open(newunit=path_unit, file=home_dir//'/.config/mylib/path',status='old',action='read',iostat=stat)
if (stat/=0) complain
read(path_unit,'(a)',iostat=stat) mylib_path
if (stat/=0) complain
end if
hdf5 dependencies trying to install netcdf4
ValueError: did not find HDF5 headers
The error means there is no development files. You have the library but not headers. Install:
yum install hdf5-devel
Related Topics
Cdc_Acm: Failed to Set Dtr/Rts - Can Not Communicate with Usb Cdc Device
Prevent Fork() from Copying Sockets
Using Google as a Dictionary Lookup via Bash, How Can One Grab The First Definition
Using Flycheck/Flymake on Kernel Source Tree
Does Grub Switch to Protected Mode
Ldd Shows Varied Addresses on X86 Linux
Where Is Default Installation Directory for Mongodb
How to Run Jprofiler from Windows Machine to Remote Linux Jvm
Check for Existence of Wget/Curl
Understanding The Getting of Task_Struct Pointer from Process Kernel Stack
How to Use Awk to Test If a Column Value Is in Another File
Conditional Awk Hashmap Match Lookup
Find Files and Print Only Their Parent Directories
Tomcat Server Creating Directories in Tmp
How to Check If Linux Console Screensaver Has Blanked Screen
How to Execute an Arbitrary Script with a Working Directory of The Directory Its In