Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue building on RHEL7 with cuda 12.1 and gcc 11.2.0 #49

Closed
zhangchonglin opened this issue Mar 31, 2023 · 2 comments
Closed

Issue building on RHEL7 with cuda 12.1 and gcc 11.2.0 #49

zhangchonglin opened this issue Mar 31, 2023 · 2 comments
Assignees
Labels
bug Something isn't working thrust

Comments

@zhangchonglin
Copy link

While building with cuda 12.1 and gcc 11.2.0 on a RHEL 7 computer, I encountered the following thrust error:

[  1%] Building CXX object src/CMakeFiles/omega_h.dir/Omega_h_adapt.cpp.o
[  1%] Building CXX object src/CMakeFiles/omega_h.dir/Omega_h_align.cpp.o
[  2%] Building CXX object src/CMakeFiles/omega_h.dir/Omega_h_adj.cpp.o
[  2%] Building CXX object src/CMakeFiles/omega_h.dir/Omega_h_amr.cpp.o
[  2%] Building CXX object src/CMakeFiles/omega_h.dir/Omega_h_amr_topology.cpp.o
[  3%] Building CXX object src/CMakeFiles/omega_h.dir/Omega_h_amr_transfer.cpp.o
[  3%] Building CXX object src/CMakeFiles/omega_h.dir/Omega_h_any.cpp.o
[  4%] Building CXX object src/CMakeFiles/omega_h.dir/Omega_h_approach.cpp.o
[  4%] Building CXX object src/CMakeFiles/omega_h.dir/Omega_h_array.cpp.o
[  5%] Building CXX object src/CMakeFiles/omega_h.dir/Omega_h_assoc.cpp.o
[  5%] Building CXX object src/CMakeFiles/omega_h.dir/Omega_h_array_ops.cpp.o
[  6%] Building CXX object src/CMakeFiles/omega_h.dir/Omega_h_base64.cpp.o
/lore/zhangc20/pumi-pic/omega_h/src/Omega_h_reduce.hpp(84): error: namespace "thrust" has no member "device"
    return thrust::transform_reduce(thrust::device, first, last,
                                            ^

1 error detected in the compilation of "/lore/zhangc20/pumi-pic/omega_h/src/Omega_h_array_ops.cpp".
make[2]: *** [src/CMakeFiles/omega_h.dir/Omega_h_array_ops.cpp.o] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src/CMakeFiles/omega_h.dir/all] Error 2
make: *** [all] Error 2

The build script:

module unuse /opt/scorec/spack/lmod/linux-rhel7-x86_64/Core                     
module use /opt/scorec/spack/v0181_1/lmod/linux-rhel7-x86_64/Core               
module load gcc/11.2.0                                                          
module load mpich/4.0.2                                                         
module load cmake                                                               
                                                                                
cuda=/usr/local/cuda-12.1                                                       
export PATH=$cuda/bin:$PATH                                                     
export LD_LIBRARY_PATH=$cuda/lib64:$LD_LIBRARY_PATH                             
export installroot=$PWD                                                         
export srcroot=$installroot/../                                                 
                                                                                
# kokkos                                                                        
export kk=$installroot/kokkos/install                                           
export kksrc=$srcroot/kokkos                                                    
                                                                                
# omega_h                                                                       
export oh=$installroot/omega_h/install                                          
export ohsrc=$srcroot/omega_h                                                   
                                                                                
cd $installroot                                                                 
mkdir -p omega_h/build                                                          
cd omega_h/build                                                                
cmake $ohsrc -DCMAKE_BUILD_TYPE=Release \                                       
             -DCMAKE_INSTALL_PREFIX=$oh \                                       
             -DBUILD_SHARED_LIBS=OFF \                                          
             -DOmega_h_USE_Kokkos=ON \                                          
             -DOmega_h_USE_CUDA=on \                                            
             -DOmega_h_CUDA_ARCH=86 \                                           
             -DOmega_h_USE_MPI=on \                                             
             -DOmega_h_USE_OpenMP=OFF \                                         
             -DBUILD_TESTING=ON \                                               
             -DCMAKE_CXX_COMPILER=mpicxx \                                      
             -DCMAKE_C_COMPILER=mpicc \                                         
             -DKokkos_PREFIX=$kk/lib64/cmake                                    
make -j4 install                                                                
ctest
@cwsmith cwsmith self-assigned this Mar 31, 2023
@cwsmith cwsmith added bug Something isn't working thrust labels Mar 31, 2023
@zhangchonglin
Copy link
Author

Looks like there is an easy fix as suggested in the following two github issues:

Basically including the following header file:

#include <thrust/execution_policy.h>

zhangchonglin added a commit to zhangchonglin/omega_h that referenced this issue Apr 1, 2023
cwsmith added a commit that referenced this issue Apr 14, 2023
Add missing thrust header file to fix issue #49
@zhangchonglin
Copy link
Author

Fixed by #50.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working thrust
Projects
None yet
Development

No branches or pull requests

2 participants