Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enter Circle CI #442

Merged
merged 28 commits into from
Aug 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
97435dc
Enable CircleCI
robertodr Jul 17, 2018
4531969
Set Eigen3_DIR for CircleCI
robertodr Aug 8, 2018
9e074e7
Update testing/README.md
robertodr Aug 9, 2018
4477f16
Fixes for Intel Docker image
robertodr Aug 9, 2018
a313804
Enforce C++11 in chapter 9, recipe 1
robertodr Aug 9, 2018
85fdbab
Fix ch 6, r 2 for Intel Docker image testing
robertodr Aug 9, 2018
e1d3284
Fix chapter 1 for PGI
robertodr Aug 10, 2018
a3463ae
Update README-s
robertodr Aug 10, 2018
675c0f5
Fix chapter 3 for PGI testing
robertodr Aug 10, 2018
4939a0e
Test TARGET PkgConfig::
robertodr Aug 10, 2018
c258f6a
Get back Boost recipe in chapter 3 with PGI
robertodr Aug 10, 2018
ff26d37
Fix chapter 4 for PGI testing
robertodr Aug 10, 2018
e237cc8
Fix chapter 5 for PGI testing
robertodr Aug 10, 2018
7389d76
Skip one recipe on PGI
robertodr Aug 10, 2018
3cf3534
Fix FileNotFoundError: for print_info.c.in
robertodr Aug 11, 2018
f38b558
Skip tests where PGI image cannot find Python libs
robertodr Aug 11, 2018
010020a
Fix chapter 9 for testing with PGI
robertodr Aug 11, 2018
aae2f4a
Rewrite generate.py
robertodr Aug 11, 2018
c16ec95
Skip all of chapter 10 on PGI
robertodr Aug 11, 2018
8043f46
Fix chapter 11 for testing with PGI
robertodr Aug 11, 2018
bcd03ab
Fix chapter 14 for PGI testing
robertodr Aug 11, 2018
d85220e
Remove symlinks within custom.sh
robertodr Aug 11, 2018
35a0ba9
Fix some superbuild recipes by skipping on PGI
robertodr Aug 11, 2018
55342a1
Make Message.hpp in ch 11, r 1 a real file
robertodr Aug 11, 2018
dc8bf92
Skip ch 11, r 2 on Circle CI
robertodr Aug 11, 2018
bdbec77
Exclude one more recipe on Intel
robertodr Aug 11, 2018
74b4d94
Re-enable ch 1, r 9 with Intel
robertodr Aug 12, 2018
aa32483
Make script a little less aggressive
robertodr Aug 12, 2018
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
99 changes: 99 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
version: 2

variables:
intel-linux: &intel-linux
docker:
- image: devcafe/cmake-cookbook_circleci_ubuntu16.04-intel2018.1
name: tsubame
user: root
environment:
CIRCLECI_COMPILER: intel
working_directory: ~/cmake-cookbook
pgi-linux: &pgi-linux
docker:
- image: devcafe/cmake-cookbook_circleci_ubuntu16.04-pgi18.4
name: chabo
user: root
environment:
CIRCLECI_COMPILER: pgi
working_directory: ~/cmake-cookbook
setup: &setup
run:
name: Set up base system and Python dependencies
command: |
cat >> $BASH_ENV <<EOF
if [[ "$CIRCLECI_COMPILER" == "intel" ]] ; then
source /opt/intel/bin/compilervars.sh -arch intel64 -platform linux
fi
EOF
pipenv install --three
report: &report
run:
name: Report
command: |
pipenv run python --version
tests: &tests
run:
name: Testing
shell: /bin/bash
command: |
pipenv run python testing/collect_tests.py 'chapter-01/recipe-*' &&
pipenv run python testing/collect_tests.py 'chapter-02/recipe-*' &&
pipenv run python testing/collect_tests.py 'chapter-03/recipe-*' &&
pipenv run python testing/collect_tests.py 'chapter-04/recipe-*' &&
pipenv run python testing/collect_tests.py 'chapter-05/recipe-*' &&
pipenv run python testing/collect_tests.py 'chapter-06/recipe-*' &&
pipenv run python testing/collect_tests.py 'chapter-07/recipe-*' &&
pipenv run python testing/collect_tests.py 'chapter-08/recipe-*' &&
pipenv run python testing/collect_tests.py 'chapter-09/recipe-*' &&
pipenv run python testing/collect_tests.py 'chapter-10/recipe-*' &&
pipenv run python testing/collect_tests.py 'chapter-11/recipe-0[1,3]' &&
pipenv run python testing/collect_tests.py 'chapter-12/recipe-*' &&
pipenv run python testing/collect_tests.py 'chapter-13/recipe-*' &&
pipenv run python testing/collect_tests.py 'chapter-14/recipe-*'
tests-conda: &tests-conda
run:
name: Testing Conda recipes
shell: /bin/bash
command: |
pipenv run python testing/collect_tests.py 'chapter-11/recipe-04' &&
pipenv run python testing/collect_tests.py 'chapter-11/recipe-05'

jobs:
intel:
<<: *intel-linux
steps:
- checkout
- *setup
- *report
- *tests
intel-conda:
<<: *intel-linux
steps:
- checkout
- *setup
- *report
- *tests-conda
pgi:
<<: *pgi-linux
steps:
- checkout
- *setup
- *report
- *tests
pgi-conda:
<<: *pgi-linux
steps:
- checkout
- *setup
- *report
- *tests-conda

workflows:
version: 2
build:
jobs:
- intel
- intel-conda
- pgi
- pgi-conda
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

[![Travis branch](https://img.shields.io/travis/dev-cafe/cmake-cookbook/master.svg?style=flat-square)](https://travis-ci.org/dev-cafe/cmake-cookbook)
[![AppVeyor branch](https://img.shields.io/appveyor/ci/bast/cmake-cookbook/master.svg?style=flat-square)](https://ci.appveyor.com/project/bast/cmake-cookbook/branch/master)
[![CircleCI](https://circleci.com/gh/robertodr/cmake-cookbook.svg?style=svg)](https://circleci.com/gh/robertodr/cmake-cookbook)

[![GitHub issues](https://img.shields.io/github/issues/dev-cafe/cmake-cookbook.svg?style=flat-square)](https://github.com/dev-cafe/cmake-cookbook/issues)
[![GitHub forks](https://img.shields.io/github/forks/dev-cafe/cmake-cookbook.svg?style=flat-square)](https://github.com/dev-cafe/cmake-cookbook/network)
Expand Down
8 changes: 7 additions & 1 deletion chapter-01/recipe-08/cxx-example/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ appveyor-msys:
definitions:
- CMAKE_CXX_FLAGS: '-fno-exceptions -fno-rtti'

drone:
circle-intel:
definitions:
- CMAKE_CXX_FLAGS: '-fno-exceptions -fno-rtti'

# PGI does not understand -Wall -Wextra -Wpedantic
circle-pgi:
skip_generators:
- 'Unix Makefiles'
- 'Ninja'

travis-linux:
definitions:
- CMAKE_CXX_FLAGS: '-fno-exceptions -fno-rtti'
Expand Down
1 change: 1 addition & 0 deletions chapter-01/recipe-09/fortran-example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ add_library(
add_executable(compute-areas compute-areas.f90)

# These compiler flags will not work on Windows
# Intel or PGI
target_compile_options(geometry
PRIVATE
"-std=f2008"
Expand Down
8 changes: 4 additions & 4 deletions chapter-01/recipe-09/fortran-example/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ appveyor-msys:
failing_generators:
- 'Ninja'

drone:
definitions:
- CMAKE_Fortran_COMPILER: 'gfortran'
failing_generators:
# PGI seems not to support Fortran2008 yet
circle-pgi:
skip_generators:
- 'Unix Makefiles'
- 'Ninja'

travis-linux:
Expand Down
8 changes: 6 additions & 2 deletions chapter-02/recipe-06/cxx-example/menu.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
drone:
circle-intel:
definitions:
- Eigen3_DIR: '$HOME/Deps/eigen/share/eigen3/cmake'
- Eigen3_DIR: '/opt/eigen/share/eigen3/cmake'

circle-pgi:
definitions:
- Eigen3_DIR: '/opt/eigen/share/eigen3/cmake'

travis-linux:
definitions:
- Eigen3_DIR: '$HOME/Deps/eigen/share/eigen3/cmake'
Expand Down
6 changes: 6 additions & 0 deletions chapter-03/recipe-02/c-example/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ appveyor-vs:
definitions:
- CMAKE_BUILD_TYPE: 'Release'
- CMAKE_CONFIGURATION_TYPES: 'Release'

# CMake cannot find the Python library
circle-pgi:
skip_generators:
- 'Unix Makefiles'
- 'Ninja'
6 changes: 6 additions & 0 deletions chapter-03/recipe-03/cxx-example/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ appveyor-vs:
appveyor-msys:
definitions:
- CMAKE_CXX_FLAGS: '-D_hypot=hypot'

# CMake cannot find the Python library
circle-pgi:
skip_generators:
- 'Unix Makefiles'
- 'Ninja'
6 changes: 6 additions & 0 deletions chapter-03/recipe-04/cxx-example/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ appveyor-msys:
failing_generators:
- 'Ninja'

# Need to link against libpgftnrtl and librt
circle-pgi:
skip_generators:
- 'Unix Makefiles'
- 'Ninja'

travis-linux:
failing_generators:
- 'Ninja'
Expand Down
12 changes: 10 additions & 2 deletions chapter-03/recipe-07/cxx-example-3.5/menu.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
drone:
circle-intel:
definitions:
- Eigen3_DIR: '$HOME/Deps/eigen/share/eigen3/cmake'
- Eigen3_DIR: '/opt/eigen/share/eigen3/cmake'

# Compiler errors due to some undefined alignment primitive
circle-pgi:
skip_generators:
- 'Unix Makefiles'
- 'Ninja'
definitions:
- Eigen3_DIR: '/opt/eigen/share/eigen3/cmake'

travis-linux:
definitions:
Expand Down
12 changes: 10 additions & 2 deletions chapter-03/recipe-07/cxx-example/menu.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
drone:
circle-intel:
definitions:
- Eigen3_DIR: '$HOME/Deps/eigen/share/eigen3/cmake'
- Eigen3_DIR: '/opt/eigen/share/eigen3/cmake'

# Compiler errors due to some undefined alignment primitive
circle-pgi:
skip_generators:
- 'Unix Makefiles'
- 'Ninja'
definitions:
- Eigen3_DIR: '/opt/eigen/share/eigen3/cmake'

travis-linux:
definitions:
Expand Down
5 changes: 5 additions & 0 deletions chapter-03/recipe-08/cxx-example/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ appveyor-vs:
- BOOST_ROOT: 'C:\Libraries\boost_1_67_0'
- CMAKE_CXX_FLAGS: '-DBOOST_ALL_NO_LIB'

circle-pgi:
definitions:
- BOOST_INCLUDEDIR: '/usr/include/boost'
- BOOST_LIBRARYDIR: '/usr/lib/x86_64-linux-gnu'

travis-osx:
definitions:
- BOOST_ROOT: '/usr/local/opt/[email protected]'
2 changes: 1 addition & 1 deletion chapter-03/recipe-09/c-example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pkg_search_module(
IMPORTED_TARGET
)

if(ZeroMQ_FOUND)
if(TARGET PkgConfig::ZeroMQ)
message(STATUS "Found ZeroMQ")
endif()

Expand Down
6 changes: 6 additions & 0 deletions chapter-03/recipe-09/c-example/menu.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
appveyor-vs:
failing_generators:
- 'Visual Studio 15 2017 Win64'

# Fails to generate imported target for ZeroMQ
circle-pgi:
skip_generators:
- 'Unix Makefiles'
- 'Ninja'
8 changes: 7 additions & 1 deletion chapter-03/recipe-10/c-example/FindZeroMQ.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ if(ZeroMQ_INCLUDE_DIRS)
endif()

if(NOT ${CMAKE_C_PLATFORM_ID} STREQUAL "Windows")
find_library(ZeroMQ_LIBRARIES NAMES zmq HINTS ${_ZeroMQ_ROOT}/lib)
find_library(ZeroMQ_LIBRARIES
NAMES
zmq
HINTS
${_ZeroMQ_ROOT}/lib
${_ZeroMQ_ROOT}/lib/x86_64-linux-gnu
)
else()
find_library(ZeroMQ_LIBRARIES
NAMES
Expand Down
5 changes: 5 additions & 0 deletions chapter-04/recipe-04/cxx-example/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ appveyor-vs:
- BOOST_ROOT: 'C:\Libraries\boost_1_67_0'
- CMAKE_CXX_FLAGS: '-DBOOST_ALL_NO_LIB'

circle-pgi:
definitions:
- BOOST_INCLUDEDIR: '/usr/include/boost'
- BOOST_LIBRARYDIR: '/usr/lib/x86_64-linux-gnu'

travis-osx:
definitions:
- BOOST_ROOT: '/usr/local/opt/[email protected]'
Expand Down
5 changes: 5 additions & 0 deletions chapter-05/recipe-01/cxx-example/menu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Compiler errors due to some undefined alignment primitive
circle-pgi:
skip_generators:
- 'Unix Makefiles'
- 'Ninja'
3 changes: 2 additions & 1 deletion chapter-05/recipe-03/cxx-example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(recipe-03 LANGUAGES CXX)
# Fortran needed to discover LAPACK with some compilers
project(recipe-03 LANGUAGES CXX Fortran)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down
6 changes: 6 additions & 0 deletions chapter-05/recipe-03/cxx-example/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ appveyor-msys:
failing_generators:
- 'Ninja'

# Need to link against libpgftnrtl and librt
circle-pgi:
skip_generators:
- 'Unix Makefiles'
- 'Ninja'

travis-linux:
failing_generators:
- 'Ninja'
Expand Down
3 changes: 2 additions & 1 deletion chapter-05/recipe-04/cxx-example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(recipe-04 LANGUAGES CXX)
# Fortran needed to discover LAPACK with some compilers
project(recipe-04 LANGUAGES CXX Fortran)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down
6 changes: 6 additions & 0 deletions chapter-05/recipe-04/cxx-example/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ appveyor-msys:
failing_generators:
- 'Ninja'

# Need to link against libpgftnrtl and librt
circle-pgi:
skip_generators:
- 'Unix Makefiles'
- 'Ninja'

travis-linux:
failing_generators:
- 'Ninja'
Expand Down
2 changes: 1 addition & 1 deletion chapter-05/recipe-08/c-example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(PkgConfig REQUIRED QUIET)
pkg_search_module(UUID REQUIRED uuid IMPORTED_TARGET)
if(UUID_FOUND)
if(TARGET PkgConfig::UUID)
message(STATUS "Found libuuid")
endif()

Expand Down
6 changes: 6 additions & 0 deletions chapter-05/recipe-08/c-example/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ appveyor-msys:
failing_generators:
- 'MSYS Makefiles'
- 'Ninja'

# Fails to generate imported target for UUID
circle-pgi:
skip_generators:
- 'Unix Makefiles'
- 'Ninja'
6 changes: 6 additions & 0 deletions chapter-05/recipe-09/cxx-example-asan/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ appveyor-vs:
definitions:
- CMAKE_BUILD_TYPE: 'Release'
- CMAKE_CONFIGURATION_TYPES: 'Release'

# PGI does not understand all compiler options needed
circle-pgi:
skip_generators:
- 'Unix Makefiles'
- 'Ninja'
4 changes: 2 additions & 2 deletions chapter-06/recipe-02/fortran-c-example/configurator.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
def configure_file(input_file, output_file, vars_dict):

with open(input_file, 'r') as f:
with input_file.open('r') as f:
template = f.read()

for var in vars_dict:
template = template.replace('@' + var + '@', vars_dict[var])

with open(output_file, 'w') as f:
with output_file.open('w') as f:
f.write(template)
Loading