1#!/usr/bin/env python 2 3import os 4petsc_hash_pkgs=os.path.join(os.getenv('HOME'),'petsc-hash-pkgs') 5if not os.path.isdir(petsc_hash_pkgs): os.mkdir(petsc_hash_pkgs) 6 7# find the ifort libs location 8import os 9import distutils.spawn 10ifort_lib_dir=os.path.join(os.path.dirname(os.path.dirname(distutils.spawn.find_executable('ifort'))),'lib','intel64') 11mpich_install_dir='/homes/petsc/soft/linux-Ubuntu_14.04-x86_64/mpich-3.2-gcc-ifc' 12mpich_lib_dir=os.path.join(mpich_install_dir,'lib') 13 14configure_options = [ 15 '--package-prefix-hash='+petsc_hash_pkgs, 16 # cannot use download-mpich with fortranlib-autodetect=0 so disabling 17 #'--with-cc=gcc', 18 #'--with-fc=ifort', 19 #'--with-cxx=g++', 20 #'--download-mpich=1', 21 #'--download-mpich-pm=gforker', 22 '--with-mpi-dir='+mpich_install_dir, 23 24 'LIBS=-L'+ifort_lib_dir+' -lifcore -ldl -limf -lirc -L'+mpich_lib_dir+' -lmpifort -lmpi', 25 26 'COPTFLAGS=-g -O', 27 'FOPTFLAGS=-g -O', 28 'CXXOPTFLAGS=-g -O', 29 30 '--with-scalar-type=complex', 31 '--download-hdf5', 32 '--with-zlib=1', 33 '--download-fblaslapack=1' 34 ] 35 36if __name__ == '__main__': 37 import sys,os 38 sys.path.insert(0,os.path.abspath('config')) 39 import configure 40 configure.petsc_configure(configure_options) 41