NOAA-EMC / NCEPLIBS

Top level repo containing submodules for NCEPLIBS and associated dependencies for superproject builds
Other
42 stars 18 forks source link

Build not working on Ubuntu system #68

Closed edwardhartnett closed 4 years ago

edwardhartnett commented 4 years ago

I am trying to build but there is a failure. It's complaining that NETCDF is not set, but it is set, and the directory it is set to has an include and lib subdirectory with the netCDF include files and libraries.

The NCEPLIBS-external build does not work for me, so the external libraries were installed manually, all into the same directory.

(base) ed@mikado:~/NCEPLIBS/build$ cmake -DNETCDF=/usr/local/NCEPLIBS-external/ -DJPEG_LIBRARIES=/usr/lib/x86_64-linux-gnu/ -DPNG_PNG_INCLUDE_DIR=/usr/include/x86_64-linux-gnu/ -DPNG_LIBRARY=/usr/lib/x86_64-linux-gnu/ -DJASPER_LIBRARIES=/usr/local/NCEPLIBS-external/lib -DJASPER_INCLUDE_DIR=/usr/local/NCEPLIBS-external/include ..
-- Found PNG: /usr/lib/x86_64-linux-gnu/  
-- Found MPI_Fortran: /usr/local/bin/mpifort (found version "3.1") 
-- Found MPI: TRUE (found version "3.1") found components: Fortran 
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Found BLAS: /usr/lib/x86_64-linux-gnu/libblas.so  
-- Looking for Fortran cheev
-- Looking for Fortran cheev - not found
-- Looking for Fortran cheev
-- Looking for Fortran cheev - found
-- A library with LAPACK API found.
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'netcdf>=4'
--   No package 'netcdf' found
CMake Error at /usr/local/share/cmake-3.17/Modules/FindPkgConfig.cmake:467 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/local/share/cmake-3.17/Modules/FindPkgConfig.cmake:647 (_pkg_check_modules_internal)
  UFS_UTILS/cmake/Modules/FindNetCDF.cmake:23 (pkg_check_modules)
  UFS_UTILS/CMakeLists.txt:34 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/ed/NCEPLIBS/build/CMakeFiles/CMakeOutput.log".
See also "/home/ed/NCEPLIBS/build/CMakeFiles/CMakeError.log".
(base) ed@mikado:~/NCEPLIBS/build$ ls -l /usr/local/NCEPLIBS-external/
total 16
drwxr-xr-x 2 root root 4096 Apr 14 12:29 bin
drwxr-xr-x 3 root root 4096 Apr 13 15:41 include
drwxr-xr-x 3 root root 4096 Apr 13 15:41 lib
drwxr-xr-x 5 root root 4096 Apr 13 15:06 share
(base) ed@mikado:~/NCEPLIBS/build$ ls -l /usr/local/NCEPLIBS-external/include
total 896
-rw-r--r-- 1 root root  25488 Apr 13 15:06 H5ACpublic.h
-rw-r--r-- 1 root root   9720 Apr 13 15:06 H5api_adpt.h
-rw-r--r-- 1 root root   5471 Apr 13 15:06 H5Apublic.h
-rw-r--r-- 1 root root   1760 Apr 13 15:06 H5Cpublic.h
-rw-r--r-- 1 root root   1931 Apr 13 15:06 H5DOpublic.h
-rw-r--r-- 1 root root   9022 Apr 13 15:06 H5Dpublic.h
-rw-r--r-- 1 root root   2590 Apr 13 15:06 H5DSpublic.h
-rw-r--r-- 1 root root  21996 Apr 13 15:06 H5Epubgen.h
-rw-r--r-- 1 root root   9023 Apr 13 15:06 H5Epublic.h
-rw-r--r-- 1 root root   1490 Apr 13 15:06 H5FDcore.h
-rw-r--r-- 1 root root   1955 Apr 13 15:06 H5FDdirect.h
-rw-r--r-- 1 root root   1506 Apr 13 15:06 H5FDfamily.h
-rw-r--r-- 1 root root   3691 Apr 13 15:06 H5FDhdfs.h
-rw-r--r-- 1 root root   3322 Apr 13 15:06 H5FDlog.h
-rw-r--r-- 1 root root   2573 Apr 13 15:06 H5FDmpi.h
-rw-r--r-- 1 root root   2440 Apr 13 15:06 H5FDmpio.h
-rw-r--r-- 1 root root   1800 Apr 13 15:06 H5FDmulti.h
-rw-r--r-- 1 root root  17115 Apr 13 15:06 H5FDpublic.h
-rw-r--r-- 1 root root   3330 Apr 13 15:06 H5FDros3.h
-rw-r--r-- 1 root root   1339 Apr 13 15:06 H5FDsec2.h
-rw-r--r-- 1 root root   1368 Apr 13 15:06 H5FDstdio.h
-rw-r--r-- 1 root root   1414 Apr 13 15:06 H5FDwindows.h
-rw-r--r-- 1 root root  15029 Apr 13 15:06 H5Fpublic.h
-rw-r--r-- 1 root root   7234 Apr 13 15:06 H5Gpublic.h
-rw-r--r-- 1 root root   3274 Apr 13 15:06 H5IMpublic.h
-rw-r--r-- 1 root root   4934 Apr 13 15:06 H5Ipublic.h
-rw-r--r-- 1 root root   1362 Apr 13 15:06 H5LDpublic.h
-rw-r--r-- 1 root root  10170 Apr 13 15:06 H5Lpublic.h
-rw-r--r-- 1 root root  14182 Apr 13 15:06 H5LTpublic.h
-rw-r--r-- 1 root root   1775 Apr 13 15:06 H5MMpublic.h
-rw-r--r-- 1 root root  12777 Apr 13 15:06 H5Opublic.h
-rw-r--r-- 1 root root 116154 Apr 13 15:06 H5overflow.h
-rw-r--r-- 1 root root   1528 Apr 13 15:06 H5PLextern.h
-rw-r--r-- 1 root root   2402 Apr 13 15:06 H5PLpublic.h
-rw-r--r-- 1 root root  29027 Apr 13 15:06 H5Ppublic.h
-rw-r--r-- 1 root root   3861 Apr 13 15:06 H5PTpublic.h
-rw-r--r-- 1 root root  20583 Apr 13 15:06 H5pubconf.h
-rw-r--r-- 1 root root  12348 Apr 13 15:06 H5public.h
-rw-r--r-- 1 root root   3794 Apr 13 15:06 H5Rpublic.h
-rw-r--r-- 1 root root   7526 Apr 13 15:06 H5Spublic.h
-rw-r--r-- 1 root root   8419 Apr 13 15:06 H5TBpublic.h
-rw-r--r-- 1 root root  27251 Apr 13 15:06 H5Tpublic.h
-rw-r--r-- 1 root root  19381 Apr 13 15:06 H5version.h
-rw-r--r-- 1 root root  11246 Apr 13 15:06 H5Zpublic.h
-rw-r--r-- 1 root root   3467 Apr 13 15:06 hdf5.h
-rw-r--r-- 1 root root   1543 Apr 13 15:06 hdf5_hl.h
drwxr-xr-x 2 root root   4096 Apr 13 14:57 jasper
-rw-r--r-- 1 root root  27001 Apr 13 15:41 netcdf4_f03.mod
-rw-r--r-- 1 root root  26706 Apr 13 15:41 netcdf4_nc_interfaces.mod
-rw-r--r-- 1 root root   5547 Apr 13 15:41 netcdf4_nf_interfaces.mod
-rw-r--r-- 1 root root   1703 Apr 13 15:14 netcdf_aux.h
-rw-r--r-- 1 root root  12058 Apr 13 15:14 netcdf_dispatch.h
-rw-r--r-- 1 root root   3847 Apr 13 15:14 netcdf_filter.h
-rw-r--r-- 1 root root  24794 Apr 13 15:41 netcdf_fortv2_c_interfaces.mod
-rw-r--r-- 1 root root  68231 Apr 13 15:14 netcdf.h
-rw-r--r-- 1 root root  61393 Apr 13 15:41 netcdf.inc
-rw-r--r-- 1 root root   1337 Apr 13 15:14 netcdf_mem.h
-rw-r--r-- 1 root root   2597 Apr 13 15:14 netcdf_meta.h
-rw-r--r-- 1 root root  22392 Apr 13 15:41 netcdf.mod
-rw-r--r-- 1 root root   5723 Apr 13 15:41 netcdf_nc_data.mod
-rw-r--r-- 1 root root  21154 Apr 13 15:41 netcdf_nc_interfaces.mod
-rw-r--r-- 1 root root   9858 Apr 13 15:41 netcdf_nf_data.mod
-rw-r--r-- 1 root root  11465 Apr 13 15:41 netcdf_nf_interfaces.mod
-rw-r--r-- 1 root root   1636 Apr 13 15:14 netcdf_par.h
-rw-r--r-- 1 root root    493 Apr 13 15:41 typesizes.mod
(base) ed@mikado:~/NCEPLIBS/build$ ls -l /usr/local/NCEPLIBS-external/lib
total 28016
-rwxr-xr-x 1 root root    1119 Apr 13 15:14 libh5bzip2.la
-rwxr-xr-x 1 root root  171944 Apr 13 15:14 libh5bzip2.so
-rw-r--r-- 1 root root 9188632 Apr 13 15:06 libhdf5.a
-rw-r--r-- 1 root root  246986 Apr 13 15:06 libhdf5_hl.a
-rwxr-xr-x 1 root root    1020 Apr 13 15:06 libhdf5_hl.la
lrwxrwxrwx 1 root root      21 Apr 13 15:06 libhdf5_hl.so -> libhdf5_hl.so.100.1.3
lrwxrwxrwx 1 root root      21 Apr 13 15:06 libhdf5_hl.so.100 -> libhdf5_hl.so.100.1.3
-rwxr-xr-x 1 root root  157144 Apr 13 15:06 libhdf5_hl.so.100.1.3
-rwxr-xr-x 1 root root     955 Apr 13 15:06 libhdf5.la
-rw-r--r-- 1 root root    4947 Apr 13 15:06 libhdf5.settings
lrwxrwxrwx 1 root root      18 Apr 13 15:06 libhdf5.so -> libhdf5.so.103.2.0
lrwxrwxrwx 1 root root      18 Apr 13 15:06 libhdf5.so.103 -> libhdf5.so.103.2.0
-rwxr-xr-x 1 root root 4562704 Apr 13 15:06 libhdf5.so.103.2.0
lrwxrwxrwx 1 root root      14 Apr 13 14:56 libjasper.so -> libjasper.so.4
lrwxrwxrwx 1 root root      18 Apr 13 14:56 libjasper.so.4 -> libjasper.so.4.0.0
-rw-r--r-- 1 root root  526240 Apr 13 14:57 libjasper.so.4.0.0
-rw-r--r-- 1 root root 6719290 Apr 13 15:14 libnetcdf.a
-rw-r--r-- 1 root root 2104110 Apr 13 15:41 libnetcdff.a
-rwxr-xr-x 1 root root    1186 Apr 13 15:41 libnetcdff.la
lrwxrwxrwx 1 root root      19 Apr 13 15:41 libnetcdff.so -> libnetcdff.so.7.0.0
lrwxrwxrwx 1 root root      19 Apr 13 15:41 libnetcdff.so.7 -> libnetcdff.so.7.0.0
-rwxr-xr-x 1 root root 1485360 Apr 13 15:41 libnetcdff.so.7.0.0
-rwxr-xr-x 1 root root    1137 Apr 13 15:14 libnetcdf.la
-rw-r--r-- 1 root root    1050 Apr 13 15:14 libnetcdf.settings
lrwxrwxrwx 1 root root      19 Apr 13 15:14 libnetcdf.so -> libnetcdf.so.18.0.0
lrwxrwxrwx 1 root root      19 Apr 13 15:14 libnetcdf.so.18 -> libnetcdf.so.18.0.0
-rwxr-xr-x 1 root root 3471128 Apr 13 15:14 libnetcdf.so.18.0.0
drwxr-xr-x 2 root root    4096 Apr 13 15:41 pkgconfig
(base) ed@mikado:~/NCEPLIBS/build$ 
climbfuji commented 4 years ago

Thanks for reporting this. We have mostly tested this for the combination of NCEPLIBS-external and NCEPLIBS. The version of findNetCDF.cmake in NCEPLIBS relies on pkg-config. Can you check that the pkg-config for netCDF and netCDF-Fortran is ok? Should be in lib/pkgconfig/netcdf.pc and lib/pkgconfig/netcdf-fortran.pc underneath $NETCDF. Mine are:

$ cat /usr/local/llvm/lib/pkgconfig/netcdf.pc
prefix=/usr/local/llvm
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
ccompiler=mpicc

Name: netcdf-c
Description: NetCDF Client Library for C
URL: http://www.unidata.ucar.edu/netcdf
Version: 4.7.3
Libs: -L${libdir} -lnetcdf
Libs.private: -lpnetcdf -lhdf5_hl -lhdf5 -lm -lz -lcurl
Cflags: -I${includedir}

and

$ cat /usr/local/llvm/lib/pkgconfig/netcdf-fortran.pc
prefix=/usr/local/llvm
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
ccompiler=mpicc
fcompiler=mpif90

Name: netcdf-fortran
Description: NetCDF Client Library for Fortran
URL: http://www.unidata.ucar.edu/netcdf
Version: 4.5.2
Requires.private: netcdf > 4.1.1
Libs: -L${libdir} -lnetcdff
Libs.private: -L${libdir} -lnetcdff -lnetcdf
Cflags: -I${includedir}
edwardhartnett commented 4 years ago

Good question! I will check...

edwardhartnett commented 4 years ago

Seems to be there:

(base) ed@mikado:~/NCEPLIBS/build$ cat /usr/local/NCEPLIBS-external/lib/pkgconfig/netcdf.pc 
prefix=/usr/local/NCEPLIBS-external
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
ccompiler=mpicc

Name: netcdf-c
Description: NetCDF Client Library for C
URL: http://www.unidata.ucar.edu/netcdf
Version: 4.7.4
Libs: -L${libdir} -lnetcdf
Libs.private: -lhdf5_hl -lhdf5 -lm -ldl -lz -lcurl 
Cflags: -I${includedir}
(base) ed@mikado:~/NCEPLIBS/build$ 
(base) ed@mikado:~/NCEPLIBS/build$ cat /usr/local/NCEPLIBS-external/lib/pkgconfig/netcdf-fortran.pc 
prefix=/usr/local/NCEPLIBS-external
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
fmoddir=${includedir}
ccompiler=mpicc
fcompiler=mpifort

Name: netcdf-fortran
Description: NetCDF Client Library for Fortran
URL: http://www.unidata.ucar.edu/netcdf
Version: 4.5.3-development
Requires.private: netcdf > 4.1.1
Libs: -L${libdir} -lnetcdff
Libs.private: -L${libdir} -lnetcdff -lnetcdf
Cflags: -I${includedir} -I${fmoddir}
(base) ed@mikado:~/NCEPLIBS/build$
edwardhartnett commented 4 years ago

OK, that was a sufficient clue! ;-)

pkg-config was not finding the .pc files because they are not in the path that it normally searches. Instead, they are under the netCDF install. (Is this a bug in the netCDF install?)

So I had to do this: export PKG_CONFIG_PATH=/usr/local/NCEPLIBS-external/lib/pkgconfig

This causes the build system to find netcdf C and fortran OK, so that's good.

Now I see this:

-- Unable to locate WGRIB2 library and/or Fortran modules

Then it fails like this:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
/home/ed/NCEPLIBS/UFS_UTILS/sorc/chgres_cube.fd/WGRIB2_INCLUDES
   used as include directory in directory /home/ed/NCEPLIBS/UFS_UTILS/sorc/chgres_cube.fd
WGRIB2_LIBRARIES (ADVANCED)
    linked by target "chgres_cube.exe" in directory /home/ed/NCEPLIBS/UFS_UTILS/sorc/chgres_cube.fd
edwardhartnett commented 4 years ago

@climbfuji question for you: when I am specifying something like JPEG_LIBRARIES, do I specify the directory that holds the library? Or do I provide the complete path to the library, including library name?

In other words, do I use:

-DJPEG_LIBRARIES=/usr/lib/x86_64-linux-gnu or

-DJPEG_LIBRARIES=/usr/lib/x86_64-linux-gnu/libjpeg.so

kgerheiser commented 4 years ago

The better option is to set -DWGRIB2_ROOT=<path> (or JPEG_ROOT, etc) where path is the top-level install location (generally contains lib and include) and let the find module find the libraries rather than setting the libraries and includes directories manually. It can also be an environment variable instead of passing it to CMake for the same effect.

climbfuji commented 4 years ago

@edwardhartnett even if you are not using NCEPLIBS-external, the documentation there (how to specify environment variables for packages that you want to compile separately/outside of NCEPLIBS-external) may be helpful? I am wrapped up in meetings all day today, sorry for my slow response.

kgerheiser commented 4 years ago

We don't call find_package_handle_standard_args in FindWGRIB2.cmake which kind of obfuscates the problem of it not finding the library.

edwardhartnett commented 4 years ago

OK, there were some issues with my install of wgrib2. I had to go to NCEPLIBS-external CMakeLists.txt where I found that I have to do make lib to get the extra libraries, and then looked at the script NCEPLIBS-external/wgrib2/install.sh to see that I should do this:

cp lib/*.mod ${CMAKE_INSTALL_PREFIX}/include
cp lib/libwgrib2.a ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}

So now wgrib2 is found!

On to the next issue. I am seeing this message:

  ESMFMKFILE not defined.  This is the path to esmf.mk file.  Without this
  filepath, ESMF_FOUND will always be FALSE.
kgerheiser commented 4 years ago

ESMFMKFILE should point to esmf.mk (the full path including the file) which is found in lib of wherever ESMF is installed

climbfuji commented 4 years ago

ESMFMKFILE should point to esmf.mk (the full path including the file) which is found in lib of wherever ESMF is installed

The reason for this approach is the directions by ESMF to only use ESMFMKFILE to detect and configure an ESMF installation.

edwardhartnett commented 4 years ago

OK, so funny think is that ESMF does not install that file with the files that it does install. However, I set this to the file in the esmf build directory and it found the ESMF libraries.

export ESMFMKFILE=/home/ed/NCEPLIBS-external/esmf/lib/libO/Linux.gfortran.64.mpiuni.default/esmf.mk

Now I am stuck on this:

cmake -DNETCDF=/usr/local/NCEPLIBS-external/ -DJPEG_ROOT=/usr/lib/x86_64-linux-gnu/ -DPNG_PNG_ROOT=/usr/ -DJASPER_ROOT=/usr/local/NCEPLIBS-external/ -DWGRIB2_ROOT=/usr/local/NCEPLIBS-external/ ..
CMake Error at /usr/local/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake-3.17/Modules/FindJasper.cmake:39 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  NCEPLIBS-g2/CMakeLists.txt:23 (find_package)

-- Configuring incomplete, errors occurred!

I'm not sure what is going on. pkg-config is finding jasper.pc:

(base) ed@mikado:~/NCEPLIBS/build$ pkg-config --version jasper
0.29.1
edwardhartnett commented 4 years ago

OK, awesome, the build worked for me! How exciting! ;-)

Here's how it worked:

export CC=mpicc
export FC=mpifort
export CXX=mpicxx
export ESMFMKFILE=/home/ed/NCEPLIBS-external/esmf/lib/libO/Linux.gfortran.64.mpiuni.default/esmf.mk
export PKG_CONFIG_PATH=/usr/local/NCEPLIBS-external/lib/pkgconfig
export NETCDF=/usr/local/NCEPLIBS-external/
export JPEG_ROOT=/usr/lib/x86_64-linux-gnu/
export PNG_PNG_ROOT=/usr/
export JASPER_ROOT=/usr/local/NCEPLIBS-external/
export WGRIB2_ROOT=/usr/local/NCEPLIBS-external/

(base) ed@mikado:~/NCEPLIBS/build$ cmake -Wno-dev ..

-- The C compiler identification is GNU 7.5.0
-- The Fortran compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/local/bin/mpicc
-- Check for working C compiler: /usr/local/bin/mpicc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working Fortran compiler: /usr/local/bin/mpifort
-- Check for working Fortran compiler: /usr/local/bin/mpifort - works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/local/bin/mpifort supports Fortran 90
-- Checking whether /usr/local/bin/mpifort supports Fortran 90 - yes
-- Setting build type to 'Release' as none was specified.
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (found version "80") 
-- Found Jasper: /usr/local/NCEPLIBS-external/lib/libjasper.so (found version "2.0.16") 
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.34") 
-- Found MPI_Fortran: /usr/local/bin/mpifort (found version "3.1") 
-- Found MPI: TRUE (found version "3.1") found components: Fortran 
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Found BLAS: /usr/lib/x86_64-linux-gnu/libblas.so  
-- Looking for Fortran cheev
-- Looking for Fortran cheev - not found
-- Looking for Fortran cheev
-- Looking for Fortran cheev - found
-- A library with LAPACK API found.
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'netcdf>=4'
--   Found netcdf, version 4.7.4
-- Checking for module 'netcdf-fortran>=4'
--   Found netcdf-fortran, version 4.5.3-development
-- Found NETCDF_LIBRARIES:   
-- Found ESMF library: /home/ed/NCEPLIBS-external/esmf/lib/libO/Linux.gfortran.64.mpiuni.default/libesmf.a
-- Found WGRIB2: include directory /usr/local/NCEPLIBS-external/include, library /usr/local/NCEPLIBS-external/lib/libwgrib2.a
-- Found MPI_C: /usr/local/bin/mpicc (found version "3.1") 
-- Found MPI: TRUE (found version "3.1")  
-- Creating shell scripts to set environment variables for using NCEPLIBS
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ed/NCEPLIBS/build

Thanks for all the help! I will close this issue.

I have started an issue for netcdf-c about where we install our pkg-config info.

Thanks again!

climbfuji commented 4 years ago

Thanks for your feedback and for making it work despite all the hiccups along the way. For the next release of the UFS, expect an improved version of NCEPLIBS-external and findNetCDF.cmake that works without pkg-config, amongst other things.

edwardhartnett commented 4 years ago

I would suggest we coordinate wrt netcdf-c and netcdf-fortran. The newest release of netcdf-c (4.7.4) and the next release of netcdf-fortran includes optional support for szip, and that is something people will be interested in. Unfortunately it complicated the LDFLAGS situation.

When I look at NCEPLIBS master branch I see this in the .gitmodules:

[submodule "netcdf"]
    path = netcdf
    url = https://github.com/Unidata/netcdf-c
    branch = master

You should not be using the master branch. You should be using the last stable release.

It's also not clear why you are build netcdf again here...

kgerheiser commented 4 years ago

I'm not sure if this was before you saw my comment, but we do not build NetCDF again in there. That was before we split out the external libraries into a separate repo a long time ago and this is not what we do.

edwardhartnett commented 4 years ago

@kgerheiser thanks for the explanation. ;-)