xref: /petsc/config/examples/arch-ci-linux-sycl-double.py (revision d65ab8f64562a59c9f96720c0d374e621d5cbddf)
128f796eaSScott Kruger#!/usr/bin/python
228f796eaSScott Kruger
3e469a5b0SJunchao Zhang# Kokkos cmake options:
4e469a5b0SJunchao Zhang# cmake \
5e469a5b0SJunchao Zhang#   -DCMAKE_INSTALL_PREFIX=/nfs/gce/projects/petsc/soft/kokkos \
6e469a5b0SJunchao Zhang#   -DCMAKE_CXX_COMPILER=dpcpp \
7e469a5b0SJunchao Zhang#   -DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
8e469a5b0SJunchao Zhang#   -DCMAKE_CXX_STANDARD=17 \
9e469a5b0SJunchao Zhang#   -DCMAKE_VERBOSE_MAKEFILE=OFF \
10e469a5b0SJunchao Zhang#   -DCMAKE_CXX_EXTENSIONS=OFF \
11e469a5b0SJunchao Zhang#   -DCMAKE_BUILD_TYPE=Debug \
12e469a5b0SJunchao Zhang#   -DKokkos_ENABLE_SYCL=ON \
13e469a5b0SJunchao Zhang#   -DKokkos_ENABLE_SERIAL=ON \
14e469a5b0SJunchao Zhang#   -DBUILD_SHARED_LIBS=ON\
15e469a5b0SJunchao Zhang#   -DKokkos_ENABLE_DEPRECATED_CODE_3=OFF
16e469a5b0SJunchao Zhang
17e469a5b0SJunchao Zhang# Kokkos-Kernels cmake options:
18e469a5b0SJunchao Zhang# cmake \
19e469a5b0SJunchao Zhang#   -DCMAKE_CXX_COMPILER=dpcpp \
20e469a5b0SJunchao Zhang#   -DBUILD_SHARED_LIBS=ON \
21e469a5b0SJunchao Zhang#   -DKokkos_ROOT=/nfs/gce/projects/petsc/soft/kokkos \
22e469a5b0SJunchao Zhang#   -DCMAKE_INSTALL_PREFIX=/nfs/gce/projects/petsc/soft/kokkos \
23e469a5b0SJunchao Zhang#   -DCMAKE_BUILD_TYPE=Debug
24e469a5b0SJunchao 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,
35e469a5b0SJunchao Zhang    '--with-cc=mpicc -cc=icx', # need to make mpicc/mpicxx also SYCL compilers.
36e469a5b0SJunchao Zhang    '--with-cxx=mpicxx -cxx=dpcpp', # Intel MPI does not accept -cxx=icpx, though it should.
37e469a5b0SJunchao Zhang    '--with-fc=0',
38e469a5b0SJunchao Zhang    '--COPTFLAGS=-g -O2',
39e469a5b0SJunchao Zhang    '--CXXOPTFLAGS=-g -O2',
40e469a5b0SJunchao Zhang    '--CXXPPFLAGS=-std=c++17',
41e469a5b0SJunchao Zhang    '--SYCLOPTFLAGS=-g -O2',
42*d65ab8f6SJunchao Zhang    # To surpress warnings in checking Kokkos-Kernels headers like:
43*d65ab8f6SJunchao Zhang    # Kokkos_MathematicalFunctions.hpp:299:34: warning: comparison with infinity always evaluates
44*d65ab8f6SJunchao Zhang    # to false in fast floating point modes [-Wtautological-constant-compare]
45*d65ab8f6SJunchao Zhang    # KOKKOS_IMPL_MATH_UNARY_PREDICATE(isinf)
46*d65ab8f6SJunchao Zhang    '--SYCLPPFLAGS=-Wno-tautological-constant-compare',
47e469a5b0SJunchao Zhang    # use prebuilt Kokkos and KK as it takes a long time to build them from source
48e469a5b0SJunchao Zhang    '--with-kokkos-dir=/nfs/gce/projects/petsc/soft/kokkos',
49e469a5b0SJunchao Zhang    '--with-kokkos-kernels-dir=/nfs/gce/projects/petsc/soft/kokkos',
5028f796eaSScott Kruger    '--with-cuda=0',
5128f796eaSScott Kruger    '--with-sycl=1',
5250dcbc5aSJunchao Zhang    '--with-syclc=dpcpp',
53e469a5b0SJunchao Zhang    '--with-sycl-dialect=c++17',
5428f796eaSScott Kruger  ]
5528f796eaSScott Kruger
5628f796eaSScott Kruger  configure.petsc_configure(configure_options)
57