ddemidov/amgcl

Compile on machine with CMake version 2.8+

juexZZ opened this issue · 6 comments

Hi,
I am trying to use amgcl on a machine that only has CMake version 2.8.12.2
Due to some restrictions, I cannot update the CMake to version 3.1 as required, so I want to ask if amgcl is compilable on CMake 2.8? If so, could you kindly provide a CMakeList.txt for this?
Many thanks!

You can try to reduce the required version manually here:

cmake_minimum_required(VERSION 3.1)

This may or may not work, so what I did on some of the outdated clusters, is download fresh cmake sources from https://cmake.org/download, compile those in a folder next to amgcl, and use the resulting cmake binary. Cmake has no external dependencies, so this should be easy to do.

Hi,

Thank you for the fast response! Yes, it works when I build the newer CMake version 3.22.2 from the source and use that specific binary to compile the project. :)
One follow-up question: could you show how to compile and run the tutorial examples?
I am particularly interested in running the cuda version of the Poisson 3D problem.
Didn't find a readme for this and here's my seeming correct compile command which reports errors.
cmake . -DAMGCL_BUILD_EXAMPLES=ON -Bbuild
then
cmake --build build --config Release
It compiles just fine when I build the tests using:
cmake . -DAMGCL_BUILD_TESTS=ON -Bbuild

Thanks a lot

The following works for me:

$ cd build
$ cmake -DAMGCL_BUILD_EXAMPLES=ON -DCUDA_TARGET_ARCH=Pascal ..
$ make poisson3Db_cuda
$ ./tutorial/1.poisson3Db/poisson3Db_cuda 
Usage: ./tutorial/1.poisson3Db/poisson3Db_cuda <matrix.mtx> <rhs.mtx>

You need to make sure the CUDA SDK is installed on your system and is recognized by cmake (amgcl uses the standard FindCUDA cmake module). You also need to specify the correct CUDA architecture for your GPU (here I am using the Pascal arch for the GeForce GTX 1050 Ti GPU).

Awesome, thanks. But seems like the poisson3Db_cuda can only compile using C++ 11? Because when I call make, I am having this error:
image

Yes, AMGCL code requires C++11 compiler.

Got it. I will try to switch it in the cluster and it shall work. Thank you!