Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with FindNetCDF.cmake finding both C and Fortran #59

Open
edwardhartnett opened this issue Dec 5, 2021 · 1 comment
Open

Comments

@edwardhartnett
Copy link

I am trying to build FMS like this:

cmake -DCMAKE_PREFIX_PATH="/usr/local/FMS-2021.03.01;/usr/local/netcdf-c-4.8.1_hdf5-1.12.1_zlib-ng_szip_mpich;/usr/local/netcdf-c-4.7.4_hdf4-1.10.7_mpich;/usr/local/netcdf-fortran-4.5.3_mpich;/usr/local/NCEPLIBS-w3emc-2.7.3;/usr/local/NCEPLIBS-w3nco-2.4.1;/usr/local/NCEPLIBS-bacio-2.4.1;NCEPLIBS-nemsio-2.5.1;/usr/local/NCEPLIBS-sp-2.3.3;/usr/local/esmf-8.0.1;/usr/local/NCEPLIBS-nemsio-2.5.1;/usr/local/NCEPLIBS-sigio-2.3.2" -DCMAKE_Fortran_FLAGS="-fno-range-check -fdefault-real-8 -cpp -ffree-line-length-none" ..
-- The C compiler identification is GNU 11.2.0
-- The Fortran compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/gfortran - skipped
CMake Error at cmake/FindNetCDF.cmake:225 (message):
  Unable to properly find NetCDF.  Found static libraries at:
  /home/ed/fv3atm/NetCDF_Fortran_LIBRARY-NOTFOUND but could not run
  nc-config:
Call Stack (most recent call first):
  CMakeLists.txt:15 (find_package)


CMake Error at /snap/cmake/992/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find NetCDF (missing: Fortran) (found suitable version "4.7.4",
  minimum required is "4.3.3")
Call Stack (most recent call first):
  /snap/cmake/992/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindNetCDF.cmake:291 (find_package_handle_standard_args)
  CMakeLists.txt:15 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/ed/fv3atm/b/CMakeFiles/CMakeOutput.log".
(base) ed@mikado:~/fv3atm/b$ 

@kgerheiser can FindNetCDF.cmake deal with the netCDF C and Fortran libraries installed in different directories?

@kgerheiser
Copy link
Contributor

kgerheiser commented Dec 5, 2021

I have used it with Spack which installs C/Fortran separately. You just need to have nc-config and nf-config in your PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants