


If I set the CMAKE_CUDA_ARCHITECTURES flag in my cmakelists.txt file, the variable wouldn't propagate to this cmake file which compiles a test program. Apparently the failure was happening in a file that tests whether the nvcc compiler is working or not (CMakeTestCUDACompiler.cmake). In the mean time, I found a hacky work around. Unfortunately, I have to get approval to do that on the machine I'll be using, but might be able to do that in the future. Any ideas on where to start? PATH env var maybe? I'll play with the environment on my local machine. Right now, I'm just trying to use CLion's more IDE-ish feature (it's a glorified text editor because of the error listed), and I'm compiling on another machine where the tool chain is set properly. I was hoping CLion would create a project that would work by default out of the box.I don't have the time to pick it up at the moment. However, I don't know much about CMake at the moment (I'll pick it up over time). I'll look into it.Īppreciate the advice re making a good CMakeList.txt for CUDA projects that I use as a starting template. It's odd to me that it doesn't work out of the box, but it may be an environment issue. I'm simply trying to compile a test "Hello World" program at the moment. The CMakeList.txt file I listed is the default created by CLion. I created the project in CLion (CUDA project - I think it's been supported since 2018). My advice in general is to take your time and write one solid CMakeList.txt and reuse it later for other projects. So make it work once and then setup the template in the preferences. You can overwrite that templates of basically anything in Clion. This CMakeList.txt file looks way to basic to make CUDA work. May indicate that you link anrainst a shared library?ĭid you follow some guide to crate a CUDA project our how did you write your CMakeList.txt? My guess is that you need to do it probably and not fight symptoms. But it’s in you to have your environment configured correctly so cMake can pick anything This will tell your that the problem is not Clion but cMake or your env.Ĭlion creates a default CMakeLists.txt that works with most systems. If I am right you should get the same or a similar error. Try compiling your project using the Terminal. Clion does not come with a compile or libraries out of the box. This does not appear to be a problem with your IDE but your dev environment. Set(CMAKE_CUDA_ARCHITECTURES 60) //added in an attempt to fix, but doesn't work The existing CMakeLists.txt looks like this (the default): cmake_minimum_required(VERSION 3.19) Not the most familiar with Cmake, but trying to learn a bit. How can I set the default such that when I begin a new project, it "just works"?.Is there a way to set this property globally so individual targets don't have to be explicitly set?.What is the meaning of these seemingly random designators?.Why doesn't CLion do this automatically when creating a new project?.These errors no longer appear for the specific target - however, new errors are generated for new "targets" that apparently exist. If I explicitly add this property for each target that throws errors, ala: set_target_properties( This value in the "_" seems random and changes every time I attempt to "Reload Cmake Project". To start with, I get a: CMake Error in C://CMakeLists.txt:ĬUDA_ARCHITECTURES is empty for target "cmTC_bd136". Whenever I create a CUDA project in CLion (2021.1), I am not able to use most of the IDE's features because the initial project setup fails. I'm hoping someone can point me in the right direction on something.
