NOAA-EMC / NCEPLIBS-external

Third-party libraries required by NCEPLIBS
Other
8 stars 16 forks source link

Build NetCDF using ./configure and create only static libs #52

Closed kgerheiser closed 4 years ago

kgerheiser commented 4 years ago

I configure some scripts and run ./configure to build NetCDF, creating only static libs (including HDF5 and zlib).

kgerheiser commented 4 years ago

Fixed and run make check/test (this does significantly increase the build time). Maybe I should add it as a separate step?

kgerheiser commented 4 years ago

Do you know about building HDF5? Why do we set the compilers as MPI_<lang>_COMPILER but we don't install with parallel support? Shouldn't we just use CMAKE_C_COMPILER etc instead?

We set MPI_CXX_COMPILER, but building with parallel is not supported with building C++ support and make test will fail on the C++ test. So, I turned off C++ bindings. The alternative is to set the non-parallel compilers.

climbfuji commented 4 years ago

Do you know about building HDF5? Why do we set the compilers as MPI_<lang>_COMPILER but we don't install with parallel support? Shouldn't we just use CMAKE_C_COMPILER etc instead?

We set MPI_CXX_COMPILER, but building with parallel is not supported with building C++ support and make test will fail on the C++ test. So, I turned off C++ bindings. The alternative is to set the non-parallel compilers.

I think we never bothered building the parallel version, because the UFS didn't need it. Since it's coming in the UFS weather model, we should probably enable the parallel builds of hdf5 and netcdf. No need for C++ bindings I suppose.

climbfuji commented 4 years ago

Please do not delete .github/workflows/macos-gccgfortran.yml - we want to test on both Linux and macOS. We can do Linux with gcc+gfortran and macOS with clang+gfortran. I can fix the macOS action after your PR, if needed.

kgerheiser commented 4 years ago

I'm not actually deleting it. I just can't get either one to work. Mac because its using GCC10 and this version of NetCDF-Fortran has errors building with GCC 10. Linux because NetCDF-Fortran can't find NetCDF-C even though it builds fine on my Mac and on Orion.

climbfuji commented 4 years ago

Ok, do you want me to take a look and work off of your PR?

On Jul 7, 2020, at 2:44 PM, Kyle Gerheiser notifications@github.com wrote:

I'm not actually deleting it. I just can't get either one to work. Mac because its using GCC10 and this version of NetCDF-Fortran has errors building with GCC 10. Linux because I don't know why it NetCDF-Fortran can't find NetCDF-C even though it builds fine on my Mac and on Orion.

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/NOAA-EMC/NCEPLIBS-external/pull/52#issuecomment-655123019, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5C2ROI7ALI2LF43NAU2W3R2OCL3ANCNFSM4ONZ5FVQ.

kgerheiser commented 4 years ago

If you would. I can't see anything that's wrong and it builds everywhere I try that isn't Github.

climbfuji commented 4 years ago

Sure, I will look at it for the rest of today. Thanks for all the work so far!

On Jul 7, 2020, at 2:50 PM, Kyle Gerheiser notifications@github.com wrote:

If you would. I can't see anything that's wrong and it builds everywhere I try that isn't Github.

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/NOAA-EMC/NCEPLIBS-external/pull/52#issuecomment-655126623, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5C2RIFK7VKS4EPT3J235LR2ODCZANCNFSM4ONZ5FVQ.

kgerheiser commented 4 years ago

I was able to reproduce the Linux error on an Ubuntu server I have

kgerheiser commented 4 years ago

Think I found the problem. I added -lm and -ldl to LIBS of NetCDF-Fortran because it was getting undefined references to these libraries. They were linked but not in the right order. -lm -ldhf5 is wrong but -lhdf5 -lm is fine. I don't know it works on other OS`s though.

kgerheiser commented 4 years ago

Looks like it's working. zlib, HDF5, NetCDF, and ESMF build and all tests pass.

climbfuji commented 4 years ago

Looks like it's working. zlib, HDF5, NetCDF, and ESMF build and all tests pass.

That's awesome, I'll test your PR on my Mac as well. You are still deleting the macos travis file, can you please put it back? I'll fix that failed test later.

kgerheiser commented 4 years ago

Ok, just gotta use GCC-9 for Mac and it should work

climbfuji commented 4 years ago

Ok, just gotta use GCC-9 for Mac and it should work

Thanks, will do. Good to know - and we should note that in the release notes for MRW App 1.1 - that GNU 10 won't work.

kgerheiser commented 4 years ago

See here

https://github.com/Unidata/netcdf-fortran/issues/212

kgerheiser commented 4 years ago

I will merge this and then I can add the new wgrib2