128f796eaSScott Kruger#!/usr/bin/python 228f796eaSScott Kruger 3*e469a5b0SJunchao Zhang# Kokkos cmake options: 4*e469a5b0SJunchao Zhang# cmake \ 5*e469a5b0SJunchao Zhang# -DCMAKE_INSTALL_PREFIX=/nfs/gce/projects/petsc/soft/kokkos \ 6*e469a5b0SJunchao Zhang# -DCMAKE_CXX_COMPILER=dpcpp \ 7*e469a5b0SJunchao Zhang# -DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \ 8*e469a5b0SJunchao Zhang# -DCMAKE_CXX_STANDARD=17 \ 9*e469a5b0SJunchao Zhang# -DCMAKE_VERBOSE_MAKEFILE=OFF \ 10*e469a5b0SJunchao Zhang# -DCMAKE_CXX_EXTENSIONS=OFF \ 11*e469a5b0SJunchao Zhang# -DCMAKE_BUILD_TYPE=Debug \ 12*e469a5b0SJunchao Zhang# -DKokkos_ENABLE_SYCL=ON \ 13*e469a5b0SJunchao Zhang# -DKokkos_ENABLE_SERIAL=ON \ 14*e469a5b0SJunchao Zhang# -DBUILD_SHARED_LIBS=ON\ 15*e469a5b0SJunchao Zhang# -DKokkos_ENABLE_DEPRECATED_CODE_3=OFF 16*e469a5b0SJunchao Zhang 17*e469a5b0SJunchao Zhang# Kokkos-Kernels cmake options: 18*e469a5b0SJunchao Zhang# cmake \ 19*e469a5b0SJunchao Zhang# -DCMAKE_CXX_COMPILER=dpcpp \ 20*e469a5b0SJunchao Zhang# -DBUILD_SHARED_LIBS=ON \ 21*e469a5b0SJunchao Zhang# -DKokkos_ROOT=/nfs/gce/projects/petsc/soft/kokkos \ 22*e469a5b0SJunchao Zhang# -DCMAKE_INSTALL_PREFIX=/nfs/gce/projects/petsc/soft/kokkos \ 23*e469a5b0SJunchao Zhang# -DCMAKE_BUILD_TYPE=Debug 24*e469a5b0SJunchao Zhang 2528f796eaSScott Krugerimport os 2628f796eaSScott Krugerpetsc_hash_pkgs=os.path.join(os.getenv('HOME'),'petsc-hash-pkgs') 2728f796eaSScott Kruger 2828f796eaSScott Krugerif __name__ == '__main__': 2928f796eaSScott Kruger import sys 3028f796eaSScott Kruger import os 3128f796eaSScott Kruger sys.path.insert(0, os.path.abspath('config')) 3228f796eaSScott Kruger import configure 3328f796eaSScott Kruger configure_options = [ 3428f796eaSScott Kruger '--package-prefix-hash='+petsc_hash_pkgs, 35*e469a5b0SJunchao Zhang '--with-cc=mpicc -cc=icx', # need to make mpicc/mpicxx also SYCL compilers. 36*e469a5b0SJunchao Zhang '--with-cxx=mpicxx -cxx=dpcpp', # Intel MPI does not accept -cxx=icpx, though it should. 37*e469a5b0SJunchao Zhang '--with-fc=0', 38*e469a5b0SJunchao Zhang '--COPTFLAGS=-g -O2', 39*e469a5b0SJunchao Zhang '--CXXOPTFLAGS=-g -O2', 40*e469a5b0SJunchao Zhang '--CXXPPFLAGS=-std=c++17', 41*e469a5b0SJunchao Zhang '--SYCLOPTFLAGS=-g -O2', 42*e469a5b0SJunchao Zhang # use prebuilt Kokkos and KK as it takes a long time to build them from source 43*e469a5b0SJunchao Zhang '--with-kokkos-dir=/nfs/gce/projects/petsc/soft/kokkos', 44*e469a5b0SJunchao Zhang '--with-kokkos-kernels-dir=/nfs/gce/projects/petsc/soft/kokkos', 4528f796eaSScott Kruger '--with-cuda=0', 4628f796eaSScott Kruger '--with-sycl=1', 4750dcbc5aSJunchao Zhang '--with-syclc=dpcpp', 48*e469a5b0SJunchao Zhang '--with-sycl-dialect=c++17', 4928f796eaSScott Kruger ] 5028f796eaSScott Kruger 5128f796eaSScott Kruger configure.petsc_configure(configure_options) 52