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 19 '--with-shared-libraries=1', 20 21 ############################################################ 22 # Specify compiler optimization flags. 23 ############################################################ 24 25 # The GCC, PGI, and IBM XL compilers are supported on Summit. 26 # Make sure that the correct compiler suite module is loaded, 27 # and then comment/uncomment the appropriate stanzas below. 28 # For optimized cases, more aggressive compilation flags can be tried, 29 # but the examples below provide a reasonable start. 30 31 # If a debug build is desired, use the following for any of the compilers: 32 #'--with-debugging=yes', 33 #'COPTFLAGS=-g', 34 #'CXXOPTFLAGS=-g', 35 #'FOPTFLAGS=-g', 36 37 # For production builds, disable PETSc debugging support: 38 '--with-debugging=no', 39 40 # Optimized flags for PGI: 41 'COPTFLAGS=-g -fast', 42 'CXXOPTFLAGS=-g -fast', 43 'FOPTFLAGS=-g -fast', 44 45 # Optimized flags for XL or GCC: 46 #'--COPTFLAGS=-g -Ofast -mcpu=power9', 47 #'--CXXOPTFLAGS=-g -Ofast -mcpu=power9', 48 #'--FOPTFLAGS=-g -Ofast -mcpu=power9', 49 50 ############################################################ 51 # Specify BLAS and LAPACK. 52 ############################################################ 53 54 # With GCC and PGI compilers, can download and build: 55 '--download-fblaslapack=1', 56 57 # Download and build does not work with the XL compilers. 58 # For this case, use ESSL. (ESSL does *not* work for builds with GCC and PGI.) 59 # Note that ESSL does not provide some of the LAPACK functions required by PETSc! 60 # On ORNL's Summit, one must 'module load' both the essl AND netlib-lapack modules: 61 #'--with-blaslapack-lib=-L' + os.environ['OLCF_ESSL_ROOT'] + '/lib64 -lessl -llapack', 62 63 ############################################################ 64 # Enable GPU support through CUDA/CUSPARSE and ViennaCL. 65 ############################################################ 66 67 '--with-cuda=1', 68 '--with-cudac=nvcc', 69 # nvcc reqires the user to specify host compiler name via "-ccbin" when using non-GCC compilers: 70 'CUDAFLAGS=-ccbin pgc++', # For PGI 71 #'CUDAFLAGS=-ccbin xlc++_r', # For IBM XL 72 73 '--download-viennacl=1', 74 75 ############################################################ 76 # Now specify some commonly used optional packages. 77 ############################################################ 78 79 '--with-hdf5-dir=' + os.environ['OLCF_HDF5_ROOT'], # 'module load hdf5' to use the OLCF-provided build 80 '--download-metis=1', 81 '--download-parmetis=1', 82 '--download-triangle=1', 83 '--download-ctetgen=1', 84 85 # The below options do not work with the IBM XL compilers. 86 # Trying to use the OLCF-provided 'hypre' module also does not work. 87 '--download-hypre=1', 88 '--download-ml=1', 89 90 ] 91 configure.petsc_configure(configure_options) 92