r-barnes / richdem

High-performance Terrain and Hydrology Analysis
GNU General Public License v3.0
260 stars 66 forks source link

cmake does not produce makefile #49

Open Tecknique opened 2 years ago

Tecknique commented 2 years ago

I have been unable to build this project, the error comes up after I try to do the command: make -j 6

It looks like the cmake command does not build the necessary makefile.

I also noticed that the cmake command does not use the 'Released' type variable

Thanks, James


-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19042.
-- The CXX compiler identification is MSVC 19.29.30138.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found GDAL: C:/Users/12067/anaconda3/envs/richdem/Library/lib/gdal_i.lib (found version "3.4.2")
-- Found OpenMP_CXX: -openmp (found version "2.0")
-- Found OpenMP: TRUE (found version "2.0")
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS)
-- Could NOT find MPI (missing: MPI_CXX_FOUND)
CMake Warning at CMakeLists.txt:24 (message):
  MPI not found; will not compile parallel programs for large-scale datasets.

-- The C compiler identification is MSVC 19.29.30138.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Compiling RichDEM with GDAL.
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_BUILD_TYPE

-- Build files have been written to: C:/Users/12067/Documents/richdem/build```
feefladder commented 2 years ago

make -j6 is a linux command and you are on windows, as I can see from the output, which looks like you just ran cmake ..

``` cmake .. -- The CXX compiler identification is GNU 11.2.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found GDAL: /usr/lib/libgdal.so (found version "3.4.1") -- Found OpenMP_CXX: -fopenmp (found version "4.5") -- Found OpenMP: TRUE (found version "4.5") -- Found MPI_CXX: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so (found version "3.1") -- Found MPI: TRUE (found version "3.1") -- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0") found components: iostreams CMake Warning at CMakeLists.txt:83 (message): Compiling RichDEM without GDAL! -- Configuring done -- Generating done -- Build files have been written to: /home/fee/Git/richdem/build ```

According to this answer, you can use:

cmake ..
cmake --build . --config Release

which should give output something like:

[  1%] Building CXX object CMakeFiles/richdem.dir/src/richdem.cpp.o
[  3%] Building CXX object CMakeFiles/richdem.dir/src/random.cpp.o
[  5%] Building CXX object CMakeFiles/richdem.dir/src/gdal.cpp.o
[  6%] Building CXX object CMakeFiles/richdem.dir/src/terrain_generation/terrain_generation.cpp.o
[  8%] Building CXX object CMakeFiles/richdem.dir/src/terrain_generation/PerlinNoise.cpp.o
[ 10%] Linking CXX static library librichdem.a

good luck!

Khaled-Pr commented 1 month ago

You should add the following -G "MinGW Makefiles" to the cmake command