Modern CMake + CUDA + Clang

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Modern CMake + CUDA + Clang

Stephen McDowell
Hello!

I stumbled across the new 3.8+ CUDA as a language capabilities, and am very excited about this!

1. Does anybody know when CMAKE_CUDA_COMPILER_ID and CMAKE_CUDA_COMPILER_VERSION were fixed?

With cmake 3.9.4 some of the cuda compiler variables were unset:

   message("CXX compiler stuff:")
   message(STATUS "CMAKE_CXX_COMPILER:         ${CMAKE_CXX_COMPILER}")
   message(STATUS "CMAKE_CXX_COMPILER_ID:      ${CMAKE_CXX_COMPILER_ID}")
   message(STATUS "CMAKE_CXX_COMPILER_VERSION: ${CMAKE_CXX_COMPILER_VERSION}")
   message("CUDA compiler stuff:")
   message(STATUS "CMAKE_CUDA_COMPILER:         ${CMAKE_CUDA_COMPILER}")
   message(STATUS "CMAKE_CUDA_COMPILER_ID:      ${CMAKE_CUDA_COMPILER_ID}")
   message(STATUS "CMAKE_CUDA_COMPILER_VERSION: ${CMAKE_CUDA_COMPILER_VERSION}")
   message(FATAL_ERROR "bye bye")

CMAKE_CUDA_COMPILER was set, but COMPILER_ID and COMPILER_VERSION were not.  I just updated to 3.10.2 and they were giving values I would expect.  I dug around under the diffs on Modules but got really turned around.

I would like to set my minimum required version to whenever this was introduced, as I would like to wield it.

2. Is there any existing work / discussion on the new world order (CUDA as a full-fledged language) and Clang?  I noticed that the following happens:

   if(CMAKE_CUDA_COMPILER_ID)
     include(Compiler/${CMAKE_CUDA_COMPILER_ID}-CUDA OPTIONAL)
   endif()

leaving room for a Compiler/Clang-CUDA.cmake to be created.  Is there an eventual goal to write this?  I think I can maybe help get a prototype working if that was the goal for this setup.

3. Supposing CMake + Clang + CUDA was working, the working assumption would be that a user sets CUDACXX to clang++, right?  I’m trying to understand if Clang as a cuda compiler already works and I have bad local configurations, or if they are needing to be written.

Thanks for any thoughts!

-Stephen

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Modern CMake + CUDA + Clang

Stephen McDowell
I found the GitLab tracker: https://gitlab.kitware.com/cmake/cmake/issues/16586



--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Modern CMake + CUDA + Clang

Stephen McDowell
In reply to this post by Stephen McDowell
Excellent, this is very useful — thanks Robert!

I think I have some answers to some of these, but as I make progress will probably reach out to the LLVM mailing lists for help / suggestions (particularly with separable compilation and device linking).

I’m still ramping up to speed on developing CMake.  You had mentioned CMake_TEST_CUDA which will be helpful down the line, but intermediately is it “ok” to just modify *.cmake modules in-place underneath the installed Modules and Modules/Compiler directories?  I’ve got a custom install / am not concerned about breaking things in it, I’m just wondering if this is a typical practice or if I should be re-compiling and re-installing every time I make changes.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Modern CMake + CUDA + Clang

Stephen McDowell
Whoops… sorry I replied to the mail server, please ignore this thread and let it die, see issue tracker linked in second post.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake