GEOS-DEV / GEOS

GEOS Simulation Framework
GNU Lesser General Public License v2.1
203 stars 80 forks source link

Compilation failure on pangea-3 if ENABLE_CUDA is OFF #3128

Closed Algiane closed 3 weeks ago

Algiane commented 1 month ago

Describe the bug Configuring and compiling geos with the TOTAL/pangea3-gcc8.4.1-openmpi-4.1.2.cmake host-config file and the -DENABLE_CUDA=OFF option fails.

As the cuda compilation is very slow, it is sometimes useful to be able to be able to quickly disable it without changing anything else in your configuration.

To Reproduce Steps to reproduce the behavior:

  1. Log on pangea 3
  2. load the modules needed to build the TPls and GEOS (1) gcc/8.4.1 2) cuda/11.5.0 3) ompi/4.1.2 4) openblas/0.3.18 5) cmake/3.26.4)
  3. Configure and build the TPLs with TOTAL/pangea3-gcc8.4.1-openmpi-4.1.2.cmake host-config file and the -DENABLE_CUDA=OFF option
  4. Configure and build Geos with the same arguments (the TOTAL/pangea3-gcc8.4.1-openmpi-4.1.2.cmake host-config file and the -DENABLE_CUDA=OFF option)
  5. The Geos build fails due :
    • to the HYPRE solver setted to "CUDA" in the host-config file of the TPLs: the ENABLE_CUDA variable sould be tested and the setting of HYPRE to CUDA should be done only if ENABLE_CUDA is ON
    • to the CUDA::nvToolsExt added inconsistently in CMake (ENABLE_CUDA flag sometimes tested and sometimes not). As this module cannot work if ENABLE_CUDA is OFF, it makes sense (and would be easier for the user) to test the ENABLE_CUDA variable everywhere.

Expected behavior As a user, I have tried to configure and build the project without looking at the host-config file and the exposed ENABLE_CUDA variable make me think that I could disable cuda with this single command line argument, which would be very convenient.

In fact it fails because:

I think that the cmake of the project should avoid failing combination of options. I will try to propose PRs accordingly.

Platform (please complete the following information):

Additional context

Linked to : https://github.com/GEOS-DEV/GEOS/pull/3129, https://github.com/GEOS-DEV/thirdPartyLibs/pull/264