1#!/usr/bin/env python3 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 (in addition to a Python module!) 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-make-np=8', # Must limit size of parallel build on Summit login nodes to be within resource quota imposed by OLCF. 20 21 '--with-shared-libraries=1', 22 23 ############################################################ 24 # Specify compiler optimization flags. 25 ############################################################ 26 27 # The GCC, PGI, and IBM XL compilers are supported on Summit. 28 # Make sure that the correct compiler suite module is loaded, 29 # module load gcc, pgi, or xl 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 # Note: ESSL does not provide all functions used by PETSc, so we link netlib LAPACK as well. 58 # On ORNL's Summit, one must 'module load' both the essl AND netlib-lapack modules: 59 '--with-blaslapack-lib=-L' + os.environ['OLCF_ESSL_ROOT'] + '/lib64 -lessl -llapack -lessl', 60 61 # An alternative in case of difficulty with ESSL is to download/build a portable implementation such as: 62 #'--download-fblaslapack=1', 63 #'--download-f2cblaslapack', '--download-blis', 64 65 ############################################################ 66 # Enable GPU support through CUDA/CUSPARSE and ViennaCL. 67 ############################################################ 68 69 '--with-cuda=1', 70 '--with-cudac=nvcc', 71 # nvcc requires the user to specify host compiler name via "-ccbin" when using non-GCC compilers: 72 'CUDAFLAGS=-ccbin pgc++', # For PGI 73 #'CUDAFLAGS=-ccbin xlc++_r', # For IBM XL 74 75 '--download-viennacl=1', 76 77 ############################################################ 78 # Now specify some commonly used optional packages. 79 ############################################################ 80 81 '--with-hdf5-dir=' + os.environ['OLCF_HDF5_ROOT'], # 'module load hdf5' to use the OLCF-provided build 82 '--download-metis=1', 83 '--download-parmetis=1', 84 '--download-triangle=1', 85 '--download-ctetgen=1', 86 87 # The options below do not work with the IBM XL compilers. 88 # Trying to use the OLCF-provided 'hypre' module also does not work. 89 '--download-hypre=1', 90 '--download-ml=1', 91 92 ] 93 configure.petsc_configure(configure_options) 94