Skip to content

Commit

Permalink
Merge pull request #116 from Libensemble/release/v0.4.1
Browse files Browse the repository at this point in the history
Release/v0.4.1
  • Loading branch information
jmlarson1 committed Feb 21, 2019
2 parents 09d30c7 + 988b39c commit 22286ad
Show file tree
Hide file tree
Showing 59 changed files with 1,690 additions and 370 deletions.
19 changes: 10 additions & 9 deletions .travis.yml
Expand Up @@ -16,7 +16,7 @@ env:
- OMPI_MCA_rmaps_base_oversubscribe=yes
matrix:
- MPI=mpich
- MPI=openmpi
#- MPI=openmpi

matrix:
allow_failures:
Expand Down Expand Up @@ -45,30 +45,31 @@ before_install:
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda update -q -y conda
- conda info -a # For debugging any issues with conda
- conda config --add channels conda-forge
- conda create --yes --name condaenv python=$TRAVIS_PYTHON_VERSION
- source activate condaenv

install:
- conda install gcc_linux-64
- conda install $MPI
- pip install numpy
- pip install scipy
- pip install mpi4py
- pip install petsc petsc4py
- conda install --no-update-deps scipy # includes numpy
- conda install --no-update-deps mpi4py
- conda install --no-update-deps petsc4py petsc
- conda install --no-update-deps nlopt
# pip install these as the conda installs downgrade pytest on python3.4
- pip install pytest
- pip install pytest-cov
- pip install pytest-timeout
- pip install pytest-timeout
- pip install mock
- pip install coveralls
- conda install --no-deps nlopt
# For confirmation of MPI library being used.
- python conda/find_mpi.py #locate compilers
- mpiexec --version #Show MPI library details
- pip install -e .

# Run test
# Run test (-z show output)
script:
- libensemble/tests/run-tests.sh -z

Expand Down
5 changes: 0 additions & 5 deletions conda/build-conda-package.sh

This file was deleted.

75 changes: 55 additions & 20 deletions conda/conda-install-deps.sh
@@ -1,27 +1,62 @@
#!/usr/bin/env bash

#Note - This assumes miniconda - with anaconda some will already be installed
#You must have installed miniconda: https://conda.io/docs/install/quick.html
# Install dependencies for libEnsemble and tests in Conda.
# Note: libEnsemble itself is currently not in Conda
# To replicate travis builds - see directory run_travis_locally/

#To create and activate new environment called py3.6
#> conda create --name py3.6 python=3.6
#> source activate py3.6
# Note - This assumes miniconda - with anaconda some will already be installed
# You must have installed miniconda: https://conda.io/docs/install/quick.html

#To come out of env: source deactivate
#To see envs: conda info --envs
# To isolate from local installs run this before activating environment
# export PYTHONNOUSERSITE=1

# To create and activate new environment called py3.6
# > conda create --name py3.6 python=3.6
# > source activate py3.6
# To enable running this script without prompts:
# > conda config --set always_yes yes
# Then source this script: . ./conda-install-deps.sh

# To come out of env: source deactivate
# To see envs: conda info --envs

# You may need to add the conda-forge chanel
# conda config --add channels conda-forge

#--------------------------------------------------------------------------

#Install packages for libensemble. Do in this order!!!
conda install --yes mpi4py
conda install --yes -c conda-forge petsc4py
conda install --yes -c conda-forge nlopt
conda install --yes pytest pytest-cov
conda install --yes scipy

#To use dev version of mpi4py
#conda install --yes cython
#pip install git+https://bitbucket.org/mpi4py/mpi4py.git@master

echo -e "\nDo 'conda list' to see installed packages"
echo -e "Do './run-tests.sh' to run the tests\n"
# Install packages for libensemble. Do in this order!!!

# This should work for mpich as of v0.4.1
# For other MPI libraries, some packages, such as mpi4py and PETSc may
# need to be pip installed.

export MPI=MPICH
export LIBE_BRANCH=master

conda install gcc_linux-64 || return
conda install $MPI || return
#conda install numpy || return #scipy includes numpy
conda install --no-update-deps scipy || return
conda install --no-update-deps mpi4py || return
conda install --no-update-deps petsc4py petsc || return
conda install --no-update-deps nlopt || return

# pip install these as the conda installs downgrade pytest on python3.4
pip install pytest || return
pip install pytest-cov || return
pip install pytest-timeout || return
pip install mock || return
# pip install coveralls || return # for online

# Install libEnsemble

# From source
git clone -b $LIBE_BRANCH https://github.com/Libensemble/libensemble.git || return
cd libensemble/ || return
pip install -e . || return
# OR
# pip install libEnsemble

echo -e "\nDo 'conda list' to see installed packages"
echo -e "Do 'libensemble/tests/run-tests.sh' to run the tests\n"
108 changes: 0 additions & 108 deletions conda/replicate-travis-local.sh

This file was deleted.

83 changes: 83 additions & 0 deletions conda/run_travis_locally/build_mpich_libE.sh
@@ -0,0 +1,83 @@
# Conda build of dependencies using mpich.
# Source script to maintain environment after running. Script stops if installs fail.
# Note for other MPIs may need to install some packages from source (eg. petsc)

# -x echo commands
set -x # problem with this - loads of conda internal commands shown - overwhelming.

export PYTHON_VERSION=3.7 # default - override with -p <version>
export LIBE_BRANCH="develop" # default - override with -b <branchname>

export MPI=MPICH
export HYDRA_LAUNCHER=fork

# Allow user to optionally set python version and branch
# E.g: ". ./build_mpich_libE.sh -p 3.4 -b feature/myfeature"
while getopts ":p:b:" opt; do
case $opt in
p)
echo "Parameter supplied for Python version: $OPTARG" >&2
PYTHON_VERSION=$OPTARG
;;
b)
echo "Parameter supplied for branch name: $OPTARG" >&2
LIBE_BRANCH=${OPTARG}
;;
\?)
echo "Invalid option supplied: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done

echo -e "\nBuilding libE with python $PYTHON_VERSION and branch ${LIBE_BRANCH}\n"

sudo apt-get update

# This works if not sourced but if sourced its no good.
# set -e

sudo apt install gfortran || return
sudo apt install libblas-dev || return
sudo apt-get install liblapack-dev || return

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh || return
bash miniconda.sh -b -p $HOME/miniconda || return
export PATH="$HOME/miniconda/bin:$PATH" || return
conda update -q -y conda

conda config --add channels conda-forge || return
conda config --set always_yes yes --set changeps1 no || return
conda create --yes --name condaenv python=$PYTHON_VERSION || return

source activate condaenv || return
wait

conda install gcc_linux-64 || return
conda install $MPI || return
#conda install numpy || return #scipy includes numpy
conda install --no-update-deps scipy || return
conda install --no-update-deps mpi4py || return
conda install --no-update-deps petsc4py petsc || return
conda install --no-update-deps nlopt || return

# pip install these as the conda installs downgrade pytest on python3.4
pip install pytest || return
pip install pytest-cov || return
pip install pytest-timeout || return
pip install mock || return
pip install coveralls || return

# Not required on travis
git clone -b $LIBE_BRANCH https://github.com/Libensemble/libensemble.git || return
cd libensemble/ || return
pip install -e . || return

libensemble/tests/run-tests.sh

echo -e "\n\nScript completed...\n\n"
set +ex

0 comments on commit 22286ad

Please sign in to comment.