RAJAPerf icon indicating copy to clipboard operation
RAJAPerf copied to clipboard

Minimum required gcc 9.0 when compiling with nvcc?

Open CRobeck opened this issue 3 years ago • 9 comments

Compiling with gcc 8.1.0 + nvcc 11.2.67 gives the following build error:

/RAJAPerf/src/basic/MAT_MAT_SHARED-Cuda.cpp: In instantiation of 'void rajaperf::basic::MAT_MAT_SHARED::runCudaVariantImpl(rajaperf::VariantID) [with long unsigned int block_size = 256]': /tmp/tmpxft_002d5158_00000000-6_MAT_MAT_SHARED-Cuda.cudafe1.stub.c:12:193: required from here RAJAPerf/src/basic/MAT_MAT_SHARED-Cuda.cpp:234:4: sorry, unimplemented: capture of variably-modified type 'double [tile_size][tile_size]' that is not an N3639 array of runtime bound MAT_MAT_SHARED_BODY_1(tile_size)

Fixed by compiling with gcc 9.2.0. Is that expected?

CRobeck avatar May 05 '22 01:05 CRobeck

That seems odd because tile_size is declared constexpr here https://github.com/LLNL/RAJAPerf/blob/develop/src/basic/MAT_MAT_SHARED-Cuda.cpp#L67. I believe n3639 arrays (analogous to C99 VLA) came in C++14. Are you building with C++14; i.e., pass -DBLT_CXX_STD=c++14 option to CMake?

rhornung67 avatar May 05 '22 15:05 rhornung67

Should add something like: set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) To the top level RAJA Perf CMake files?

CRobeck avatar May 05 '22 15:05 CRobeck

https://github.com/LLNL/RAJAPerf/blob/develop/CMakeLists.txt#L25

Dunno what's going on with the build issue.

rhornung67 avatar May 05 '22 15:05 rhornung67

Right. But I think what's happening is CMake is letting that get overridden by the compiler default. CMAKE_CXX_STANDARD_REQUIRED, I believe, should error out before getting there.

CRobeck avatar May 05 '22 15:05 CRobeck

I’m pretty sure BLT sets both CMAKE_CXX_STANDARD and CMAKE_CXX_STANDARD_REQUIRED.

On Thu, May 5, 2022 at 8:16 AM Corbin Robeck @.***> wrote:

Right. But I think what's happening is CMake is letting that get overridden by the compiler default. CMAKE_CXX_STANDARD_REQUIRED, I believe, should error out before getting there.

— Reply to this email directly, view it on GitHub https://github.com/LLNL/RAJAPerf/issues/244#issuecomment-1118682870, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQY6TJZ6VMLASOI6ABTWYDVIPQ5NANCNFSM5VDVSAPA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

adayton1 avatar May 05 '22 15:05 adayton1

Can you post the output of make VERBOSE=1?

davidbeckingsale avatar May 05 '22 15:05 davidbeckingsale

-std=c++14 is getting set:

cd /RAJAPerf/build_cuda/src/basic && /cm/shared/apps/cuda11.2/toolkit/11.2.0/bin/nvcc -forward-unknown-to-host-compiler -ccbin=/opt/gcc/8.1.0/bin/c++ -DRUN_RAJA_SEQ -I/RAJAPerf/build_cuda/include -I/RAJAPerf/src/. -I/RAJAPerf/tpl/RAJA/include -I/RAJAPerf/build_cuda/tpl/RAJA/include -I/RAJAPerf/tpl/RAJA/tpl/camp/include -I/RAJAPerf/build_cuda/tpl/RAJA/tpl/camp/include -isystem=/cm/shared/apps/cuda11.2/toolkit/11.2.0/include -restrict -arch sm_70 --expt-extended-lambda --expt-relaxed-constexpr -O3 -DNDEBUG -Xcompiler=-fPIC -std=c++14 -x cu -c /RAJAPerf/src/basic/NESTED_INIT-OMP.cpp -o CMakeFiles/basic.dir/NESTED_INIT-OMP.cpp.o /RAJAPerf/src/basic/MAT_MAT_SHARED-Cuda.cpp: In instantiation of 'void rajaperf::basic::MAT_MAT_SHARED::runCudaVariantImpl(rajaperf::VariantID) [with long unsigned int block_size = 256]': /tmp/tmpxft_002f326c_00000000-6_MAT_MAT_SHARED-Cuda.cudafe1.stub.c:12:193: required from here /RAJAPerf/src/basic/MAT_MAT_SHARED-Cuda.cpp:234:4: sorry, unimplemented: capture of variably-modified type 'double [tile_size][tile_size]' that is not an N3639 array of runtime bound MAT_MAT_SHARED_BODY_1(tile_size)

CRobeck avatar May 05 '22 18:05 CRobeck

Does the standard need to be set for CUDA also?

rhornung67 avatar May 05 '22 19:05 rhornung67

Isn't that this: https://github.com/LLNL/RAJAPerf/blob/develop/CMakeLists.txt#L116 @davidbeckingsale do you think we need REQUIRED here? set(CMAKE_CUDA_STANDARD_REQUIRED TRUE) set(CMAKE_CXX_STANDARD_REQUIRED TRUE)

CRobeck avatar May 05 '22 19:05 CRobeck