Closed gaaraujo closed 8 months ago
You should not include AMGX sources directly. When you build AMGX use make install
and use provided install files (library and headers) for your application (https://github.com/NVIDIA/AMGX/blob/main/CMakeLists.txt#L286-L289)
Hi, @marsaev! Thanks for your quick answer! Just to clarify:
I built AmgX using the following according to README.md
mkdir build
cd build
cmake ../
make -j16 all
Instead, should I do this?
mkdir build
cd build
cmake ../
make -j16 install
Update:
I ran make install inside the build directory of amgx, and obtained a new lib folder containing libamgxsh.so.
My makefile now runs the following:
/share/software/user/open/cuda/12.2.0/bin/nvcc src/gifted.cu -o gifted -Isrc -I"/share/software/user/open/cuda/12.2.0/include" -I"../amgx/include" -lcudart -L"/share/software/user/open/cuda/12.2.0/lib64" -lamgxsh -L"../amgx/lib" -Xlinker "-rpath="./lib" " -ldl
Unfortunately, I still get the same error. What else could I be missing?
Command line looks right. Just to clarify - your files, i.e. gifted.cu
should include only amgx_c.h
header. According to error it seems other AMGX might be included there. Can you check what you include in sources?
Thanks again for replying!
Indeed, I had some references to other libraries. In one of the files, I had:
#include <cusp/csr_matrix.h>
#include <cusp/print.h>
Getting rid of these headers worked! Thanks!
Closing the issue!
Hi, I am trying to build an app that uses the AmgX library. I managed to compile AmgX successfully. However, I get errors when trying to compile an app that uses AmgX. The source code for this app is inside a folder
src
, with the main file beinggifted.cu
To build this app, I use the following Makefile makefile.txt
That basically results in the following command being executed:
/share/software/user/open/cuda/12.2.0/bin/nvcc src/gifted.cu -o gifted -Isrc -I"/share/software/user/open/cuda/12.2.0/include" -I"../amgx/include" -I"../amgx/thrust" -lcudart -L"/share/software/user/open/cuda/12.2.0/lib64" -lamgxsh -L"../amgx/build" -Xlinker "-rpath="./lib" " -ldl
Part of the output I get is the following:
Any idea of what I could be missing in my makefile?