Gpufit icon indicating copy to clipboard operation
Gpufit copied to clipboard

New CMake CUDA tools, better cross platform support

Open ironictoo opened this issue 4 years ago • 5 comments

The CUDA support in CMake has been much improved since 3.18 and now the architectures can easily be set and cuBLAS easily included. Previously including cuBLAS was kind of hacky and it seemed to give some people trouble (myself included). With standard support in CMake now, this should improve consistency for people.

I updated the cmake files to use this, this requires cmake 3.18 or higher.

ironictoo avatar Aug 12 '21 21:08 ironictoo

I'll have a look at it. Will test also with some older CUDA versions (which I still have installed).

jkfindeisen avatar Aug 23 '21 09:08 jkfindeisen

It appears I messed up and accidentally included some of my edits to files other than the cmakelists.txt files in this branch. You can just ignore the three *.sh files (those are part of the #93 pull request).

ironictoo avatar Aug 23 '21 17:08 ironictoo

I cannot review this feature request before the next release of the software. I basically run your branch on Windows and I got problems (cublas_static.lib not existing or some compile flags mismatch). It's probably solvable, but I don't have the time for it. I will review it later.

jkfindeisen avatar Aug 31 '21 12:08 jkfindeisen

@ironictoo and @jkfindeisen - it would probably facilitate testing to set up an automated build using github actions. I've started this process and have successfully gotten both Windows and Linux builds working: see this job's artifacts. I created a draft Pull Request for this. @ironictoo if you wanted to test your CMake improvements in my PR branch, we could simultaneously test and fix the Windows build issues.

jimkring avatar Oct 08 '22 20:10 jimkring

This has been updated with all the recent CMake changes discussed with @superchromix and @jimkring . Brief summary

  • Switch from deprecated find_package(Cuda) to supported language CUDA
  • Switch from deprecated find_package(PythonInterp) to supported find_package(Python)
  • Switch from deprecated MSVC static link find/replace strings to supported PROPERTY MSVC_RUNTIME_LIBRARY
  • Set CXX standard to 20, and CUDA standard to 17 (latest supported)
  • CUBLAS linking is much simpler and same for all platforms
  • added create package script for linux (including .deb generation)

This fixes all the build action errors that have come up recently, you can see them all for a wide variety of platforms and versions here.

We could probably still remove a lot of the old architectures (they trigger warnings that they are deprecated) and the stuff about MSVC 12 and 14, but I didn't have any reason to change that so left it in for now.

ironictoo avatar Oct 18 '22 01:10 ironictoo