Skip to content

Commit

Permalink
Merge pull request dev-cafe#339 from robertodr/fix-appveyor
Browse files Browse the repository at this point in the history
Fix some recipes on AppVeyor
  • Loading branch information
bast authored May 12, 2018
2 parents a7a0325 + 2b1d186 commit 068ac09
Show file tree
Hide file tree
Showing 26 changed files with 94 additions and 72 deletions.
2 changes: 2 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ environment:
install:
- set PATH=C:\Python36;%PATH%
- set PATH=C:\Python36\Scripts;%PATH%
- set PATH=%PATH:C:\Python27;=%
- set PATH=%PATH:C:\Python27\Scripts;=%
- python --version
- '%APPVEYOR_BUILD_FOLDER%\testing\dependencies\appveyor\install.bat'
- ps: .$env:APPVEYOR_BUILD_FOLDER\testing\dependencies\appveyor\install-msmpi.ps1
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

[![Travis branch](https://img.shields.io/travis/bast/cmake-recipes/master.svg?style=flat-square)](https://travis-ci.org/bast/cmake-recipes)
[![AppVeyor branch](https://img.shields.io/appveyor/ci/bast/cmake-recipes/master.svg?style=flat-square)](https://ci.appveyor.com/project/bast/cmake-recipes/branch/master)
[![Drone branch](https://www.drone-ci.science/api/badges/bast/cmake-recipes/status.svg?style=flat-square)](https://www.drone-ci.science/bast/cmake-recipes)

[![GitHub issues](https://img.shields.io/github/issues/bast/cmake-recipes.svg?style=flat-square)](https://github.com/bast/cmake-recipes/issues)
[![GitHub forks](https://img.shields.io/github/forks/bast/cmake-recipes.svg?style=flat-square)](https://github.com/bast/cmake-recipes/network)
Expand Down
2 changes: 1 addition & 1 deletion chapter-02/recipe-06/cxx-example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Eigen3 3.3 REQUIRED NO_MODULE)
find_package(Eigen3 3.3 REQUIRED CONFIG)

include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-march=native" _march_native_works)
Expand Down
2 changes: 1 addition & 1 deletion chapter-03/recipe-01/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Abstract to be written ...

- [fortran-example](fortran-example/)
- [example](example/)
20 changes: 20 additions & 0 deletions chapter-03/recipe-01/example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# set minimum cmake version
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

# project name and language
project(recipe-01 LANGUAGES NONE)

# detect python
find_package(PythonInterp REQUIRED)

# Execute a tiny Python script
execute_process(
COMMAND
${PYTHON_EXECUTABLE} "-c" "print('Hello, world!')"
RESULT_VARIABLE _status
OUTPUT_VARIABLE _hello_world
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "RESULT_VARIABLE is: ${_status}")
message(STATUS "OUTPUT_VARIABLE is: ${_hello_world}")
9 changes: 0 additions & 9 deletions chapter-03/recipe-01/fortran-example/CMakeLists.txt

This file was deleted.

19 changes: 0 additions & 19 deletions chapter-03/recipe-01/fortran-example/hello-world.f90

This file was deleted.

17 changes: 0 additions & 17 deletions chapter-03/recipe-01/fortran-example/menu.yml

This file was deleted.

11 changes: 9 additions & 2 deletions chapter-03/recipe-02/c-example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)

add_executable(hello-embedded-python "")
if(PYTHON_VERSION_MAJOR VERSION_EQUAL 2)
add_executable(hello-embedded-python hello-embedded-python2.c)
target_sources(hello-embedded-python
PRIVATE
hello-embedded-python2.c
)
else()
add_executable(hello-embedded-python hello-embedded-python3.c)
target_sources(hello-embedded-python
PRIVATE
hello-embedded-python3.c
)
endif()

target_include_directories(hello-embedded-python
Expand Down
7 changes: 7 additions & 0 deletions chapter-03/recipe-02/c-example/menu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
appveyor:
env:
- VERBOSE_OUTPUT: 'True'
definitions:
- CMAKE_BUILD_TYPE: 'Release'
- CMAKE_CONFIGURATION_TYPES: 'Release'
- MS_WIN64: 'ON'
6 changes: 3 additions & 3 deletions chapter-03/recipe-03/cxx-example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(PythonInterp 2.7 REQUIRED)
find_package(PythonLibs 2.7 REQUIRED)
find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)

# Find NumPy location
execute_process(
Expand Down Expand Up @@ -39,7 +39,7 @@ find_package_handle_standard_args(NumPy
)

add_executable(pure-embedding "")
if (PYTHON_VERSION_MAJOR VERSION_LESS 3)
if(PYTHON_VERSION_MAJOR VERSION_LESS 3)
target_sources(pure-embedding
PRIVATE
Py2-pure-embedding.cpp
Expand Down
7 changes: 7 additions & 0 deletions chapter-03/recipe-03/cxx-example/menu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
appveyor:
env:
- VERBOSE_OUTPUT: 'True'
definitions:
- CMAKE_BUILD_TYPE: 'Release'
- CMAKE_CONFIGURATION_TYPES: 'Release'
- MS_WIN64: 'ON'
2 changes: 1 addition & 1 deletion chapter-03/recipe-07/cxx-example-3.5/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(OpenMP REQUIRED)

find_package(Eigen3 3.3 REQUIRED NO_MODULE)
find_package(Eigen3 3.3 REQUIRED CONFIG)
if(TARGET Eigen3::Eigen)
message(STATUS "Eigen3 version ${EIGEN3_VERSION_STRING} found in ${EIGEN3_INCLUDE_DIR}")
endif()
Expand Down
2 changes: 1 addition & 1 deletion chapter-03/recipe-07/cxx-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(OpenMP REQUIRED)

find_package(Eigen3 3.3 REQUIRED NO_MODULE)
find_package(Eigen3 3.3 REQUIRED CONFIG)
if(TARGET Eigen3::Eigen)
message(STATUS "Eigen3 version ${EIGEN3_VERSION_STRING} found in ${EIGEN3_INCLUDE_DIR}")
endif()
Expand Down
6 changes: 5 additions & 1 deletion chapter-03/recipe-08/cxx-example/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ appveyor:
env:
- BOOST_ROOT: 'C:\Libraries\boost_1_66_0'
- BOOST_INCLUDEDIR: 'C:\Libraries\boost_1_66_0'
- BOOST_LIBRARYDIR: 'C:\Libraries\boost_1_66_0\lib32-msvc-14.0'
- BOOST_LIBRARYDIR: 'C:\Libraries\boost_1_66_0\lib64-msvc-14.0'

travis-osx:
definitions:
- BOOST_ROOT: '/usr/local/opt/[email protected]'
4 changes: 4 additions & 0 deletions chapter-04/recipe-03/cxx-example-3.5/menu.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
appveyor:
definitions:
- gtest_disable_pthreads: 'ON'

targets:
- test
4 changes: 4 additions & 0 deletions chapter-04/recipe-03/cxx-example/menu.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
appveyor:
definitions:
- gtest_disable_pthreads: 'ON'

targets:
- test
10 changes: 10 additions & 0 deletions chapter-04/recipe-04/cxx-example/menu.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
appveyor:
env:
- BOOST_ROOT: 'C:\Libraries\boost_1_66_0'
- BOOST_INCLUDEDIR: 'C:\Libraries\boost_1_66_0'
- BOOST_LIBRARYDIR: 'C:\Libraries\boost_1_66_0\lib64-msvc-14.0'

travis-osx:
definitions:
- BOOST_ROOT: '/usr/local/opt/[email protected]'

targets:
- test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
find_package(Eigen3 3.3.4 QUIET NO_MODULE)
find_package(Eigen3 3.3.4 QUIET CONFIG)
if(TARGET Eigen3::Eigen)
message(STATUS "Found Eigen3: ${EIGEN3_INCLUDE_DIR} (found version ${EIGEN3_VERSION_STRING})")
add_library(eigen3_external INTERFACE) # dummy
Expand Down
2 changes: 1 addition & 1 deletion chapter-07/recipe-04/cxx-example-3.5/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(recipe-04_core LANGUAGES CXX)

find_package(OpenMP REQUIRED)

find_package(Eigen3 3.3.4 REQUIRED NO_MODULE)
find_package(Eigen3 3.3.4 REQUIRED CONFIG)
message(STATUS "Found Eigen3: ${EIGEN3_INCLUDE_DIR} (found version ${EIGEN3_VERSION_STRING})")

add_executable(linear-algebra linear-algebra.cpp)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
find_package(Eigen3 3.3.4 QUIET NO_MODULE)
find_package(Eigen3 3.3.4 QUIET CONFIG)
if(TARGET Eigen3::Eigen)
message(STATUS "Found Eigen3: ${EIGEN3_INCLUDE_DIR} (found version ${EIGEN3_VERSION_STRING})")
add_library(eigen3_external INTERFACE) # dummy
Expand Down
2 changes: 1 addition & 1 deletion chapter-07/recipe-04/cxx-example/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(recipe-04_core LANGUAGES CXX)

find_package(OpenMP REQUIRED)

find_package(Eigen3 3.3.4 REQUIRED NO_MODULE)
find_package(Eigen3 3.3.4 REQUIRED CONFIG)
message(STATUS "Found Eigen3: ${EIGEN3_INCLUDE_DIR} (found version ${EIGEN3_VERSION_STRING})")

add_executable(linear-algebra linear-algebra.cpp)
Expand Down
10 changes: 6 additions & 4 deletions chapter-09/recipe-04/cxx-example/menu.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
appveyor:
env:
- BOOST_INCLUDEDIR: 'C:\Libraries\boost_1_66_0\boost'
- BOOST_LIBRARYDIR: 'C:\Libraries\boost_1_66_0\lib32-msvc-14.0'

targets:
- test
- BOOST_LIBRARYDIR: 'C:\Libraries\boost_1_66_0\lib64-msvc-14.0'

travis-osx:
definitions:
- BOOST_ROOT: '/usr/local/opt/[email protected]'
failing_generators:
- 'Unix Makefiles'
- 'Ninja'

targets:
- test
13 changes: 8 additions & 5 deletions testing/collect_tests.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
from __future__ import print_function # Only Python 2.x

import datetime
import glob
import subprocess
import os
import re
import subprocess
import sys
import datetime
import time
import docopt

import colorama
import re
import docopt
from packaging import version

from env import (get_buildflags, get_ci_environment, get_generator,
verbose_output)
from parse import extract_menu_file
from env import get_ci_environment, get_generator, get_buildflags, verbose_output


def get_min_cmake_version(file_name):
Expand Down
3 changes: 1 addition & 2 deletions testing/dependencies/appveyor/install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ rem more packages
bash -lc "pacman -S --noconfirm mingw64/mingw-w64-x86_64-boost"
bash -lc "pacman -S --noconfirm mingw64/mingw-w64-x86_64-ninja"
bash -lc "pacman -S --noconfirm mingw64/mingw-w64-x86_64-openblas"
bash -lc "pacman -S --noconfirm mingw64/mingw-w64-x86_64-eigen3"
bash -lc "pacman -S --noconfirm mingw64/mingw-w64-x86_64-hdf5"
bash -lc "pacman -S --noconfirm mingw64/mingw-w64-x86_64-eigen3"
1 change: 0 additions & 1 deletion testing/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ travis-osx:
- CMAKE_C_COMPILER: 'clang'
- CMAKE_CXX_COMPILER: 'clang++'
- CMAKE_Fortran_COMPILER: 'gfortran'
- BOOST_ROOT: '/usr/local/opt/[email protected]'

local:
definitions:
Expand Down

0 comments on commit 068ac09

Please sign in to comment.