Skip to content

Latest commit

 

History

History
88 lines (77 loc) · 2.09 KB

3.2-cvode.md

File metadata and controls

88 lines (77 loc) · 2.09 KB

cmake command line

add flags in ./CVODE-X.X.X/cmake/SundialsSetupCompilers.cmake

for find sycl.hpp header

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --cuda-gpu-arch=sm_86")

cmake && make -j install

  • oneapi-src/onemkl add
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --cuda-gpu-arch=sm_86")
#/cvode-6.5.0/build$ 
##use clang++ as cpp compiler for onemkl
$ trash -rf ./* && cmake \
-DCMAKE_INSTALL_PREFIX=/home/ljl/Apps/cvode \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_CXX_FLAGS=-fsycl \
-DENABLE_SYCL=ON \
-DENABLE_ONEMKL=ON \
-DBUILD_TESTING=ON \
-DEXAMPLES_ENABLE_C=OFF \
-DONEMKL_DIR=/home/ljl/Apps/onemkl \
..
#-DCMAKE_C_COMPILER=clang \
#-DONEMKL_DIR=/opt/intel/oneapi/mkl/2023.0.0 \
#-DONEMKL_DIR=/home/ljl/Apps/onemkl \
$ make -j install
  • oneapi/mkl
#/cvode-6.5.0/build$ 
##use clang++ as cpp compiler for onemkl
$ trash -rf ./* && cmake \
-DCMAKE_INSTALL_PREFIX=/home/ljl/Apps/cvode \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_C_COMPILER=icx \
-DCMAKE_CXX_COMPILER=icpx \
-DCMAKE_CXX_FLAGS=-fsycl \
-DSUNDIALS_PRECISION=SINGLE \
-DENABLE_SYCL=ON \
-DENABLE_ONEMKL=ON \
-DBUILD_TESTING=ON \
-DEXAMPLES_ENABLE_C=OFF \
-DONEMKL_DIR=/opt/intel/oneapi/mkl/2023.0.0 \
..
#-DCMAKE_C_COMPILER=clang \
#-DONEMKL_DIR=/opt/intel/oneapi/mkl/2023.0.0 \
#-DONEMKL_DIR=/home/ljl/Apps/onemkl \
$ make -j install
  • CUDA
#/cvode-6.5.0/build$ 
##for cuda
$ trash -rf ./* && cmake \
-DCMAKE_INSTALL_PREFIX=/home/ljl/Apps/cvode \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=17 \
-DENABLE_CUDA=ON \
-DEXAMPLES_ENABLE_C=OFF \
-DCMAKE_CUDA_ARCHITECTURES=86 \
-DEXAMPLES_ENABLE_CUDA=ON \
-DEXAMPLES_ENABLE_CXX=ON \
..
#-DONEMKL_DIR=/opt/intel/oneapi/mkl/2023.0.0 \
#-DONEMKL_DIR=/home/ljl/Apps/onemkl \
$ make -j install