1#!/usr/bin/python 2 3# Kokkos cmake options: 4# cmake \ 5# -DCMAKE_INSTALL_PREFIX=/nfs/gce/projects/petsc/soft/kokkos \ 6# -DCMAKE_CXX_COMPILER=dpcpp \ 7# -DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \ 8# -DCMAKE_CXX_STANDARD=17 \ 9# -DCMAKE_VERBOSE_MAKEFILE=OFF \ 10# -DCMAKE_CXX_EXTENSIONS=OFF \ 11# -DCMAKE_BUILD_TYPE=Debug \ 12# -DKokkos_ENABLE_SYCL=ON \ 13# -DKokkos_ENABLE_SERIAL=ON \ 14# -DBUILD_SHARED_LIBS=ON\ 15# -DKokkos_ENABLE_DEPRECATED_CODE_3=OFF 16 17# Kokkos-Kernels cmake options: 18# cmake \ 19# -DCMAKE_CXX_COMPILER=dpcpp \ 20# -DBUILD_SHARED_LIBS=ON \ 21# -DKokkos_ROOT=/nfs/gce/projects/petsc/soft/kokkos \ 22# -DCMAKE_INSTALL_PREFIX=/nfs/gce/projects/petsc/soft/kokkos \ 23# -DCMAKE_BUILD_TYPE=Debug 24 25import os 26petsc_hash_pkgs=os.path.join(os.getenv('HOME'),'petsc-hash-pkgs') 27 28if __name__ == '__main__': 29 import sys 30 import os 31 sys.path.insert(0, os.path.abspath('config')) 32 import configure 33 configure_options = [ 34 '--package-prefix-hash='+petsc_hash_pkgs, 35 '--with-cc=mpicc -cc=icx', # need to make mpicc/mpicxx also SYCL compilers. 36 '--with-cxx=mpicxx -cxx=dpcpp', # Intel MPI does not accept -cxx=icpx, though it should. 37 '--with-fc=0', 38 '--COPTFLAGS=-g -O2', 39 '--CXXOPTFLAGS=-g -O2', 40 '--CXXPPFLAGS=-std=c++17', 41 '--SYCLOPTFLAGS=-g -O2', 42 # use prebuilt Kokkos and KK as it takes a long time to build them from source 43 '--with-kokkos-dir=/nfs/gce/projects/petsc/soft/kokkos', 44 '--with-kokkos-kernels-dir=/nfs/gce/projects/petsc/soft/kokkos', 45 '--with-cuda=0', 46 '--with-sycl=1', 47 '--with-syclc=dpcpp', 48 '--with-sycl-dialect=c++17', 49 ] 50 51 configure.petsc_configure(configure_options) 52