Unverified Commit b9df0c77 authored by greole's avatar greole Committed by GitHub
Browse files

Travis build stages (#26)

* wrap build into a stage

* fix missing ws

* change order of stages

* add test stages, test env matrix for build stage

* move build stage to top level

* fix parsing

* fix indentation

* fix indentation

* fix indentation

* fix indentation

* change stage names

* use variables

* remove build matrix from top level

* build current develop and a specific (last known to work) version of ginkgo

* fix enviromental variables

* expand run stage

* remove OF Version 6 from CI/CD pipeline

* Create include folder

* Fix install paths

* Fix install dir for third_party ginkgo install

* fix ginkgo install dir for OF

* Revert changes

Use previous install prefix otherwise the find_package will not work properly.

* Raise minimum Cmake version

* create missing include directory

* Copy include folder

* Fix missing parentheses

* create include folder at generate step

* Fix install path of third_party ginkgo

* Let third party install handle ginkgo installation

* install in system default folder

* Install Openfoam via travis addons, cache ginkgo build

* OF is installed from extra repo

* Create missing build folder, clone OBR

* Setup travis workspaces to share data between stages

* Add test runs to pipeline

* Fix indentation

* Check content of cache

* Create cache folder if not present

* Update .travis.yml

* Don't put OBR into cache folder

* Update .travis.yml

* pip install docopt

* Fix not working line cont
parent b3ad2f63
......@@ -7,16 +7,17 @@ dist: focal
os:
- linux
env:
- VERSION=8 EXTERNAL_GINKGO=OFF
- VERSION=8 EXTERNAL_GINKGO=ON
- VERSION=7 EXTERNAL_GINKGO=OFF
- VERSION=7 EXTERNAL_GINKGO=ON
cache:
directories:
- $HOME/cache
- $HOME/OpenFOAM
- /opt/openfoam7
- /opt/openfoam8
stages:
- build
- run
addons:
apt:
......@@ -27,21 +28,92 @@ addons:
- lcov
- libopenmpi-dev
before_install:
- sudo sh -c "wget --no-check-certificate -O - https://dl.openfoam.org/gpg.key | apt-key add -"
- sudo add-apt-repository http://dl.openfoam.org/ubuntu
- sudo apt update
script: skip
install:
- sudo apt-get -y install openfoam$VERSION
- source /opt/openfoam$VERSION/etc/bashrc
- ./scripts/travis_install_external_ginkgo.sh
_build: &_build
stage: build
before_install:
- sudo sh -c "wget --no-check-certificate -O - https://dl.openfoam.org/gpg.key | apt-key add -"
- sudo add-apt-repository http://dl.openfoam.org/ubuntu
- sudo apt update
- sudo apt-get -y install openfoam$VERSION
- source /opt/openfoam$VERSION/etc/bashrc
before_script:
- cmake --version
- mkdir build
- cd build
- cmake -DOGL_USE_EXTERNAL_GINKGO=$EXTERNAL_GINKGO ..
install:
- ./scripts/travis_install_external_ginkgo.sh
script:
- make -j4
before_script:
- cmake --version
- mkdir build
- cd build
- cmake -DOGL_USE_EXTERNAL_GINKGO=$EXTERNAL_GINKGO ..
script:
- make -j4 && make install
_run: &_run
stage: run
before_install:
- sudo sh -c "wget --no-check-certificate -O - https://dl.openfoam.org/gpg.key | apt-key add -"
- sudo add-apt-repository http://dl.openfoam.org/ubuntu
- sudo apt update
- sudo apt-get -y install openfoam$VERSION
- source /opt/openfoam$VERSION/etc/bashrc
install:
- git clone https://github.com/greole/OBR.git $HOME/OBR
- pip install docopt --user
script:
- ls /opt
- ls $FOAM_SRC
- ls $FOAM_USER_LIBBIN
- cd $HOME/OBR
- python runBenchmark.py --solver CG,BiCGStab --backend OF,GKO --executor Ref --preconditioner NoPrecond --field p,U --small-cases --test-run --fail_on_error --report=report.csv --folder=Test --project_path /home/travis/OBR
jobs:
include:
- <<: *_build
ENV:
- VERSION=8
- EXTERNAL_GINKGO=OFF
- GINKGO_VERSION=develop
workspaces:
create:
name:
foam_user_libbin_8
paths:
/home/travis/OpenFOAM/travis-8
- <<: *_build
ENV:
- VERSION=8
- EXTERNAL_GINKGO=ON
- GINKGO_VERSION=develop
- <<: *_build
ENV:
- VERSION=8
- EXTERNAL_GINKGO=ON
- GINKGO_VERSION=331277a81b848f33705f6ccf4f910fff69c84e18
- <<: *_build
ENV:
- VERSION=7
- EXTERNAL_GINKGO=OFF
- GINKGO_VERSION=develop
workspaces:
create:
name:
foam_user_libbin_7
paths:
/home/travis/OpenFOAM/travis-7
- <<: *_build
ENV:
- VERSION=7
- EXTERNAL_GINKGO=ON
- GINKGO_VERSION=develop
- <<: *_run
ENV:
- VERSION=8
workspaces:
use: foam_user_libbin_8
cmake_minimum_required(VERSION 3.9)
cmake_minimum_required(VERSION 3.13.0)
project(OGL LANGUAGES C CXX DESCRIPTION "A wrapper for Ginkgo solver to provide GPGPU capabilities to OpenFOAM")
......@@ -20,13 +20,14 @@ check_include_file_cxx(cxxabi.h GKO_HAVE_CXXABI_H)
include(cmake/package_helpers.cmake)
include(cmake/build_helpers.cmake)
include(cmake/install_helpers.cmake)
ginkgo_find_package(Ginkgo "Ginkgo::ginkgo" FALSE 1.4.0)
add_subdirectory(third_party)
# If ginkgo wasn't found so far look for the third_party installation
if (NOT Ginkgo_FOUND)
find_package(Ginkgo 1.4.0 REQUIRED PATHS ${CMAKE_CURRENT_BINARY_DIR}/third_party/ginkgo/build/install/lib/cmake)
if(NOT ${OGL_USE_EXTERNAL_GINKGO})
find_package(Ginkgo CONFIG 1.4.0 REQUIRED PATHS ${CMAKE_CURRENT_BINARY_DIR}/third_party/ginkgo/build/install/lib/cmake)
endif()
# To interface with ginkgo at least C++ 14 is needed
......@@ -142,13 +143,6 @@ target_link_libraries(OGL
Ginkgo::ginkgo
)
install(TARGETS OGL
DESTINATION $ENV{FOAM_USER_LIBBIN}
)
if(NOT ${OGL_USE_EXTERNAL_GINKGO})
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/third_party/ginkgo/build/install/lib/
install(TARGETS OGL
DESTINATION $ENV{FOAM_USER_LIBBIN}
)
endif()
)
#!/bin/bash
if [ $EXTERNAL_GINKGO = ON ]
then
git clone https://github.com/ginkgo-project/ginkgo.git
mkdir ginkgo/build
cd ginkgo/build
mkdir -p $HOME/cache/
cd $HOME/cache
git pull -C ginkgo-$GINKGO_VERSION pull || \
git clone https://github.com/ginkgo-project/ginkgo.git \
$HOME/cache/ginkgo-$GINKGO_VERSION
mkdir -p $HOME/cache/ginkgo-$GINKGO_VERSION/build
cd $HOME/cache/ginkgo-$GINKGO_VERSION/build
git checkout $GINKGO_VERSION
cmake \
-DGINKGO_BUILD_BENCHMARKS=OFF \
-DGINKGO_BUILD_EXAMPLES=OFF \
......@@ -17,5 +21,5 @@ then
-DCMAKE_BUILD_TYPE=Release \
-DGINKGO_BUILD_HWLOC=off \
..
make && sudo make install
make -j4 && sudo make install
fi
......@@ -7,5 +7,5 @@ ginkgo_load_git_package(ginkgo_external
"-DGINKGO_BUILD_EXAMPLES=off" "-DGINKGO_BUILD_BENCHMARKS=off"
"-DGINKGO_BUILD_REFERENCE=on" "-DCMAKE_BUILD_TYPE=Release"
"-DGINKGO_BUILD_HWLOC=off"
"-DCMAKE_INSTALL_PREFIX=install" "-DBUILD_SHARED_LIBS=on"
"-DCMAKE_INSTALL_PREFIX=$ENV{FOAM_USER_LIBBIN}/.." "-DBUILD_SHARED_LIBS=on"
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment