"fconstexpr-steps" compiler flag

So I have a single cuda file with a c++ dependency (e.g. #include <ecc/curves/grumpkin/grumpkin.hpp>). Nvcc is compiling the cuda file with a dependency that relies on the compiler flag “fconstexpr-steps=100000000” being set. This flag is recognized by CCX, but not by NVCC (so the file won’t compile).

To get around this, I use the “string(APPEND CMAKE_CUDA_FLAGS " -Xcompiler -fconstexpr-depth=100000000”)" inside the cmake file. This way, the nvcc compiles host code with your c++ compiler, passing in -Xcompiler “-fconstexpr-steps=1000000000” will forward that argument to the c++ compiler being used.

For some reason, it’s still failing. I’m using clang as my default toolchain/compiler, and still get the error message below. I can’t figure out what the problem is. Any help would be a godsend, and I appreicate your time!

That looks like gcc, not clang, from the error line and gcc does not support a flag with that name.

1 Like

Right, I thought that was the source of the issue. But I set up the cmake file to use clang as my default toolchain/compiler, and it’s indicating that clang is being used during compilation. I’m not sure how to change this. If you have any insight, that would be extremely helpful! @ben.boeckel


I’m also setting this flag on the GPU, but it’s not recognizing it. Seems very odd. What do you think?

This was a test inside the cmake file, as you can see. And it outputs “/usr/bin/clang++” and “Clang”

It seems like CUDA thinks it should use gcc as the backing compiler. How to configure that is beyond my CUDA knowledge though.

1 Like