Skip to content

Commit a1ecfd8

Browse files
committed
[cmake] Prepare packaging for 2.1.0 release
1 parent 816bdcb commit a1ecfd8

File tree

4 files changed

+30
-14
lines changed

4 files changed

+30
-14
lines changed

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Start configuration
2-
cmake_minimum_required(VERSION 2.8)
3-
project(dft_tools C CXX Fortran)
2+
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
3+
project(triqs_dft_tools C CXX Fortran)
44
if(POLICY CMP0074)
55
cmake_policy(SET CMP0074 NEW)
66
endif()
@@ -9,7 +9,7 @@ endif()
99
if(NOT CMAKE_BUILD_TYPE)
1010
set(CMAKE_BUILD_TYPE Release CACHE STRING "Type of build" FORCE)
1111
endif()
12-
message( STATUS "-------- BUILD-TYPE: ${CMAKE_BUILD_TYPE} -------------")
12+
message( STATUS "-------- BUILD-TYPE: ${CMAKE_BUILD_TYPE} --------")
1313

1414
# Use shared libraries
1515
set(BUILD_SHARED_LIBS ON)
@@ -98,6 +98,7 @@ if(BUILD_DEBIAN_PACKAGE)
9898
SET(CPACK_PACKAGE_CONTACT "https://github.com/TRIQS/dft_tools")
9999
EXECUTE_PROCESS(COMMAND dpkg --print-architecture OUTPUT_VARIABLE CMAKE_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
100100
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "triqs (>= 2.1)")
101+
SET(CPACK_DEBIAN_PACKAGE_CONFLICTS "dft_tools")
101102
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
102103
SET(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
103104
INCLUDE(CPack)

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# See ../triqs/packaging for other options
22
FROM flatironinstitute/triqs:master-ubuntu-clang
33

4-
ARG APPNAME=dft_tools
4+
ARG APPNAME
55
COPY . $SRC/$APPNAME
66
WORKDIR $BUILD/$APPNAME
77
RUN chown build .

Jenkinsfile

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
def projectName = "dft_tools"
1+
def projectName = "dft_tools" /* set to app/repo name */
2+
3+
/* which platform to build documentation on */
24
def documentationPlatform = "ubuntu-clang"
5+
/* depend on triqs upstream branch/project */
36
def triqsBranch = env.CHANGE_TARGET ?: env.BRANCH_NAME
47
def triqsProject = '/TRIQS/triqs/' + triqsBranch.replaceAll('/', '%2F')
8+
/* whether to publish the results (disabled for template project) */
59
def publish = !env.BRANCH_NAME.startsWith("PR-")
610

711
properties([
@@ -18,6 +22,8 @@ properties([
1822
/* map of all builds to run, populated below */
1923
def platforms = [:]
2024

25+
/****************** linux builds (in docker) */
26+
/* Each platform must have a cooresponding Dockerfile.PLATFORM in triqs/packaging */
2127
def dockerPlatforms = ["ubuntu-clang", "ubuntu-gcc", "centos-gcc"]
2228
/* .each is currently broken in jenkins */
2329
for (int i = 0; i < dockerPlatforms.size(); i++) {
@@ -27,11 +33,11 @@ for (int i = 0; i < dockerPlatforms.size(); i++) {
2733
checkout scm
2834
/* construct a Dockerfile for this base */
2935
sh """
30-
( echo "FROM flatironinstitute/triqs:${triqsBranch}-${env.STAGE_NAME}" ; sed '0,/^FROM /d' Dockerfile ) > Dockerfile.jenkins
36+
( echo "FROM flatironinstitute/triqs:${triqsBranch}-${env.STAGE_NAME}" ; sed '0,/^FROM /d' Dockerfile ) > Dockerfile.jenkins
3137
mv -f Dockerfile.jenkins Dockerfile
3238
"""
3339
/* build and tag */
34-
def img = docker.build("flatironinstitute/${projectName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg BUILD_DOC=${platform==documentationPlatform} .")
40+
def img = docker.build("flatironinstitute/${projectName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_DOC=${platform==documentationPlatform} .")
3541
if (!publish || platform != documentationPlatform) {
3642
/* but we don't need the tag so clean it up (except for documentation) */
3743
sh "docker rmi --no-prune ${img.imageName()}"
@@ -40,6 +46,7 @@ for (int i = 0; i < dockerPlatforms.size(); i++) {
4046
} }
4147
}
4248

49+
/****************** osx builds (on host) */
4350
def osxPlatforms = [
4451
["gcc", ['CC=gcc-7', 'CXX=g++-7']],
4552
["clang", ['CC=$BREW/opt/llvm/bin/clang', 'CXX=$BREW/opt/llvm/bin/clang++', 'CXXFLAGS=-I$BREW/opt/llvm/include', 'LDFLAGS=-L$BREW/opt/llvm/lib']]
@@ -61,9 +68,9 @@ for (int i = 0; i < osxPlatforms.size(); i++) {
6168
checkout scm
6269
dir(buildDir) { withEnv(platformEnv[1].collect { it.replace('\$BREW', env.BREW) } + [
6370
"PATH=$triqsDir/bin:${env.BREW}/bin:/usr/bin:/bin:/usr/sbin",
64-
"CPATH=$triqsDir/include:${env.BREW}/include",
71+
"CPLUS_INCLUDE_PATH=$triqsDir/include:${env.BREW}/include",
6572
"LIBRARY_PATH=$triqsDir/lib:${env.BREW}/lib",
66-
"CMAKE_PREFIX_PATH=$triqsDir/lib/cmake/triqs"]) {
73+
"CMAKE_PREFIX_PATH=$triqsDir/lib/cmake/triqs"]) {
6774
deleteDir()
6875
sh "cmake $srcDir -DCMAKE_INSTALL_PREFIX=$installDir -DTRIQS_ROOT=$triqsDir"
6976
sh "make -j3"
@@ -79,18 +86,22 @@ for (int i = 0; i < osxPlatforms.size(); i++) {
7986
} }
8087
}
8188

89+
/****************** wrap-up */
8290
try {
8391
parallel platforms
8492
if (publish) { node("docker") {
93+
/* Publish results */
8594
stage("publish") { timeout(time: 1, unit: 'HOURS') {
8695
def commit = sh(returnStdout: true, script: "git rev-parse HEAD").trim()
96+
def release = env.BRANCH_NAME == "master" || env.BRANCH_NAME == "unstable" || sh(returnStdout: true, script: "git describe --exact-match HEAD || true").trim()
8797
def workDir = pwd()
98+
/* Update documention on gh-pages branch */
8899
dir("$workDir/gh-pages") {
89100
def subdir = "${projectName}/${env.BRANCH_NAME}"
90101
git(url: "ssh://[email protected]/TRIQS/TRIQS.github.io.git", branch: "master", credentialsId: "ssh", changelog: false)
91102
sh "rm -rf ${subdir}"
92103
docker.image("flatironinstitute/${projectName}:${env.BRANCH_NAME}-${documentationPlatform}").inside() {
93-
sh "cp -rp \$INSTALL/share/doc/${projectName} ${subdir}"
104+
sh "cp -rp \$INSTALL/share/doc/triqs_${projectName} ${subdir}"
94105
}
95106
sh "git add -A ${subdir}"
96107
sh """
@@ -99,20 +110,24 @@ try {
99110
// note: credentials used above don't work (need JENKINS-28335)
100111
sh "git push origin master || { git pull --rebase origin master && git push origin master ; }"
101112
}
102-
dir("$workDir/docker") { try {
113+
/* Update docker repo submodule */
114+
if (release) { dir("$workDir/docker") { try {
103115
git(url: "ssh://[email protected]/TRIQS/docker.git", branch: env.BRANCH_NAME, credentialsId: "ssh", changelog: false)
104-
sh "echo '160000 commit ${commit}\t${projectName}' | git update-index --index-info"
116+
sh "test -d ${projectName}"
117+
sh "echo '160000 commit ${commit}\ttriqs_${projectName}' | git update-index --index-info"
105118
sh """
106119
git commit --author='Flatiron Jenkins <[email protected]>' --allow-empty -m 'Autoupdate ${projectName}' -m '${env.BUILD_TAG}'
107120
"""
108121
// note: credentials used above don't work (need JENKINS-28335)
109122
sh "git push origin ${env.BRANCH_NAME} || { git pull --rebase origin ${env.BRANCH_NAME} && git push origin ${env.BRANCH_NAME} ; }"
110123
} catch (err) {
124+
/* Ignore, non-critical -- might not exist on this branch */
111125
echo "Failed to update docker repo"
112-
} }
126+
} } }
113127
} }
114128
} }
115129
} catch (err) {
130+
/* send email on build failure (declarative pipeline's post section would work better) */
116131
if (env.BRANCH_NAME != "jenkins") emailext(
117132
subject: "\$PROJECT_NAME - Build # \$BUILD_NUMBER - FAILED",
118133
body: """\$PROJECT_NAME - Build # \$BUILD_NUMBER - FAILED

doc/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A Docker image including the latest version of DFTTools is available `here <http
1010

1111
We further provide a Debian package for the Ubuntu LTS Versions 16.04 (xenial) and 18.04 (bionic), which can be installed by following the steps outlined :ref:`here <triqslibs:triqs_docker>`, and the subsequent command::
1212

13-
sudo apt-get install -y dft_tools
13+
sudo apt-get install -y triqs_dft_tools
1414

1515

1616
Compiling DFTTools from source

0 commit comments

Comments
 (0)