[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #TCR-672664]: problem installing netcdf fortran



That line:
> ***  --has-fortran -> no*
I believe can be ignored.

But I do not see where you actually tried to build netcdf-fortran.
Remember that netcdf-c does not imply  building netcdf-fortran.
You must build netcdf-fortran explicitly.

> 
> I am trying to install NetCDF on my machine (Ubuntu 18.04.2 LTS) for use
> with the GOTM model (https://gotm.net/portfolio/software/).
> 
> I have followed the steps here
> <https://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html#building>,
> first installing zlib, then hdf, then netcdf C, then netcdf fortran -
> but in the end, I don't think netcdf fortran worked.
> 
> Here are the steps I have taken, with some outputs in blue. I also
> attach the config.log file.
> 
> 
> *1. Install zlib v1.2.11*
> 
> in ~/gotm_install/zlib-1.2.11/
> 
> $ ZDIR=/usr/local/netcdf
> $ sudo ./configure --prefix=${ZDIR}
> $ sudo make check
> $ sudo make install
> 
> 
> *2. install hdf v 1.10.5*
> 
> in ~/gotm_install/hdf5-1.10.5/
> 
> $ H5DIR=/usr/local/netcdf
> $ CFLAGS=-O0
> $ sudo ./configure --with-zlib=${ZDIR} --prefix=${H5DIR}
> $ sudo make check
> $ sudo make install
> 
> 
> *3. install netcdf v4.6.3*
> 
> in ~/gotm_install/netcdf-c-4.6.3/
> 
> $ NCDIR=/usr/local/netcdf
> $ CPPFLAGS='-I${H5DIR}/include -I${ZDIR}/include'
> LDFLAGS='-L${H5DIR}/lib -L${ZDIR}/lib'
> $ ./configure --prefix=${NCDIR} --disable-dap
> 
> # NetCDF C Configuration Summary
> ==============================
> 
> # General
> -------
> NetCDF Version: 4.6.3
> Configured On:        Wed Mar 20 15:39:02 PDT 2019
> Host System: x86_64-pc-linux-gnu
> Build Directory: /home/xxxx/gotm_install/netcdf-c-4.6.3
> Install Prefix: /usr/local/netcdf
> 
> # Compiling Options
> -----------------
> C Compiler: /usr/bin/gcc
> CFLAGS:
> CPPFLAGS:
> LDFLAGS:
> AM_CFLAGS:
> AM_CPPFLAGS:
> AM_LDFLAGS:
> Shared Library:        yes
> Static Library:        yes
> Extra libraries: -lhdf5_hl -lhdf5 -lm -ldl -lz
> 
> # Features
> --------
> NetCDF-2 API:        yes
> HDF4 Support:        no
> HDF5 Support:        yes
> NetCDF-4 API:        yes
> NC-4 Parallel Support: no
> PnetCDF Support:    no
> DAP2 Support:        no
> DAP4 Support:        no
> Diskless Support:    yes
> MMap Support:        no
> JNA Support:        no
> CDF5 Support:        yes
> ERANGE Fill Support:    no
> Relaxed Boundary Check: yes
> 
> *4. build netcdf with shared fortran libraries*
> 
> in ~/gotm_install/netcdf-c-4.6.3/
> 
> 
> $ NCDIR=/usr/local/netcdf
> $ CC=/usr/bin/cc
> $ FC=/usr/bin/f95
> $ export LD_LIBRARY_PATH=${NCDIR}/lib:${LD_LIBRARY_PATH}
> $ NFDIR=/usr/local/netcdf
> $ CPPFLAGS=-I${NCDIR}/include LDFLAGS=-L${NCDIR}/lib
> $ ./configure --prefix=${NFDIR} --disable-dap
> 
> # NetCDF C Configuration Summary
> ==============================
> 
> # General
> -------
> NetCDF Version:        4.6.3
> Configured On:        Wed Mar 20 15:49:20 PDT 2019
> Host System:        x86_64-pc-linux-gnu
> Build Directory:     /home/xxxx/gotm_install/netcdf-c-4.6.3
> Install Prefix:         /usr/local/netcdf
> 
> # Compiling Options
> -----------------
> C Compiler:        /usr/bin/gcc
> CFLAGS:
> CPPFLAGS:
> LDFLAGS:
> AM_CFLAGS:
> AM_CPPFLAGS:
> AM_LDFLAGS:
> Shared Library:        yes
> Static Library:        yes
> Extra libraries:    -lhdf5_hl -lhdf5 -lm -ldl -lz
> 
> # Features
> --------
> NetCDF-2 API:        yes
> HDF4 Support:        no
> HDF5 Support:        yes
> NetCDF-4 API:        yes
> NC-4 Parallel Support:    no
> PnetCDF Support:    no
> DAP2 Support:        no
> DAP4 Support:        no
> Diskless Support:    yes
> MMap Support:        no
> JNA Support:        no
> CDF5 Support:        yes
> ERANGE Fill Support:    no
> Relaxed Boundary Check:    yes
> 
> 
> 
> $ sudo make check (make check fails without sudo)
> $ sudo make install
> $ nc-config --all
> 
> This netCDF 4.6.3 has been built with the following features:
> 
>   --cc            -> gcc
>   --cflags        -> -I/usr/local/include
>   --libs          -> -L/usr/local/lib -lnetcdf
> 
>   --has-c++       -> no
>   --cxx           ->
> 
>   --has-c++4      -> no
>   --cxx4          ->
> 
> ***  --has-fortran -> no*
>   --has-dap       -> no
>   --has-dap2      -> no
>   --has-dap4      -> no
>   --has-nc2       -> yes
>   --has-nc4       -> yes
>   --has-hdf5      -> yes
>   --has-hdf4      -> no
>   --has-logging   -> no
>   --has-pnetcdf   -> no
>   --has-szlib     -> no
>   --has-cdf5      -> yes
>   --has-parallel4 -> no
>   --has-parallel  -> no
> 
>   --prefix        -> /usr/local
>   --includedir    -> /usr/local/include
>   --libdir        -> /usr/local/lib
>   --version       -> netCDF 4.6.3
> 
> ---> I am confused because the flags I set in step 4 (e.g., CC,
> CPPFLAGS) did not seem to be used, based on the NetCDF C Configuration
> summary. And the nc-config suggests that I don't have fortran, so it
> seems that I've done something wrong.
> 
> (When I proceed and try to install the GOTM model, I receive the error
> "Could NOT find NetCDF (missing: NetCDF_INCLUDE_DIRS)" - so it seems
> indeed that I have a NetCDF issue.
> 
> 
> Any suggestions?
> 
> 
> Many thanks,
> 
> Kyla
> 
> 
> 
> 
> 

=Dennis Heimbigner
  Unidata


Ticket Details
===================
Ticket ID: TCR-672664
Department: Support netCDF
Priority: Normal
Status: Open
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.