Skip to content

Commit

Permalink
Axe HDF5 superbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
robertodr committed Aug 7, 2018
1 parent 175d142 commit 780469e
Show file tree
Hide file tree
Showing 29 changed files with 130 additions and 589 deletions.
1 change: 1 addition & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ cache:

install:
- python -m pip install pipenv
- bash -c "pacman -Ss mercurial"
- '%APPVEYOR_BUILD_FOLDER%\testing\dependencies\appveyor\install.bat'
- ps: .$env:APPVEYOR_BUILD_FOLDER\testing\dependencies\appveyor\anaconda.ps1
- ps: .$env:APPVEYOR_BUILD_FOLDER\testing\dependencies\appveyor\install-msmpi.ps1
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@
- [Managing dependencies with a superbuild I. The Boost libraries](chapter-08/recipe-02/README.md)
- [Managing dependencies with a superbuild II. The FFTW library](chapter-08/recipe-03/README.md)
- [Managing dependencies with a superbuild III. The Eigen library](chapter-08/recipe-04/README.md)
- [Managing dependencies with a superbuild IV. The HDF5 library](chapter-08/recipe-05/README.md)
- [Managing your project as a superbuild](chapter-08/recipe-06/README.md)
- [Managing your project as a superbuild](chapter-08/recipe-05/README.md)


### [Chapter 9: Mixed-language Projects](chapter-09/README.md)
Expand Down
3 changes: 1 addition & 2 deletions chapter-08/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
- [Managing dependencies with a superbuild I. The Boost libraries](recipe-02/README.md)
- [Managing dependencies with a superbuild II. The FFTW library](recipe-03/README.md)
- [Managing dependencies with a superbuild III. The Eigen library](recipe-04/README.md)
- [Managing dependencies with a superbuild IV. The HDF5 library](recipe-05/README.md)
- [Managing your project as a superbuild](recipe-06/README.md)
- [Managing your project as a superbuild](recipe-05/README.md)
21 changes: 21 additions & 0 deletions chapter-08/recipe-03/c-example/menu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
appveyor-vs:
definitions:
- FFTW3_FORCE_SUPERBUILD: 'ON'

appveyor-msys:
definitions:
- FFTW3_FORCE_SUPERBUILD: 'ON'

travis-linux:
definitions:
- FFTW3_FORCE_SUPERBUILD: 'ON'

travis-osx:
definitions:
- FFTW3_FORCE_SUPERBUILD: 'ON'

local:
definitions:
- FFTW3_FORCE_SUPERBUILD: 'ON'
env:
- VERBOSE_OUTPUT: 'ON'
4 changes: 4 additions & 0 deletions chapter-08/recipe-04/cxx-example-3.5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set_property(DIRECTORY PROPERTY EP_BASE ${CMAKE_BINARY_DIR}/subprojects)

option(Eigen3_FORCE_SUPERBUILD "Always build Eigen3 on our own" OFF)

add_subdirectory(external/upstream)

include(ExternalProject)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
find_package(Eigen3 3.3.4 QUIET CONFIG)
if(TARGET Eigen3::Eigen)
if(TARGET Eigen3::Eigen AND (NOT Eigen3_FORCE_SUPERBUILD))
message(STATUS "Found Eigen3: ${EIGEN3_INCLUDE_DIR} (found version ${EIGEN3_VERSION_STRING})")
add_library(eigen3_external INTERFACE) # dummy
else()
message(STATUS "Suitable Eigen3 could not be located. Downloading and building!")
if(Eigen3_FORCE_SUPERBUILD)
message(STATUS "Forcing superbuild of Eigen3.")
else()
message(STATUS "Suitable Eigen3 could not be located. Downloading and building!")
endif()
include(ExternalProject)
ExternalProject_Add(eigen3_external
HG_REPOSITORY
Expand Down
20 changes: 20 additions & 0 deletions chapter-08/recipe-04/cxx-example-3.5/menu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
appveyor-vs:
definitions:
- Eigen3_FORCE_SUPERBUILD: 'ON'

appveyor-msys:
definitions:
- Eigen3_FORCE_SUPERBUILD: 'ON'

travis-linux:
definitions:
- Eigen3_FORCE_SUPERBUILD: 'ON'

# OpenMP does not work with clang
travis-osx:
definitions:
- Eigen3_FORCE_SUPERBUILD: 'ON'
failing_generators:
- 'Unix Makefiles'
- 'Ninja'

local:
definitions:
- Eigen3_FORCE_SUPERBUILD: 'ON'
env:
- VERBOSE_OUTPUT: 'ON'
4 changes: 4 additions & 0 deletions chapter-08/recipe-04/cxx-example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set_property(DIRECTORY PROPERTY EP_BASE ${CMAKE_BINARY_DIR}/subprojects)

option(Eigen3_FORCE_SUPERBUILD "Always build Eigen3 on our own" OFF)

add_subdirectory(external/upstream)

include(ExternalProject)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
find_package(Eigen3 3.3.4 QUIET CONFIG)
if(TARGET Eigen3::Eigen)
if(TARGET Eigen3::Eigen AND (NOT Eigen3_FORCE_SUPERBUILD))
message(STATUS "Found Eigen3: ${EIGEN3_INCLUDE_DIR} (found version ${EIGEN3_VERSION_STRING})")
add_library(eigen3_external INTERFACE) # dummy
else()
message(STATUS "Suitable Eigen3 could not be located. Downloading and building!")
if(Eigen3_FORCE_SUPERBUILD)
message(STATUS "Forcing superbuild of Eigen3.")
else()
message(STATUS "Suitable Eigen3 could not be located. Downloading and building!")
endif()
include(ExternalProject)
ExternalProject_Add(eigen3_external
HG_REPOSITORY
https://bitbucket.org/eigen/eigen
HG_TAG
GIT_REPOSITORY
https://github.com/eigenteam/eigen-git-mirror.git
GIT_TAG
3.3.4
UPDATE_COMMAND
""
Expand Down
20 changes: 20 additions & 0 deletions chapter-08/recipe-04/cxx-example/menu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
appveyor-vs:
definitions:
- Eigen3_FORCE_SUPERBUILD: 'ON'

appveyor-msys:
definitions:
- Eigen3_FORCE_SUPERBUILD: 'ON'

travis-linux:
definitions:
- Eigen3_FORCE_SUPERBUILD: 'ON'

# OpenMP does not work with clang
travis-osx:
definitions:
- Eigen3_FORCE_SUPERBUILD: 'ON'
failing_generators:
- 'Unix Makefiles'
- 'Ninja'

local:
definitions:
- Eigen3_FORCE_SUPERBUILD: 'ON'
env:
- VERBOSE_OUTPUT: 'ON'
9 changes: 8 additions & 1 deletion chapter-08/recipe-04/cxx-example/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,12 @@ add_executable(linear-algebra linear-algebra.cpp)
target_link_libraries(linear-algebra
PUBLIC
Eigen3::Eigen
OpenMP::OpenMP_CXX
)
set_target_properties(
linear-algebra
PROPERTIES
COMPILE_FLAGS
${OpenMP_CXX_FLAGS}
LINK_FLAGS
${OpenMP_CXX_FLAGS}
)
4 changes: 2 additions & 2 deletions chapter-08/recipe-05/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Managing dependencies with a superbuild IV. The HDF5 library
# Managing your project as a superbuild

Abstract to be written ...

- [fortran-example](fortran-example/)
- [cxx-example](cxx-example/)
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,31 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(NOT DEFINED CMAKE_BUILD_TYPE OR "${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
endif()
message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}")

set_property(DIRECTORY PROPERTY EP_BASE ${CMAKE_BINARY_DIR}/subprojects)

add_subdirectory(external/upstream)

include(ExternalProject)

ExternalProject_Add(${PROJECT_NAME}_core
DEPENDS
message_external
SOURCE_DIR
${CMAKE_CURRENT_SOURCE_DIR}/src
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}
-DCMAKE_CXX_STANDARD_REQUIRED=${CMAKE_CXX_STANDARD_REQUIRED}
-Dmessage_DIR=${message_DIR}
CMAKE_CACHE_ARGS
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
BUILD_ALWAYS
1
INSTALL_COMMAND
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
find_package(message 1 CONFIG QUIET)
if(message_FOUND)
get_property(_loc TARGET message::message PROPERTY LOCATION)
get_property(_loc TARGET message::message-shared PROPERTY LOCATION)
message(STATUS "Found message: ${_loc} (found version ${message_VERSION})")
add_library(message_external INTERFACE) # dummy
else()
Expand All @@ -15,10 +15,19 @@ else()
""
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
CMAKE_CACHE_ARGS
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
TEST_AFTER_INSTALL
1
)
set(message_DIR ${DEPS_INSTALL_PREFIX}/share/cmake/message
CACHE PATH "Path to internally built messageConfig.cmake" FORCE)
if(WIN32 AND NOT CYGWIN)
set(DEF_message_DIR ${STAGED_INSTALL_PREFIX}/CMake)
else()
set(DEF_message_DIR ${STAGED_INSTALL_PREFIX}/share/cmake)
endif()
file(TO_NATIVE_PATH "${DEF_message_DIR}/message" DEF_message_DIR)
set(message_DIR ${DEF_message_DIR}
CACHE PATH "Path to internally built messageConfig.cmake" FORCE)
endif()
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)

project(recipe-06_core LANGUAGES CXX)
project(recipe-05_core
LANGUAGES CXX
)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(message 1 CONFIG REQUIRED)
get_property(_loc TARGET message::message PROPERTY LOCATION)
get_property(_loc TARGET message::message-shared PROPERTY LOCATION)
message(STATUS "Found message: ${_loc} (found version ${message_VERSION})")

add_executable(use_message use_message.cpp)

target_link_libraries(use_message
PUBLIC
message::message
message::message-shared
)
22 changes: 0 additions & 22 deletions chapter-08/recipe-05/fortran-example/CMakeLists.txt

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 780469e

Please sign in to comment.