Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .ci/cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -eu -o pipefail

echo "-- Installing CMake"
CMAKE_VERSION="3.11.4"
target_path=$HOME/Deps/cmake/$CMAKE_VERSION
cmake_url="https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz"
mkdir -p "$target_path"
curl -Ls "$cmake_url" | tar -xz -C "$target_path" --strip-components=1
echo "-- Done installing CMake"
15 changes: 15 additions & 0 deletions .ci/pybind11.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -eu -o pipefail

pybind11_VERSION="2.4.3"
echo "-- Installing pybind11 $pybind11_VERSION"
cd "$HOME"/Downloads
mkdir -p pybind11
curl -Ls https://github.com/pybind/pybind11/archive/v${pybind11_VERSION}.tar.gz | tar -xz -C pybind11 --strip-components=1
cd pybind11
cmake -H. -Bbuild_pybind11 -DCMAKE_INSTALL_PREFIX="$HOME"/Deps/pybind11 -DPYTHON_EXECUTABLE=$(which python) -DPYBIND11_TEST=OFF #&> /dev/null
cmake --build build_pybind11 -- install #&> /dev/null
cd "$TRAVIS_BUILD_DIR"
rm -rf "$HOME"/Downloads/pybind11
echo "-- Done with pybind11 $pybind11_VERSION"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ cmake/lib/*.pyc

# Emacs backup files
*~
/.ccls-cache/
/.mypy_cache/
67 changes: 32 additions & 35 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: cpp
sudo: false
dist: trusty
dist: xenial

matrix:
include:
Expand All @@ -11,25 +11,22 @@ matrix:
apt:
packages:
- clang
- cmake3
- gfortran
- swig
env:
- CXX_COMPILER='clang++'
- C_COMPILER='clang'
- Fortran_COMPILER='gfortran'
- BUILD_TYPE='Release'
- PYTHON='--three'
- COVERAGE=OFF
- PYBIND11='-Dpybind11_DIR=$HOME/Deps/pybind11/share/cmake/pybind11'
- os: linux
compiler: clang
addons: &clang35
apt:
packages:
- clang-3.5
- cmake3
- gfortran
- swig
env:
- CXX_COMPILER='clang++-3.5'
- C_COMPILER='clang-3.5'
Expand All @@ -43,9 +40,7 @@ matrix:
apt:
packages:
- clang-3.8
- cmake3
- gfortran
- swig
env:
- CXX_COMPILER='clang++-3.8'
- C_COMPILER='clang-3.8'
Expand All @@ -59,18 +54,17 @@ matrix:
addons: &gcc48
apt:
packages:
- cmake3
- g++
- gcc
- gfortran
- swig
- g++-4.8
- gcc-4.8
- gfortran-4.8
env:
- CXX_COMPILER='g++'
- C_COMPILER='gcc'
- Fortran_COMPILER='gfortran'
- CXX_COMPILER='g++-4.8'
- C_COMPILER='gcc-4.8'
- Fortran_COMPILER='gfortran-4.8'
- BUILD_TYPE='Release'
- PYTHON='--two'
- COVERAGE=OFF
- PYBIND11='-Dpybind11_DIR=$HOME/Deps/pybind11/share/cmake/pybind11'
- os: linux
python: 3.6
compiler: gcc
Expand All @@ -79,11 +73,9 @@ matrix:
sources:
- ubuntu-toolchain-r-test
packages:
- cmake3
- g++-5
- gcc-5
- gfortran-5
- swig
env:
- CXX_COMPILER='g++-5'
- C_COMPILER='gcc-5'
Expand All @@ -98,11 +90,9 @@ matrix:
sources:
- ubuntu-toolchain-r-test
packages:
- cmake3
- g++-6
- gcc-6
- gfortran-6
- swig
env:
- CXX_COMPILER='g++-6'
- C_COMPILER='gcc-6'
Expand All @@ -117,11 +107,9 @@ matrix:
sources:
- ubuntu-toolchain-r-test
packages:
- cmake3
- g++-7
- gcc-7
- gfortran-7
- swig
env:
- CXX_COMPILER='g++-7'
- C_COMPILER='gcc-7'
Expand All @@ -132,16 +120,32 @@ matrix:
# 3/ OSX Clang Builds
- os: osx
compiler: clang
addons:
homebrew:
packages:
- cmake
- python
- pipenv
update: true
env:
- CXX_COMPILER='clang++'
- C_COMPILER='clang'
- Fortran_COMPILER='gfortran'
- BUILD_TYPE='Release'
- PYTHON='--two'
- COVERAGE=OFF
- PYBIND11='-Dpybind11_DIR=$HOME/Deps/pybind11/share/cmake/pybind11'
# 4/ OSX GCC Builds
- os: osx
compiler: gcc
addons:
homebrew:
packages:
- gcc
- cmake
- python
- pipenv
update: true
env:
- CXX_COMPILER='g++'
- C_COMPILER='gcc'
Expand All @@ -157,12 +161,10 @@ matrix:
sources:
- ubuntu-toolchain-r-test
packages:
- cmake3
- g++-7
- gcc-7
- gfortran-7
- lcov
- swig
env:
- CXX_COMPILER='g++-7'
- C_COMPILER='gcc-7'
Expand All @@ -175,25 +177,19 @@ before_install:
- test -n $CC && unset CC
- test -n $CXX && unset CXX
- test -n $FC && unset FC
- mkdir -p "$HOME"/Deps "$HOME"/Downloads

install:
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
brew update &> /dev/null
brew cask uninstall --force oclint
brew upgrade cmake python
brew install gcc pipenv swig
elif [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
# pip install --user pipenv --upgrade
# https://github.com/pypa/pipenv/issues/3224
pip install --user --upgrade -e git+https://github.com/pypa/pipenv.git#egg=pipenv
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
pip install --user pipenv --upgrade
fi
- pipenv $PYTHON install --dev
- source $(pipenv --venv)/bin/activate
- ./.ci/cmake.sh
- ./.ci/pybind11.sh

before_script:
- source $(pipenv --venv)/bin/activate
- python --version
- cd ${TRAVIS_BUILD_DIR}
- >
Expand All @@ -206,6 +202,7 @@ before_script:
-DENABLE_PYTHON_INTERFACE=ON
-DPYTHON_EXECUTABLE=$(which python)
-DCMAKE_INSTALL_PREFIX=$HOME/Software/xcfun
${PYBIND11}

script:
# Build and install
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2015-2019 by Radovan Bast, Roberto Di Remigio, Jonas Juselius, and contributors.

# set minimum cmake version
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)

# project name
project(XCFun LANGUAGES CXX C)
Expand Down Expand Up @@ -61,5 +61,4 @@ include(${PROJECT_SOURCE_DIR}/cmake/custom/compilers/CXXFlags.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/custom/compilers/CFlags.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/custom/static_library.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/custom/xcfun.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/downloaded/autocmake_src.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/custom/test.cmake)
9 changes: 4 additions & 5 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ name = "pypi"

[packages]

numpy = "*"

[dev-packages]

Sphinx = "*"
sphinx_rtd_theme = "*"
fprettify = "*"
pathlib2 = {version = "*", markers="python_version < '3'"}
pyyaml = "*"
numpy = "*"
pathlib2 = {version = "*", markers="python_version < '3'"}
pytest = "*"
pyyaml = "*"
sphinx_rtd_theme = "*"
yapf = "*"
14 changes: 8 additions & 6 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
file(
COPY ${CMAKE_CURRENT_LIST_DIR}/xcfun.h
DESTINATION ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
configure_file(
${CMAKE_CURRENT_LIST_DIR}/xcfun.h
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/xcfun.h
COPYONLY
)

install(
Expand All @@ -10,9 +11,10 @@ install(
${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
)

file(
COPY ${CMAKE_CURRENT_LIST_DIR}/xcfun.F90
DESTINATION ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
configure_file(
${CMAKE_CURRENT_LIST_DIR}/xcfun.F90
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/xcfun.F90
COPYONLY
)

install(
Expand Down
3 changes: 1 addition & 2 deletions cmake/autocmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# adapt the following lines and expand

name: XCFun
min_cmake_version: 3.5
min_cmake_version: 3.11
setup_script: setup
url_root: https://github.com/coderefinery/autocmake/raw/master/
default_build_type: Debug
Expand All @@ -30,7 +30,6 @@ modules:
- src:
- source:
- 'custom/xcfun.cmake'
- '%(url_root)modules/src.cmake'
- testing:
- source:
- 'custom/test.cmake'
Loading