1#!/usr/bin/python 2 3# Example configure script for the IBM POWER9 and NVIDIA Volta GV100 "Summit" system at OLCF/ORNL. 4# This may also be useful for the related Sierra system at LLNL, or other, similar systems that may appear. 5# A compiler module and the 'cmake' and 'cuda' modules should be loaded on Summit. 6# See inline comments below on other modules that might need to be loaded. 7 8if __name__ == '__main__': 9 import os 10 import sys 11 sys.path.insert(0, os.path.abspath('config')) 12 import configure 13 configure_options = [ 14 # We use the IBM Spectrum MPI compiler wrappers, regardless of the underlying compilers used. 15 '--with-cc=mpicc', 16 '--with-cxx=mpiCC', 17 '--with-fc=mpifort', 18 # The IBM XL Fortran compilers are currently not working with PETSc. 19 # For XL compilers, can disable Fortran as below: 20 #'--with-fc=0', 21 22 '--with-shared-libraries=1', 23 24 ############################################################ 25 # Specify compiler optimization flags. 26 ############################################################ 27 28 # The GCC, PGI, and IBM XL compilers are supported on Summit. 29 # Make sure that the correct compiler suite module is loaded, 30 # and then comment/uncomment the appropriate stanzas below. 31 # For optimized cases, more aggressive compilation flags can be tried, 32 # but the examples below provide a reasonable start. 33 34 # If a debug build is desired, use the following for any of the compilers: 35 #'--with-debugging=yes', 36 #'COPTFLAGS=-g', 37 #'CXXOPTFLAGS=-g', 38 #'FOPTFLAGS=-g', 39 40 # For production builds, disable PETSc debugging support: 41 '--with-debugging=no', 42 43 # Optimized flags for PGI: 44 'COPTFLAGS=-g -fast', 45 'CXXOPTFLAGS=-g -fast', 46 'FOPTFLAGS=-g -fast', 47 48 # Optimized flags for XL or GCC: 49 #'--COPTFLAGS=-g -Ofast -mcpu=power9', 50 #'--CXXOPTFLAGS=-g -Ofast -mcpu=power9', 51 #'--FOPTFLAGS=-g -Ofast -mcpu=power9', 52 53 ############################################################ 54 # Specify BLAS and LAPACK. 55 ############################################################ 56 57 # With GCC and PGI compilers, can download and build: 58 '--download-fblaslapack=1', 59 60 # Download and build does not work with the XL compilers. 61 # For this case, use ESSL. (ESSL does *not* work for builds with GCC and PGI.) 62 # Note that ESSL does not provide some of the LAPACK functions required by PETSc! 63 # On ORNL's Summit, one must 'module load' both the essl AND netlib-lapack modules: 64 #'--with-blaslapack-lib=-L' + os.environ['OLCF_ESSL_ROOT'] + '/lib64 -lessl -llapack', 65 66 ############################################################ 67 # Enable GPU support through CUDA/CUSPARSE and ViennaCL. 68 ############################################################ 69 70 '--with-cuda=1', 71 '--with-cudac=nvcc', 72 # nvcc reqires the user to specify host compiler name via "-ccbin" when using non-GCC compilers: 73 'CUDAFLAGS=-ccbin pgc++', # For PGI 74 #'CUDAFLAGS=-ccbin xlc++_r', # For IBM XL 75 76 '--download-viennacl=1', 77 78 ############################################################ 79 # Now specify some commonly used optional packages. 80 ############################################################ 81 82 '--with-hdf5-dir=' + os.environ['OLCF_HDF5_ROOT'], # 'module load hdf5' to use the OLCF-provided build 83 '--download-metis=1', 84 '--download-parmetis=1', 85 '--download-triangle=1', 86 '--download-ctetgen=1', 87 88 # The below options do not work with the IBM XL compilers. 89 # Trying to use the OLCF-provided 'hypre' module also does not work. 90 '--download-hypre=1', 91 '--download-ml=1', 92 93 ] 94 configure.petsc_configure(configure_options) 95