Skip to content

Commit

Permalink
Merge pull request #185 from ess-dmsc/issue_184
Browse files Browse the repository at this point in the history
Issue 184
  • Loading branch information
Martin Shetty authored Dec 22, 2017
2 parents 6b29d8a + d933b11 commit 935ec4e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 38 deletions.
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ project(h5cpp
set(EXTRA_MODULES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
list(APPEND CMAKE_MODULE_PATH ${EXTRA_MODULES_DIR})

#=============================================================================
# ensure build type first
#=============================================================================

include(${EXTRA_MODULES_DIR}/CoverageReports.cmake)
include(${EXTRA_MODULES_DIR}/EnsureBuildType.cmake)

#=============================================================================
# setting up conan for use from within cmake
#=============================================================================
set(WITH_CONAN OFF CACHE BOOL "Enable dependency build with conan")
set(CONAN_FILE "conanfile_default.txt" CACHE STRING "The conanfile to use for the build")

if (WITH_CONAN)

include(${EXTRA_MODULES_DIR}/ConanSetup.cmake)
conan_cmake_run(CONANFILE ${CONAN_FILE}
BASIC_SETUP
Expand All @@ -24,16 +30,13 @@ endif ()
if (EXISTS ${PROJECT_BINARY_DIR}/conanbuildinfo.cmake)
message(STATUS "Using existing conanbuildinfo.cmake file")
include(${PROJECT_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
conan_basic_setup(KEEP_RPATHS)
endif ()


#=============================================================================
# some general configuration
#=============================================================================

include(${EXTRA_MODULES_DIR}/CoverageReports.cmake)
include(${EXTRA_MODULES_DIR}/EnsureBuildType.cmake)
include(${EXTRA_MODULES_DIR}/InstallConfig.cmake)
include(${EXTRA_MODULES_DIR}/OutputDirConfig.cmake)
include(${EXTRA_MODULES_DIR}/WindowsUtils.cmake)
Expand Down
49 changes: 23 additions & 26 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ project = "h5cpp"

images = [
'centos': [
'name': 'essdmscdm/centos-build-node:0.9.0',
'name': 'essdmscdm/centos-build-node:0.9.4',
'sh': 'sh'
],
'centos-gcc6': [
'name': 'essdmscdm/centos-gcc6-build-node:0.3.0',
'name': 'essdmscdm/centos-gcc6-build-node:0.3.4',
'sh': '/usr/bin/scl enable rh-python35 devtoolset-6 -- /bin/bash'
],
'fedora': [
'name': 'essdmscdm/fedora-build-node:0.4.1',
'name': 'essdmscdm/fedora-build-node:0.4.2',
'sh': 'sh'
],
'ubuntu1604': [
'name': 'essdmscdm/ubuntu16.04-build-node:0.0.1',
'name': 'essdmscdm/ubuntu16.04-build-node:0.0.2',
'sh': 'sh'
],
'ubuntu1710': [
'name': 'essdmscdm/ubuntu17.10-build-node:0.0.2',
'name': 'essdmscdm/ubuntu17.10-build-node:0.0.3',
'sh': 'sh'
]
]
Expand Down Expand Up @@ -46,10 +46,6 @@ def docker_dependencies(image_key) {
sh """docker exec ${container_name(image_key)} ${custom_sh} -c \"
mkdir build
cd build
conan --version
set +x
conan remote add \
desy-packages https://api.bintray.com/conan/eugenwintersberger/desy-packages
conan remote add \
--insert 0 \
${conan_remote} ${local_conan_server}
Expand All @@ -63,7 +59,7 @@ def docker_cmake(image_key) {
sh """docker exec ${container_name(image_key)} ${custom_sh} -c \"
cd build
${cmake_exec} --version
${cmake_exec} -DCONAN_FILE=conanfile_ess.txt -DCMAKE_BUILD_TYPE=Release ../${project}
${cmake_exec} ../${project}
\""""
}

Expand Down Expand Up @@ -108,6 +104,7 @@ def Object get_container(image_key) {
def get_pipeline(image_key)
{
return {
node('docker && dmbuild03.dm.esss.dk') {
stage("${image_key}") {
try {
def container = get_container(image_key)
Expand Down Expand Up @@ -147,6 +144,7 @@ def get_pipeline(image_key)
sh "docker rm -f ${container_name(image_key)}"
}
}
}
}
}

Expand All @@ -167,16 +165,23 @@ def get_osx_pipeline()
}

dir("${project}/build") {
try {
sh "conan install --file=../code/conanfile_ess.txt --build=missing"
} catch (e) {
failure_function(e, 'MacOSX / getting dependencies failed')
}

try {
sh "cmake ../code"
} catch (e) {
failure_function(e, 'MacOSX / CMake failed')
}

try {
sh "make h5cpp_shared"
sh "make run_tests"
} catch (e) {
failure_function(e, 'MacOSX / build failed')
junit 'test/unit_tests_run.xml'
failure_function(e, 'MacOSX / build+test failed')
}
}

Expand All @@ -185,11 +190,7 @@ def get_osx_pipeline()
}
}

node('docker && dmbuild03.dm.esss.dk') {

// Delete workspace when build is done
cleanWs()

node {
stage('Checkout') {
dir("${project}/code") {
try {
Expand All @@ -201,19 +202,16 @@ node('docker && dmbuild03.dm.esss.dk') {
}

def builders = [:]
builders['centos'] = get_pipeline('centos')
builders['centos-gcc6'] = get_pipeline('centos-gcc6')
builders['fedora'] = get_pipeline('fedora')
builders['ubuntu1604'] = get_pipeline('ubuntu1604')
builders['MocOSX'] = get_osx_pipeline()

/*
for (x in images.keySet()) {
def image_key = x
builders[image_key] = get_pipeline(image_key)
}
*/
builders['MocOSX'] = get_osx_pipeline()

parallel builders

// Delete workspace when build is done
cleanWs()
}

node ("fedora") {
Expand Down Expand Up @@ -302,5 +300,4 @@ node ("fedora") {
}
}
}

}
6 changes: 1 addition & 5 deletions cmake/InstallConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ elseif(CMAKE_SYSTEM_NAME MATCHES Darwin)
# on OSX we can also use GNUInstallDirs module to
# determine the installation paths
include(GNUInstallDirs)

message(STATUS "==============================================================")
message(STATUS "Installation directories for MacOSX: ")

set(CMAKE_INSTALL_DOCDIR ${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}-${PROJECT_VERSION})

elseif(CMAKE_SYSTEM_NAME MATCHES Windows)
Expand All @@ -44,10 +44,6 @@ elseif(CMAKE_SYSTEM_NAME MATCHES Windows)

message(STATUS "==============================================================")
message(STATUS "Installation directories for Windows: ")

elseif(CMAKE_SYSTEM_NAME MATCHES Darwin)

# add here configuration for OSX

endif()

Expand Down
3 changes: 1 addition & 2 deletions conanfile_ess.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[requires]
Boost/1.62.0@ess-dmsc/stable
hdf5/1.10.1-dm1@ess-dmsc/stable
hdf5/1.10.1-dm3@ess-dmsc/testing
gtest/3121b20-dm1@ess-dmsc/testing
#zlib/1.2.8@conan/stable
cmake_installer/1.0@conan/stable

[generators]
Expand Down

0 comments on commit 935ec4e

Please sign in to comment.