ec-jrc / lisflood-code

Lisflood OS - LISFLOOD
https://ec-jrc.github.io/lisflood
European Union Public License 1.2
118 stars 47 forks source link

How to compile lisflood-fp 8.1 #154

Closed canhongluori closed 4 months ago

canhongluori commented 6 months ago

When I try to compile lisflood-fp 8.1 on my computer, the CMake reported the following error to me CMake Error at /usr/local/share/cmake-3.24/Modules/CMakeTestCUDACompiler.cmake:102 (message): The CUDA compiler

"/usr/local/cuda-12.0/bin/nvcc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /mnt/d/Cpp_project/wsl/LISFLOOD-FP-trunk/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_45572/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_45572.dir/build.make CMakeFiles/cmTC_45572.dir/build
gmake[1]: Entering directory '/mnt/d/Cpp_project/wsl/LISFLOOD-FP-trunk/CMakeFiles/CMakeTmp'
Building CUDA object CMakeFiles/cmTC_45572.dir/main.cu.o
/usr/local/cuda-12.0/bin/nvcc -forward-unknown-to-host-compiler   -gencode=arch=compute_37,code=sm_37 -gencode=arch=compute_37,code=compute_37  -MD -MT CMakeFiles/cmTC_45572.dir/main.cu.o -MF CMakeFiles/cmTC_45572.dir/main.cu.o.d -x cu -c /mnt/d/Cpp_project/wsl/LISFLOOD-FP-trunk/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_45572.dir/main.cu.o
nvcc fatal   : Unsupported gpu architecture 'compute_37'
gmake[1]: *** [CMakeFiles/cmTC_45572.dir/build.make:79: CMakeFiles/cmTC_45572.dir/main.cu.o] Error 1
gmake[1]: Leaving directory '/mnt/d/Cpp_project/wsl/LISFLOOD-FP-trunk/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_45572/fast] Error 2

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:68 (enable_language)

My cmake version is 3.24.3, and my cuda version is cuda_12.0.r12.0, My system is Ubuntu-2204

StefaniaGrimaldi commented 6 months ago

Dear @canhongluori, this is the repository of OS LISFLOOD hydrological model. Your question is related to a different model: LISFLOOD-FP (floodplain) hydrodynamic model. For this reason, we are not able to help. Kind regards, Stefania