Skip to content

Commit

Permalink
Merge pull request #151 from michellab/devel
Browse files Browse the repository at this point in the history
Merging in devel to create the 2017.1.0 release
  • Loading branch information
chryswoods authored Apr 20, 2017
2 parents 594cac3 + da4b17a commit 1bf9cda
Show file tree
Hide file tree
Showing 265 changed files with 17,818 additions and 2,829 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ wrapper/Py++/pyplusplus

# Python autogenerated backup wrappers
*~

#Atom
.idea
140 changes: 119 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,135 @@
language: c++
sudo: false

language: cpp
dummy: true

compiler:
- gcc
env:
global:
# variables used to control build of Sire - limit to 4 core build,
# don't have Sire phone home (as would create false stats) and
# install into the home directory, sire.app
- NCORES=4
- SIRE_DONT_PHONEHOME=1
- INSTALL_SIRE_DIR=$HOME/sire.app

cache:
directories:
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.9.0

# Travis CI is powered with Ubuntu 12.04, whose toolchain is outdated.
addons:
apt:
# Travis white list of ppa.
# https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
sources:
- ubuntu-toolchain-r-test # For gcc 5.2
- george-edison55-precise-backports # cmake 3.2.3 / doxygen 1.8.3
# Travis whitelist of packages.
# https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
sources: &sources
- ubuntu-toolchain-r-test # for gcc 5.2 and gcc 6
packages:
- cmake
- cmake-data
- g++-6
- g++-5
#- g++-4.9 # commented out as this takes more than 90 minutes to compile!

matrix:
exclude:
# exclude the default dummy build
- dummy: true

include:
# OS X, clang 3.7.2 (Apple LLVM 8.0.0) - disabling for now as takes
# more than our allocation to compile and install
#- os: osx
# env: CXX_COMPILER=clang++ C_COMPILER=clang
# osx_image: xcode8

# Linux, GCC 6.2.0
- os: linux
env: CXX_COMPILER=g++-6 C_COMPILER=gcc-6
compiler: gcc

# Linux, GCC 5.4.1
- os: linux
env: CXX_COMPILER=g++-5 C_COMPILER=gcc-5
compiler: gcc

# Linux, GCC 4.9 (any earlier doesn't have C++ 11, and 4.8 is broken - ice fault)
# (possibly because ran out of memory when compiling wrappers - now use 2 cores for this)
#- os: linux
# env: CXX_COMPILER=g++-4.9 C_COMPILER=gcc-4.9 NPYCORES=2
# compiler: gcc

# dependencies of Sire fail to compile on linux with clang
#- os: linux
# env: LLVM_VERSION=3.9.0
# compiler: clang

install:
############################################################################
# All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
############################################################################
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}

############################################################################
# Setup default versions and override compiler if needed
############################################################################
- if [[ "${LLVM_VERSION}" == "default" ]]; then LLVM_VERSION=3.9.0; fi

- |
if [[ "${CXX_COMPILER}" != "" ]]; then
echo "Using compiler ${CXX_COMPILER} | ${C_COMPILER}"
export CXX=${CXX_COMPILER}
export CC=${C_COMPILER}
fi
############################################################################
# Install a recent CMake
############################################################################
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
else
brew install cmake
brew upgrade cmake
fi
- cmake --version

############################################################################
# Install Clang, libc++ and libc++abi
############################################################################
- |
if [[ "${LLVM_VERSION}" != "" ]]; then
LLVM_DIR=${DEPS_DIR}/llvm-${LLVM_VERSION}
if [[ -z "$(ls -A ${LLVM_DIR})" ]]; then
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
CLANG_URL="http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz"
mkdir -p ${LLVM_DIR} ${LLVM_DIR}/build ${LLVM_DIR}/projects/libcxx ${LLVM_DIR}/projects/libcxxabi ${LLVM_DIR}/clang
travis_retry wget --quiet -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}
travis_retry wget --quiet -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/projects/libcxx
travis_retry wget --quiet -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/projects/libcxxabi
travis_retry wget --quiet -O - ${CLANG_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/clang
(cd ${LLVM_DIR}/build && cmake .. -DCMAKE_INSTALL_PREFIX=${LLVM_DIR}/install -DCMAKE_CXX_COMPILER=clang++)
(cd ${LLVM_DIR}/build/projects/libcxx && make install -j2)
(cd ${LLVM_DIR}/build/projects/libcxxabi && make install -j2)
fi
export CXXFLAGS="-nostdinc++ -isystem ${LLVM_DIR}/install/include/c++/v1"
export LDFLAGS="-L ${LLVM_DIR}/install/lib -l c++ -l c++abi"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_DIR}/install/lib"
export PATH="${LLVM_DIR}/clang/bin:${PATH}"
fi
- ${CXX} --version

before_install:
- export NCORES=4
- export SIRE_DONT_PHONEHOME=1
- export INSTALL_SIRE_DIR=$HOME/sire.app
- if [ "$CC" = "gcc" ]; then export CC=gcc-5 CXX=g++-5; fi
- if [ "$CC" = "clang" ]; then export CC=clang-3.6 CXX=clang++-3.6; fi
before_script:
############################################################################
# Go back to the root of the project and setup the build directory
############################################################################
- cd ${TRAVIS_BUILD_DIR}

script:
- cmake --version
- $CXX --version
- which $CXX
- bash compile_sire.sh
- $HOME/sire.app/bin/sire_test
- $HOME/sire.app/bin/sire_test -OpenMM

after_success:
- echo "Time to go home and have a cup of tea! :)"
- echo "Congratulations - everything worked :-)"
34 changes: 29 additions & 5 deletions build/build_sire.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,18 @@ def print_progress():
import multiprocessing
NCORES = multiprocessing.cpu_count()

# Get the number of cores to use for compiling the python wrappers - this
# defaults to NCORES
if "NPYCORES" in os.environ:
NPYCORES = int(os.environ["NPYCORES"])
else:
NPYCORES = NCORES

print("Number of cores used for compilation = %d" % NCORES)

if NPYCORES != NCORES:
print("Number of cores used for wrapper compilation = %d" % NPYCORES)

python_exe = None
conda_exe = None

Expand Down Expand Up @@ -90,16 +100,27 @@ def print_progress():
except:
print("Installing openmm from the omnia repository...")
os.system("%s config --add channels http://conda.binstar.org/omnia" % conda_exe)
os.system("%s install --yes openmm" % conda_exe)
os.system("%s install --yes openmm=7.0" % conda_exe)

# Now that the miniconda distribution is ok, the next step
# is to use cmake to build the corelib and wrapper in the build/corelib
# and build/wrapper directories

# first, get the value of the CXX environment variable
cxx = os.getenv("CXX")
compiler_ext = None

if cxx:
if cxx.find("icpc") != -1:
compiler_ext = "intel"

# change into the build/corelib directory
OLDPWD = os.path.abspath(os.curdir)

coredir = "%s/corelib" % build_dir
if compiler_ext:
coredir = "%s/corelib_%s" % (build_dir,compiler_ext)
else:
coredir = "%s/corelib" % build_dir

if not os.path.exists(coredir):
os.makedirs(coredir)
Expand Down Expand Up @@ -146,7 +167,10 @@ def print_progress():
# python wrappers
os.chdir(OLDPWD)

wrapperdir = "%s/wrapper" % build_dir
if compiler_ext:
wrapperdir = "%s/wrapper_%s" % (build_dir,compiler_ext)
else:
wrapperdir = "%s/wrapper" % build_dir

if not os.path.exists(wrapperdir):
os.makedirs(wrapperdir)
Expand Down Expand Up @@ -176,14 +200,14 @@ def print_progress():
sys.exit(-1)

# Now that cmake has run, we can compile wrapper
status = os.system("make -j %s" % NCORES)
status = os.system("make -j %s" % NPYCORES)

if status != 0:
print("SOMETHING WENT WRONG WHEN COMPILING WRAPPER!")
sys.exit(-1)

# Now the compilation has finished, install wrapper
status = os.system("make -j %s install" % NCORES)
status = os.system("make -j %s install" % NPYCORES)

if status != 0:
print("SOMETHING WENT WRONG WHEN INSTALLING WRAPPER!")
Expand Down
5 changes: 2 additions & 3 deletions compile_sire.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ case $key in
--install)
INSTALL_SIRE_DIR="$2"
echo "Installing Sire into ${INSTALL_SIRE_DIR}"
exit 0
;;
--clean)
echo "Completely cleaning the build directories..."
Expand All @@ -34,8 +33,8 @@ esac

# Set the version of miniconda to use. Choose "latest" for the latest
# miniconda, or set a specific version here
#MINICONDA_VERSION="3.9.1"
MINICONDA_VERSION="latest"
MINICONDA_VERSION="4.2.12"
#MINICONDA_VERSION="latest"

if [ -z "$INSTALL_SIRE_DIR" ]; then
# Ask the user where they would like to install sire. By default
Expand Down
Loading

0 comments on commit 1bf9cda

Please sign in to comment.