xref: /petsc/config/examples/arch-ci-linux-cuda-single-cxx.py (revision 6d8694c4fbab79f9439f1ad13c0386ba7ee1ca4b)
1df3bd252SSatish Balay#!/usr/bin/env python3
2213c392dSSatish Balay
3213c392dSSatish Balayimport os
4213c392dSSatish Balaypetsc_hash_pkgs=os.path.join(os.getenv('HOME'),'petsc-hash-pkgs')
5213c392dSSatish Balay
6213c392dSSatish Balayif __name__ == '__main__':
7213c392dSSatish Balay  import sys
8213c392dSSatish Balay  import os
9213c392dSSatish Balay  sys.path.insert(0, os.path.abspath('config'))
10213c392dSSatish Balay  import configure
11213c392dSSatish Balay  configure_options = [
12213c392dSSatish Balay    '--package-prefix-hash='+petsc_hash_pkgs,
13342ad626SSatish Balay    '--with-make-test-np=15',
14213c392dSSatish Balay    'COPTFLAGS=-g -O',
15213c392dSSatish Balay    'FOPTFLAGS=-g -O',
16213c392dSSatish Balay    'CXXOPTFLAGS=-g -O',
17*0bad3a10SSatish Balay    '--with-fortran-bindings=0',
18f403549eSJunchao Zhang    '--with-log=0',
19f403549eSJunchao Zhang    '--with-info=0',
20213c392dSSatish Balay    '--with-cuda=1',
21213c392dSSatish Balay    '--with-precision=single',
22213c392dSSatish Balay    '--with-clanguage=cxx',
23213c392dSSatish Balay    '--with-single-library=0',
24213c392dSSatish Balay    '--with-visibility=1',
25ef153486SSatish Balay    '--download-hpddm',
26d7609944SJacob Faibussowitsch    # 28/02/2023, nvc/nvc++ would produce strange segmentation violation errors in C++20
27d7609944SJacob Faibussowitsch    # mode that could not be reproduced with any other compiler. Normally the first
28d7609944SJacob Faibussowitsch    # response would be 'there must be a bug in the code' -- and that may still be true --
29d7609944SJacob Faibussowitsch    # but no less than 3 other CI jobs reproduce the same package/env without these seg
30d7609944SJacob Faibussowitsch    # faults. So limiting to C++17 because maybe it *is* the compilers fault this time.
31d7609944SJacob Faibussowitsch    '--with-cxx-dialect=17',
32213c392dSSatish Balay    # Note: If using nvcc with a host compiler other than the CUDA SDK default for your platform (GCC on Linux, clang
33213c392dSSatish Balay    # on Mac OS X, MSVC on Windows), you must set -ccbin appropriately in CUDAFLAGS, as in the example for PGI below:
34213c392dSSatish Balay    # 'CUDAFLAGS=-ccbin pgc++',
35689a5dfaSJacob Faibussowitsch    '--with-strict-petscerrorcode',
36213c392dSSatish Balay  ]
37213c392dSSatish Balay
38213c392dSSatish Balay  configure.petsc_configure(configure_options)
39