marcpaterno / gpuintegration

Code for Fermilab LDRD 2020-050 "Numerical Integration on GPUs", implementing the CUHRE routine for GPUs.
Other
11 stars 2 forks source link

How should I compile this project into a library and put it into my other programs that need calculations? #6

Open f1974939505 opened 1 month ago

f1974939505 commented 1 month ago

I can now write the interface to call Pagani, but I don't know much about CMake or how to compile such an awesome project into a library. Much appreciate.

isaki001 commented 3 weeks ago

Hi @f1974939505

This library is designed as a header-only library, so you don't need to compile anything extra beyond your own code. You just include the headers in a fashion similar to the demos. For the fastest start you can just include the same headers as in some of the demos.

The only thing to compile from our library is the demos which you do not need to do for your own code. You can try continuing to compile your code as usual, with the CUDA flags passed for architecture and making sure everything from gpuintegration is in your include path.

However, the easiest way would probably be to use the CMake structure, in which case you could just copy the CMakeLists.txt from one of the demos along with the CMakeLists.txt at the gpuintegration directory, and replace the *.cpp filename with your own.

But CMake is not required for using this library, it is just how we decided to build our demos.

Let me know if I should elaborate further or if you need any assistance with setting things up.