gotm-model / code

Source code for the General Ocean Turbulence Model
https://gotm.net
GNU General Public License v2.0
53 stars 44 forks source link

NetCDF_INCLUDE_DIRS variable missing on Linux for Windows #37

Open eesa10-bu opened 1 year ago

eesa10-bu commented 1 year ago

Hi, I don't know if this is a known problem, but I was unable to run the cmake step on Linux for Windows (WSL - ubuntu). It exited with:

CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find NetCDF (missing: NetCDF_INCLUDE_DIRS)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  extern/flexout/cmake/Modules/FindNetCDF.cmake:80 (find_package_handle_standard_args)
  extern/flexout/CMakeLists.txt:39 (find_package)

I solved the problem by changing line 19 of GOTM\code\extern\flexout\cmake\Modules\ FindNetCDF.cmake to set(NetCDF_INCLUDE_DIRS ${includedir} CACHE STRING "NetCDF include directories" FORCE) without FORCE the variable was not being set.

Regards, Noel

bolding commented 1 year ago

Hi Noel

Thanks for reporting. I'm also testing on WSL and do not experience the issue you did. I think my version of CMake is newer - maybe 3.21 or so - maybe that can be the explenation.

You know you can also download the oneAPI Fortran compiler and work on Windows. I actually share the code between Windows and WSL and build in two different folders depending on if I'm in Linux or Windows.

Karsten

Den ons. 4. jan. 2023 kl. 17.29 skrev eesa10-bu @.***>:

Hi, I don't know if this is a known problem, but I was unable to run the cmake step on Linux for Windows (WSL - ubuntu). It exited with:

CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find NetCDF (missing: NetCDF_INCLUDE_DIRS) Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) extern/flexout/cmake/Modules/FindNetCDF.cmake:80 (find_package_handle_standard_args) extern/flexout/CMakeLists.txt:39 (find_package)

I solved the problem by changing line 19 of GOTM\code\extern\flexout\cmake\Modules\ FindNetCDF.cmake to set(NetCDF_INCLUDE_DIRS ${includedir} CACHE STRING "NetCDF include directories" FORCE) without FORCE the variable was not being set.

Regards, Noel

— Reply to this email directly, view it on GitHub https://github.com/gotm-model/code/issues/37, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVA42LU2IDHF5VHBDS23D3WQWQOJANCNFSM6AAAAAATQ7LEKI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Karsten Bolding @.*** +4564422058

eesa10-bu commented 1 year ago

Hi Karsten,

Thanks. My version of cmake is 3.16.3 - it was the default one that installed with sudo apt-get install cmake - I would have expected a newer version, but that's life! Serves me right for mixing Linux and Windows.

Noel.