diff --git a/bin/installexternal.py b/bin/installexternal.py new file mode 100755 index 0000000000000000000000000000000000000000..09ec3858eee22312f9465f8f1315a0b19eb7bc4b --- /dev/null +++ b/bin/installexternal.py @@ -0,0 +1,334 @@ +#!/usr/bin/env python3 + +""" +install external stuff for dumux +""" +import os +import urllib.request +import tarfile +import sys +import subprocess +import shutil +import re +import argparse + +class ChoicesAction(argparse._StoreAction): + def __init__(self, **kwargs): + super(ChoicesAction, self).__init__(**kwargs) + if self.choices is None: + self.choices = [] + self._choices_actions = [] + def add_choice(self, choice, help=''): + self.choices.append(choice) + choice_action = argparse.Action(option_strings=[], dest=choice, help=help) + self._choices_actions.append(choice_action) + def _get_subactions(self): + return self._choices_actions + +def show_message(message): + print("*" * 120) + print(message) + print("") + print("*" * 120) + + +if len(sys.argv) == 1: + show_message('No options given. For more information run the following command: \n ./installexternal.py --help') + sys.exit() + +parser = argparse.ArgumentParser(prog='installexternal', + usage='./installexternal.py [OPTIONS] PACKAGES', + description='This script downloads extenstions for dumux and dune \ + and installs some External Libraries and Modules.') +parser.register('action', 'store_choice', ChoicesAction) +# Positional arguments +group = parser.add_argument_group(title='your choice of packages') +packages = group.add_argument('packages', nargs='+', metavar='PACKAGES', + action='store_choice') +packages.add_choice('dumux-extensions', help="Download dumux-course and dumux-lecture.") +packages.add_choice('dune-extensions', help="Download dune-uggrid, dune-alugrid, dune-foamgrid, \ + dune-subgrid, dune-spgrid, dune-mmesh and dune-functions.") +packages.add_choice('optimization', help="Download and install glpk and nlopt.") +packages.add_choice('others', help="Download and install opm , metis and gstat.") +packages.add_choice('lecture', help="Download dumux-lecture.") +packages.add_choice('course', help="Download dumux-course.") +packages.add_choice('ug', help="Download dune-uggrid.") +packages.add_choice('alugrid', help="Download dune-alugrid.") +packages.add_choice('foamgrid', help="Download dune-foamgrid.") +packages.add_choice('subgrid', help="Download dune-subgrid.") +packages.add_choice('spgrid', help="Download dune-spgrid.") +packages.add_choice('mmesh', help="Download dune-mmesh.") +packages.add_choice('functions', help="Download dune-functions.") +packages.add_choice('glpk', help="Download and install glpk.") +packages.add_choice('nlopt', help="Download and install nlopt.") +packages.add_choice('opm', help="Download opm modules required for cornerpoint grids.") +packages.add_choice('metis', help="Download and install the METIS graph partitioner.") +packages.add_choice('gstat', help="Download and install gstat.") + + +# Optional arguments +options = parser.add_mutually_exclusive_group(required=False) +options.add_argument('--clean', action="store_true", default=False, + help='Delete all files for the given packages.') +options.add_argument('--download', action="store_true", default=False, + help='Only download the packages.') + +parser.add_argument('--dune_branch', default="releases/2.7", + help='Dune branch to be checked out.') +parser.add_argument('--dumux_branch', default="releases/3.3", + help='Dumux branch to be checked out.') +parser.add_argument('--opm_branch', default="release/2020.10", + help='Opm branch to be checked out.') +parser.add_argument('--mmesh_branch', default="release/1.2", + help='Mmesh branch to be checked out.') + +args = vars(parser.parse_args()) + +def run_command(command, currentdir='.'): + with open(currentdir+"/installexternal.log", "a") as log: + popen = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) + for line in popen.stdout: + log.write(line) + print(line, end='') + for line in popen.stderr: + log.write(line) + print(line, end='') + popen.stdout.close() + popen.stderr.close() + return_code = popen.wait() + if return_code: + print("\n") + message = "\n (Error) The command {} returned with non-zero exit code\n".format(command) + message += "\n If you can't fix the problem yourself consider reporting your issue\n" + message += " on the mailing list (dumux@listserv.uni-stuttgart.de) and attach the file 'installexternal.log'\n" + show_message(message) + sys.exit(1) + +def git_clone(url, branch=None): + clone = ["git", "clone"] + if branch: + clone += ["-b", branch] + result = run_command(command=[*clone, url]) + +def install_external(args): + dune_branch = args['dune_branch'] + dumux_branch = args['dumux_branch'] + opm_branch = args['opm_branch'] + mmesh_branch = args['mmesh_branch'] + packages = args['packages'] + cleanup = args['clean'] + download = args['download'] + + final_message = [] + top_dir = os.getcwd() + ext_dir = top_dir + "/external" + + + # Prepare a list of packages + packages = [] + for pkg in args['packages']: + if pkg in packagenames: + packages.extend(packagenames[pkg]) + else: + packages.extend([key for key in external_urls.keys() if pkg in key]) + args['packages'] = packages + + # print the list of packages to be downloaded/installed/removed + print("The following package(s) will be {0}:\n".format('removed' if cleanup else 'downloaded'), ', '.join(args['packages']), "\n") + + # check Location For DuneModules + if not os.path.isdir("dune-common"): + show_message( + "You have to call " + sys.argv[0] + " for " + sys.argv[1] + " from\n" + "the same directory in which dune-common is located.\n" + "You cannot install it in this folder.") + return + + # clear the log file + logdir = ext_dir if os.path.exists(ext_dir) else top_dir + open(logdir+'/installexternal.log', 'w').close() + + for package in packages: + os.chdir(top_dir) + # Package name for final message + final_message.append('[---'+package+'---]') + + # Set the directory: create ext_dir for external packages + if not any([re.compile(p).match(package) for p in ['dumux','dune', 'opm']]): + os.makedirs(ext_dir, exist_ok=True) + os.chdir(ext_dir) + + # Set the branch + if 'dumux' in package: + branch = dumux_branch + elif 'mmesh' in package: + branch = mmesh_branch + elif 'dune' in package: + branch = dune_branch + elif 'opm' in package: + branch = opm_branch + + # Run the requested command + if cleanup: + if os.path.isfile(package + '.tar.gz'): + os.remove(package + '.tar.gz') + if os.path.exists(package): + # Remove + shutil.rmtree(package) + + # Save message to be shown at the end + final_message.append("{} has been removed.".format(package)) + else: + # Save message to be shown at the end + final_message.append("The folder {} does not exist.".format(package)) + continue + + else: + # Check if tarball + tarball = external_urls[package].endswith('tar.gz') + + if not os.path.exists(package): + + if tarball: + + # Download the tarfile + filedata = urllib.request.urlopen(external_urls[package]) + datatowrite = filedata.read() + + with open(ext_dir + "/" + package +".tar.gz", 'wb') as f: + f.write(datatowrite) + # Save message to be shown at the end + final_message.append("{} has been sucessfully downloaded.".format(package)) + + # Start Installation if the flag download is set to false. + if not download: + # Extract + tf = tarfile.open(package+".tar.gz") + tf.extractall() + + # Rename + shutil.move(os.path.commonprefix(tf.getnames()), package) + + # Start the configuration + os.chdir(ext_dir + "/"+package) + if package == 'gstat': + with open('configure', 'r+') as f: + content = f.read() + f.seek(0) + f.truncate() + f.write(content.replace('doc/tex/makefile', '')) + + # Run Configuration command + configcmd = "./configure" if package != 'metis' else ["make", "config"] + run_command(configcmd, currentdir=ext_dir) + try: + run_command("make", currentdir=ext_dir) + except: + raise Exception("{} installation has failed.".format(package)) + # Save message to be shown at the end + if os.path.exists(ext_dir+ "/" + package): + final_message.append("{} has been successfully installed.".format(package)) + + else: + # Clone from repo + git_clone(external_urls[package], branch) + # Save message to be shown at the end + final_message.append("{} has been sucessfully cloned.".format(package)) + else: + if tarball: + final_message.append("{} has been already installed.".format(package)) + else: + # Checkout to the requested branch + os.chdir(top_dir + '/' + package) + subprocess.Popen(["git", "checkout", branch]) + # Save message to be shown at the end + final_message.append("-- Skip cloning {}, because the folder already exists.".format(package)) + final_message.append("-- Checking out {} ".format(package) + branch) + continue + + # Save post installation message if there is any. + if package in messages.keys(): + final_message.extend(messages[package]) + + # Change to top_dir + os.chdir(top_dir) + + # Save post installation message about dunecontrol if need be. + if not cleanup and any(x in pkg for pkg in packages for x in ["dumux","dune","opm"]): + final_message.append("\n\nPlease run the following command (can be copied to command line):\n\n ./dune-common/bin/dunecontrol --opts=./dumux/cmake.opts all") + + # If cleanup and only logfile in the external directory, remove the directory + if os.path.isdir(ext_dir): + _, _, files = next(os.walk(ext_dir)) + if cleanup and len(files)==1 and 'installexternal.log' in files: + shutil.rmtree(ext_dir) + + return '\n'.join(final_message) + +################################################################# +################################################################# +## (1/3) Define th necessary packages and their urls +################################################################# +################################################################# +dune_git_baseurl = "https://gitlab.dune-project.org/" +dumux_git_baseurl = "https://git.iws.uni-stuttgart.de/dumux-repositories/" +external_urls = { + "dumux-lecture": dumux_git_baseurl + "dumux-lecture.git", + "dumux-course": dumux_git_baseurl + "dumux-course.git", + "dune-uggrid": dune_git_baseurl + "/staging/dune-uggrid.git", + "dune-alugrid": dune_git_baseurl + "extensions/dune-alugrid.git", + "dune-foamgrid": dune_git_baseurl + "extensions/dune-foamgrid.git", + "dune-subgrid": "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid.git", + "dune-spgrid": dune_git_baseurl + "extensions/dune-spgrid.git", + "dune-mmesh": dune_git_baseurl + "samuel.burbulla/dune-mmesh.git", + "dune-functions": dune_git_baseurl + "staging/dune-functions.git", + "dune-typetree": dune_git_baseurl + "staging/dune-typetree.git", + "glpk": "http://ftp.gnu.org/gnu/glpk/glpk-4.60.tar.gz", + "nlopt": "http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz", + "opm-common": "https://github.com/OPM/opm-common", + "opm-grid": "https://github.com/OPM/opm-grid", + "metis": "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz", + "gstat": "http://gstat.org/gstat.tar.gz", +} + +packagenames = { + "dumux-extensions": ["dumux-lecture", "dumux-course"], + "dune-extensions": ["dune-uggrid", "dune-alugrid", "dune-foamgrid", + "dune-subgrid", "dune-spgrid", "dune-mmesh", + "dune-functions", "dune-typetree"], + "functions": ["dune-functions", "dune-typetree"], + "optimization": ["glpk", "nlopt"], + "others": ["opm-common", "opm-grid", "metis", "gstat"] +} + +messages ={ + 'glpk': ["In addition, it might be necessary to set manually", + "the glpk path in the CMAKE_FLAGS section of the .opts-file:", + " -DGLPK_ROOT=/path/to/glpk \\"], + 'dune-mmesh': ["Maybe you also have to install CGAL", + "(see cgal.org/download.html)", "Maybe you also need to change your core dune modules' branches to their newest versions."], + 'opm-common': ["In addition, it might be necessary to set manually some", + "CMake variables in the CMAKE_FLAGS section of the .opts-file:", + " -DUSE_MPI=ON", + "Currently, compiling opm with clang is not possible.", "", + "Maybe you also have to install the following packages (see the", + " opm prerequisites at opm-project.org):", + " BLAS, LAPACK, Boost, SuiteSparse, Zoltan"] +} + + +################################################################# +################################################################# +## (2/3) Download/Config/Clean the requested packages +################################################################# +################################################################# +# Start download/configuration/cleaning tasks +final_message = install_external(args) + +################################################################# +################################################################# +## (3/3) Show the final message +################################################################# +################################################################# +# Show final message +show_message(final_message) diff --git a/bin/installexternal.sh b/bin/installexternal.sh deleted file mode 100755 index 5e8e37a164c63792ecd459c163d50102c2652ac9..0000000000000000000000000000000000000000 --- a/bin/installexternal.sh +++ /dev/null @@ -1,585 +0,0 @@ -#!/bin/bash - -CORRECT_LOCATION_FOR_DUNE_MODULES="n" -ENABLE_MPI="n" -ENABLE_DEBUG="n" -ENABLE_PARALLEL="n" -CLEANUP="n" -DOWNLOAD_ONLY="n" - -TOPDIR=$(pwd) -EXTDIR=$(pwd)/external - -DUMUX_VERSION=3.2 - -checkLocationForDuneModules() -{ - # test for directory dune-common, dune-common-2.4 etc. - if ! ls dune-common* &> /dev/null; then - echo "You have to call $0 for $1 from" - echo "the same directory in which dune-common is located." - echo "You cannot install it in this folder." - CORRECT_LOCATION_FOR_DUNE_MODULES="n" - return - fi - CORRECT_LOCATION_FOR_DUNE_MODULES="y" -} - -createExternalDirectory() -{ - if [ ! -e $EXTDIR ]; then - mkdir -v $EXTDIR - fi -} - -installAluGrid() -{ - cd $TOPDIR - - checkLocationForDuneModules dune-alugrid - if test $CORRECT_LOCATION_FOR_DUNE_MODULES == "n"; then - return - fi - - if [ ! -e dune-alugrid ]; then - git clone -b releases/2.4 https://gitlab.dune-project.org/extensions/dune-alugrid.git - fi - - if test "$DOWNLOAD_ONLY" == "y"; then - return - fi - - if test "$CLEANUP" == "y"; then - rm -rf dune-alugrid - return - fi -} - -installCourse() -{ - cd $TOPDIR - if [ ! -d "dumux-course" ]; then - git clone -b releases/$DUMUX_VERSION https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course.git - else - echo "Skip cloning dumux-course because the folder already exists." - cd dumux-course - git checkout releases/$DUMUX_VERSION - cd .. - fi -} - -installFoamGrid() -{ - cd $TOPDIR - - checkLocationForDuneModules dune-foamgrid - if test $CORRECT_LOCATION_FOR_DUNE_MODULES == "n"; then - return - fi - - if [ ! -e dune-foamgrid ]; then - git clone -b releases/2.4 https://gitlab.dune-project.org/extensions/dune-foamgrid.git - fi - - if test "$DOWNLOAD_ONLY" == "y"; then - return - fi - - if test "$CLEANUP" == "y"; then - rm -rf dune-foamgrid - return - fi -} - -installGLPK() -{ - cd $EXTDIR - rm -rf glpk* standalone - - if [ ! -e glpk-4.60.tar.gz ]; then - wget http://ftp.gnu.org/gnu/glpk/glpk-4.60.tar.gz - fi - - if test "$DOWNLOAD_ONLY" == "y"; then - return - fi - - if test "$CLEANUP" == "y"; then - rm -rf glpk - return - fi - - mkdir glpk - tar zxvf glpk-4.60.tar.gz --strip-components=1 -C glpk - cd glpk - - ./configure - make - - # show additional information - echo "In addition, it might be necessary to set manually" - echo "the glpk path in the CMAKE_FLAGS section of the .opts-file:" - echo " -DGLPK_ROOT=/path/to/glpk \\" - - cd $TOPDIR -} - -installGStat() -{ - cd $EXTDIR - rm -rf gstat* standalone - - if [ ! -e gstat.tar.gz ]; then - wget http://gstat.org/gstat.tar.gz - fi - - if test "$DOWNLOAD_ONLY" == "y"; then - return - fi - - mkdir gstat - tar zxvf gstat.tar.gz --strip-components=1 -C gstat - cd gstat - - sed -i 's# doc/tex/makefile##g' configure - ./configure - make - - if [ -e $PWD/src/gstat ]; then - echo "Successfully installed gstat." - fi -} - -installLecture() -{ - cd $TOPDIR - if [ ! -d "dumux-lecture" ]; then - git clone -b releases/$DUMUX_VERSION https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-lecture.git - else - echo "Skip cloning dumux-lecture because the folder already exists." - cd dumux-lecture - git checkout releases/$DUMUX_VERSION - cd .. - fi -} - -installMETIS() -{ - cd $EXTDIR - - if [ ! -e metis-5.1.0.tar.gz ]; then - wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz - fi - - if test "$DOWNLOAD_ONLY" == "y"; then - return - fi - - if test "$CLEANUP" == "y"; then - rm -rf metis-5.1.0 - return - fi - - if ! test -e "metis-5.1.0"; then - tar zxvf metis-5.1.0.tar.gz - fi - - cd metis-5.1.0 - METISDIR=$(pwd) - make config - make - - cd $TOPDIR -} - -installMultidomain() -{ - cd $TOPDIR - - checkLocationForDuneModules dune-multidomain - if test $CORRECT_LOCATION_FOR_DUNE_MODULES == "n"; then - return - fi - - if [ ! -e dune-multidomain ]; then - git clone -b releases/2.0 git://github.com/smuething/dune-multidomain.git - fi - - if test "$DOWNLOAD_ONLY" == "y"; then - return - fi - - if test "$CLEANUP" == "y"; then - rm -rf dune-multidomain - return - fi - - cd $TOPDIR -} - -installMultidomainGrid() -{ - cd $TOPDIR - - checkLocationForDuneModules dune-multidomaingrid - if test $CORRECT_LOCATION_FOR_DUNE_MODULES == "n"; then - return - fi - - if [ ! -e dune-multidomaingrid ]; then - git clone -b releases/2.3 git://github.com/smuething/dune-multidomaingrid.git - fi - - if test "$DOWNLOAD_ONLY" == "y"; then - return - fi - - if test "$CLEANUP" == "y"; then - rm -rf dune-multidomaingrid - return - fi - - cd $TOPDIR -} - -installNLOPT() -{ - cd $EXTDIR - rm -rf nlopt* standalone - - if [ ! -e nlopt-2.4.2.tar.gz ]; then - wget http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz - fi - - if test "$DOWNLOAD_ONLY" == "y"; then - return - fi - - if test "$CLEANUP" == "y"; then - rm -rf nlopt - return - fi - - mkdir nlopt - tar zxvf nlopt-2.4.2.tar.gz --strip-components=1 -C nlopt - cd nlopt - - ./configure - make - - # show additional information - echo "In addition, it might be necessary to set manually" - echo "the nlopt path in the CMAKE_FLAGS section of the .opts-file:" - echo " -DNLOPT_ROOT=/path/to/nlopt \\" - - cd $TOPDIR -} - -installOPM() -{ - cd $TOPDIR - - checkLocationForDuneModules opm - if test $CORRECT_LOCATION_FOR_DUNE_MODULES == "n"; then - return - fi - - if [ ! -e opm-common ]; then - git clone -b release/2020.04 https://github.com/OPM/opm-common - cd $TOPDIR - fi - - if [ ! -e opm-grid ]; then - git clone -b release/2020.04 https://github.com/OPM/opm-grid - cd $TOPDIR - fi - - if test "$DOWNLOAD_ONLY" == "y"; then - return - fi - - if test "$CLEANUP" == "y"; then - rm -rf opm-common - rm -rf opm-grid - return - fi - - # show additional information - echo "In addition, it might be necessary to set manually some" - echo "CMake variables in the CMAKE_FLAGS section of the .opts-file:" - echo " -DUSE_MPI=ON" - - # show some opm prerequisites - echo "Maybe you also have to install the following packages (see the opm prerequisites at opm-project.org): " - echo " BLAS, LAPACK, Boost, SuiteSparse, Zoltan" - - cd $TOPDIR -} - -installPDELab() -{ - cd $TOPDIR - - checkLocationForDuneModules dune-pdelab - if test $CORRECT_LOCATION_FOR_DUNE_MODULES == "n"; then - return - fi - - if [ ! -e dune-pdelab ]; then - git clone -b releases/2.0 https://gitlab.dune-project.org/pdelab/dune-pdelab.git - fi - - if test "$DOWNLOAD_ONLY" == "y"; then - return - fi - - if test "$CLEANUP" == "y"; then - rm -rf dune-pdelab - return - fi - - cd $TOPDIR -} - -installTypeTree() -{ - cd $TOPDIR - - checkLocationForDuneModules dune-typetree - if test $CORRECT_LOCATION_FOR_DUNE_MODULES == "n"; then - return - fi - - if [ ! -e dune-typetree ]; then - git clone -b releases/2.3 https://gitlab.dune-project.org/staging/dune-typetree.git - fi - - if test "$DOWNLOAD_ONLY" == "y"; then - return - fi - - if test "$CLEANUP" == "y"; then - rm -rf dune-typetree - return - fi - - cd $TOPDIR -} - -installUG() -{ - cd $EXTDIR - - UG_VERSION="3.12.1" - if [ ! -e ug-$UG_VERSION ]; then - git clone -b v$UG_VERSION https://gitlab.dune-project.org/staging/dune-uggrid.git ug-$UG_VERSION - fi - - if test "$DOWNLOAD_ONLY" == "y"; then - return - fi - - if test "$CLEANUP" == "y"; then - rm -rf ug-$UG_VERSION - return - fi - - # Apply patch for the parallel use of UG - cd $TOPDIR/dune-grid - DUNE_GRID_VERSION=`git status | head -n 1 | awk '{ print $3 }'` - if [ "$DUNE_GRID_VERSION" == "releases/2.3.1" ] && [ "$ENABLE_PARALLEL" == "y" ]; then - echo "Applying patch for the parallel use of UG" - patch -p1 < $TOPDIR/dumux/patches/grid-2.3.1.patch - fi - - cd $EXTDIR/ug-$UG_VERSION - autoreconf -is - OPTIM_FLAGS="-O3 -DNDEBUG -march=native -finline-functions -funroll-loops" - # debug flags - if test "$ENABLE_DEBUG" == "y"; then - OPTIM_FLAGS="-O0 -g2" - fi - CFLAGS="$OPTIM_FLAGS" - CXXFLAGS="$OPTIM_FLAGS -std=c++0x -fno-strict-aliasing" - OPTS="--enable-dune --prefix=$PWD" - - if test "$ENABLE_MPI" == "y"; then - OPTS="$OPTS --enable-parallel MPICC=$MPICXX" - else - OPTS="$OPTS --without-mpi" - fi - - ./configure \ - CFLAGS="$CFLAGS" \ - CXXFLAGS="$CXXFLAGS" \ - $OPTS - - make - make install - - sed -i "s#-DUG_DIR=.*#-DUG_DIR=$EXTDIR/ug-$UG_VERSION \\\\#g" $TOPDIR/dumux/*.opts - cd $TOPDIR -} - -usage() -{ - echo "Usage: $0 [OPTIONS] PACKAGES" - echo "" - echo "Where PACKAGES is one or more of the following" - echo " all Install everything and the kitchen sink." - echo " alugrid Download dune-alugrid." - echo " course Download the dumux-course." - echo " foamgrid Download dune-foamgrid." - echo " glpk Download and install glpk." - echo " gstat Download and install gstat." - echo " lecture Download the dumux-lecture." - echo " metis Install the METIS graph partitioner." - echo " multidomain Download dune-multidomain." - echo " multidomaingrid Download and patch dune-multidomaingrid." - echo " nlopt Download and install nlopt." - echo " opm Download opm modules required for cornerpoint grids." - echo " pdelab Download dune-pdelab." - echo " typetree Download dune-typetree." - echo " ug Install the UG grid library." - echo "" - echo "The following options are recoginzed:" - echo " --parallel Enable parallelization if available." - echo " --debug Compile with debugging symbols and without optimization." - echo " --clean Delete all files for the given packages." - echo " --download Only download the packages." -} - -SOMETHING_DONE="n" -for TMP in "$@"; do - TMP=$(echo "$TMP" | tr "[:upper:]" "[:lower:]") - case $TMP in - "--debug") - ENABLE_DEBUG="y" - ;; - "--download") - DOWNLOAD_ONLY="y" - ;; - "--parallel") - ENABLE_PARALLEL="y" - ENABLE_MPI="y" - MPICC=$(which mpicc) - MPICXX=$(which mpicxx) - MPIF77=$(which mpif77) - - if test -f $TOPDIR'/dune-common/bin/mpi-config'; then - MPICONFIG=$TOPDIR'/dune-common/bin/mpi-config' - else - echo "MPICONFIG not found!" - return - fi - - MPILIBS=$($MPICONFIG --libs) - MPILIBDIR=$(echo $MPILIBS | sed "s/.*-L\([^[:blank:]]*\).*/\1/") - - # consistency check - if test "$ENABLE_MPI" == "y" -a -z "$MPICXX"; then - echo "" - echo "Compiler mpicxx not found although ENABLE_MPI is set in this script!" - echo "Please make sure that your MPI environment is set up or that you turn it off." - echo "The shell command mpi-selector may help you to select an installed mpi-version." - echo "Reinitilize your PATH variable after using it (e.g. logout and login again)." - echo "Due to this error this script stops further building now." - echo "" - - exit -1 - fi - - ;; - "--clean") - CLEANUP="y" - ;; - all) - SOMETHING_DONE="y" - createExternalDirectory - installAluGrid - installCourse - installFoamGrid - installGLPK - installGStat - installLecture - installMETIS - installMultidomain - installMultidomainGrid - installNLOPT - installOPM - installPDELab - installTypeTree - installUG - ;; - alugrid|dune-alugrid) - SOMETHING_DONE="y" - installAluGrid - ;; - course) - SOMETHING_DONE="y" - installCourse - ;; - foamgrid|dune-foamgrid) - SOMETHING_DONE="y" - installFoamGrid - ;; - glpk) - SOMETHING_DONE="y" - createExternalDirectory - installGLPK - ;; - gstat) - SOMETHING_DONE="y" - createExternalDirectory - installGStat - ;; - lecture) - SOMETHING_DONE="y" - installLecture - ;; - metis) - SOMETHING_DONE="y" - createExternalDirectory - installMETIS - ;; - multidomain|dune-multidomain) - SOMETHING_DONE="y" - installMultidomain - ;; - multidomaingrid|dune-multidomaingrid) - SOMETHING_DONE="y" - installMultidomainGrid - ;; - nlopt) - SOMETHING_DONE="y" - createExternalDirectory - installNLOPT - ;; - opm) - SOMETHING_DONE="y" - installOPM - ;; - pdelab|dune-pdelab) - SOMETHING_DONE="y" - installPDELab - ;; - typetree|dune-typetree) - SOMETHING_DONE="y" - installTypeTree - ;; - ug) - SOMETHING_DONE="y" - createExternalDirectory - installUG - ;; - *) - usage - exit 1 - esac - cd $TOPDIR -done - -if test "$SOMETHING_DONE" != "y"; then - usage - exit 1; -fi diff --git a/cmake.opts b/cmake.opts index de36f45777d11d9586a27a754559cebd02bf77a5..540cfb464f9cc8cd6f4d21cae36c0765599d4bc8 100644 --- a/cmake.opts +++ b/cmake.opts @@ -36,7 +36,6 @@ OPM_FLAGS="" # to build opm it might be necessary to set manually the following variables (comment the above line) #OPM_FLAGS=" #-DUSE_MPI=ON -#-DOPM_CLANG_WITH_STDC++FS=ON #" # set this to "ON" if you want to be able to have the headercheck target