From c2a4685719359a7d906f4d23895636e9184470c4 Mon Sep 17 00:00:00 2001 From: Dylan Simon Date: Mon, 15 Jun 2020 10:20:40 -0400 Subject: [PATCH 1/5] [jenkins] bring into closer alignment with triqs --- Jenkinsfile | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6e7fffbf..754e16a6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,7 @@ for (int i = 0; i < dockerPlatforms.size(); i++) { mv -f Dockerfile.jenkins Dockerfile """ /* build and tag */ - def img = docker.build("flatironinstitute/${dockerName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_DOC=${platform==documentationPlatform} .") + def img = docker.build("flatironinstitute/${dockerName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_DOC=${platform==documentationPlatform} --build-arg BUILD_ID=${env.BUILD_TAG} .") catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') { img.inside() { sh "make -C \$BUILD/${projectName} test CTEST_OUTPUT_ON_FAILURE=1" @@ -64,6 +64,7 @@ for (int i = 0; i < osxPlatforms.size(); i++) { def srcDir = pwd() def tmpDir = pwd(tmp:true) def buildDir = "$tmpDir/build" + /* install real branches in a fixed predictable place so apps can find them */ def installDir = keepInstall ? "${env.HOME}/install/${projectName}/${env.BRANCH_NAME}/${platform}" : "$tmpDir/install" def triqsDir = "${env.HOME}/install/triqs/${triqsBranch}/${platform}" dir(installDir) { @@ -71,15 +72,21 @@ for (int i = 0; i < osxPlatforms.size(); i++) { } checkout scm + + def hdf5 = "${env.BREW}/opt/hdf5@1.10" dir(buildDir) { withEnv(platformEnv[1].collect { it.replace('\$BREW', env.BREW) } + [ - "PATH=$triqsDir/bin:${env.BREW}/bin:/usr/bin:/bin:/usr/sbin", - "CPLUS_INCLUDE_PATH=$triqsDir/include:${env.BREW}/include", - "LIBRARY_PATH=$triqsDir/lib:${env.BREW}/lib", - "CMAKE_PREFIX_PATH=$triqsDir/lib/cmake/triqs"]) { + "PATH=$triqsDir/bin:${env.BREW}/bin:/usr/bin:/bin:/usr/sbin", + "HDF5_ROOT=$hdf5", + "C_INCLUDE_PATH=$hdf5/include:${env.BREW}/include", + "CPLUS_INCLUDE_PATH=$triqsDir/include:$hdf5/include:${env.BREW}/include", + "LIBRARY_PATH=$triqsDir/lib:$hdf5/lib:${env.BREW}/lib", + "LD_LIBRARY_PATH=$hdf5/lib", + "PYTHONPATH=$installDir/lib/python3.7/site-packages", + "CMAKE_PREFIX_PATH=$triqsDir/lib/cmake/triqs"]) { deleteDir() /* note: this is installing into the parent (triqs) venv (install dir), which is thus shared among apps and so not be completely safe */ - sh "pip3 install -r $srcDir/requirements.txt" - sh "cmake $srcDir -DCMAKE_INSTALL_PREFIX=$installDir -DTRIQS_ROOT=$triqsDir" + sh "pip3 install -U -r $srcDir/requirements.txt" + sh "cmake $srcDir -DCMAKE_INSTALL_PREFIX=$installDir -DTRIQS_ROOT=$triqsDir -DBuild_Deps=Always" sh "make -j2" catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') { try { sh "make test CTEST_OUTPUT_ON_FAILURE=1" From c99d08cbc00f2240c466b30c9a9483399c86c52a Mon Sep 17 00:00:00 2001 From: Dylan Simon Date: Mon, 15 Jun 2020 10:27:45 -0400 Subject: [PATCH 2/5] [jenkins] more alignment with triqs --- Jenkinsfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 754e16a6..3d7ff1e5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -67,6 +67,7 @@ for (int i = 0; i < osxPlatforms.size(); i++) { /* install real branches in a fixed predictable place so apps can find them */ def installDir = keepInstall ? "${env.HOME}/install/${projectName}/${env.BRANCH_NAME}/${platform}" : "$tmpDir/install" def triqsDir = "${env.HOME}/install/triqs/${triqsBranch}/${platform}" + def venv = triqsDir dir(installDir) { deleteDir() } @@ -75,14 +76,14 @@ for (int i = 0; i < osxPlatforms.size(); i++) { def hdf5 = "${env.BREW}/opt/hdf5@1.10" dir(buildDir) { withEnv(platformEnv[1].collect { it.replace('\$BREW', env.BREW) } + [ - "PATH=$triqsDir/bin:${env.BREW}/bin:/usr/bin:/bin:/usr/sbin", + "PATH=$venv/bin:${env.BREW}/bin:/usr/bin:/bin:/usr/sbin", "HDF5_ROOT=$hdf5", "C_INCLUDE_PATH=$hdf5/include:${env.BREW}/include", - "CPLUS_INCLUDE_PATH=$triqsDir/include:$hdf5/include:${env.BREW}/include", - "LIBRARY_PATH=$triqsDir/lib:$hdf5/lib:${env.BREW}/lib", + "CPLUS_INCLUDE_PATH=$venv/include:$hdf5/include:${env.BREW}/include", + "LIBRARY_PATH=$venv/lib:$hdf5/lib:${env.BREW}/lib", "LD_LIBRARY_PATH=$hdf5/lib", "PYTHONPATH=$installDir/lib/python3.7/site-packages", - "CMAKE_PREFIX_PATH=$triqsDir/lib/cmake/triqs"]) { + "CMAKE_PREFIX_PATH=$venv/lib/cmake/triqs"]) { deleteDir() /* note: this is installing into the parent (triqs) venv (install dir), which is thus shared among apps and so not be completely safe */ sh "pip3 install -U -r $srcDir/requirements.txt" From fe53a65b5f009aa23271d5170b8dc50cdea3b276 Mon Sep 17 00:00:00 2001 From: Dylan Simon Date: Mon, 15 Jun 2020 10:35:10 -0400 Subject: [PATCH 3/5] [jenkins] align Dockerfile to triqs, too --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 53b08de2..99350f0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ WORKDIR $BUILD/$APPNAME RUN chown build . USER build ARG BUILD_DOC=0 -RUN cmake $SRC/$APPNAME -DTRIQS_ROOT=${INSTALL} -DBuild_Documentation=${BUILD_DOC} && make -j2 || make -j1 VERBOSE=1 +ARG BUILD_ID +RUN cmake $SRC/$APPNAME -DTRIQS_ROOT=${INSTALL} -DBuild_Documentation=${BUILD_DOC} -DBuild_Deps=Always && make -j2 || make -j1 VERBOSE=1 USER root RUN make install From 853ebf2d6a0674f607be7076492847e3e73b8d11 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Thu, 18 Jun 2020 13:58:55 -0400 Subject: [PATCH 4/5] [cmake] No longer add '-Og' for debug builds --- CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e42c001e..14385490 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,10 +93,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Global compiler options option(BUILD_SHARED_LIBS "Enable compilation of shared libraries" OFF) -add_compile_options( - $<$:-Og> - $<$:-ggdb3> -) +add_compile_options($<$:-ggdb3>) # Create an Interface target for compiler warnings add_library(${PROJECT_NAME}_warnings INTERFACE) From 81096e417e994e17a8c00340998b294de452af5b Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Thu, 18 Jun 2020 17:10:15 -0400 Subject: [PATCH 5/5] [cmake] Properly set PATH environment for c++2rst custom command --- doc/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index efd0c2ca..bde5a81c 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -14,7 +14,8 @@ macro(generate_docs header_file) COMMAND rm -rf ${CMAKE_CURRENT_SOURCE_DIR}/cpp2rst_generated COMMAND PYTHONPATH=${CPP2PY_BINARY_DIR}:$ENV{PYTHONPATH} - ${CPP2PY_BINARY_DIR}/bin/c++2rst + PATH=${CPP2PY_BINARY_DIR}/bin:${CPP2PY_ROOT}/bin:$ENV{PATH} + c++2rst ${header_file} -N ${PROJECT_NAME} --output_directory ${CMAKE_CURRENT_SOURCE_DIR}/cpp2rst_generated