3
0
mirror of https://github.com/triqs/dft_tools synced 2024-06-29 00:15:00 +02:00

Merge remote-tracking branch 'app4triqs-remote/unstable' into unstable

This commit is contained in:
Nils Wentzell 2021-06-03 15:03:37 -04:00
commit 755381be4b
6 changed files with 41 additions and 39 deletions

View File

@ -14,9 +14,9 @@ jobs:
matrix:
include:
- {os: ubuntu-20.04, cc: gcc-10, cxx: g++-10}
- {os: ubuntu-20.04, cc: clang-10, cxx: clang++-10}
- {os: macos-10.15, cc: gcc-10, cxx: g++-10}
- {os: macos-10.15, cc: /usr/local/opt/llvm/bin/clang, cxx: /usr/local/opt/llvm/bin/clang++}
- {os: ubuntu-20.04, cc: clang-12, cxx: clang++-12}
- {os: macos-11, cc: gcc-11, cxx: g++-11}
- {os: macos-11, cc: /usr/local/opt/llvm/bin/clang, cxx: /usr/local/opt/llvm/bin/clang++}
runs-on: ${{ matrix.os }}
@ -27,18 +27,20 @@ jobs:
if: matrix.os == 'ubuntu-20.04'
run: >
sudo apt-get update &&
sudo apt-get install lsb-release wget software-properties-common &&
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && sudo chmod +x /tmp/llvm.sh && sudo /tmp/llvm.sh 12 &&
sudo apt-get install
clang-10
clang-12
g++-10
gfortran-10
hdf5-tools
libblas-dev
libboost-dev
libclang-10-dev
libc++-10-dev
libc++abi-10-dev
libclang-12-dev
libc++-12-dev
libc++abi-12-dev
libfftw3-dev
libgfortran4
libgfortran5
libgmp-dev
libhdf5-dev
liblapack-dev
@ -46,7 +48,7 @@ jobs:
openmpi-bin
openmpi-common
openmpi-doc
python3-clang-10
python3-clang-12
python3-dev
python3-mako
python3-matplotlib
@ -58,9 +60,9 @@ jobs:
python3-nbsphinx
- name: Install homebrew dependencies
if: matrix.os == 'macos-10.15'
if: matrix.os == 'macos-11'
run: |
brew install gcc@10 llvm boost fftw hdf5 open-mpi openblas
brew install gcc@11 llvm boost fftw hdf5 open-mpi openblas
pip3 install mako numpy scipy mpi4py
pip3 install -r requirements.txt
@ -83,8 +85,8 @@ jobs:
LIBRARY_PATH: /usr/local/opt/llvm/lib
run: |
source $HOME/install/share/triqs/triqsvars.sh
mkdir build && cmake -B build
cmake --build build -j2
mkdir build && cd build && cmake ..
make -j2 || make -j1 VERBOSE=1
- name: Test app4triqs
env:

View File

@ -80,6 +80,9 @@ endif()
# Documentation
option(Build_Documentation "Build documentation" OFF)
if(Build_Documentation AND NOT PythonSupport)
message(FATAL_ERROR "Build_Documentation=ON requires PythonSupport to be enabled")
endif()
# Testing
option(Build_Tests "Build tests" ON)
@ -102,17 +105,6 @@ set(CMAKE_CXX_EXTENSIONS OFF)
# Provide additional debugging information for Debug builds
add_compile_options($<$<CONFIG:Debug>:-ggdb3>)
# Enable Linktime optimizations when available
cmake_policy(SET CMP0069 NEW)
include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_supported)
if(NOT ipo_supported)
message(STATUS "Linktime optimizations could not be enabled!")
else()
message(STATUS "Linktime optimizations enabled!")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
# Create an Interface target for compiler warnings
add_library(${PROJECT_NAME}_warnings INTERFACE)
target_compile_options(${PROJECT_NAME}_warnings

View File

@ -9,8 +9,8 @@ COPY --chown=build . $SRC/$APPNAME
WORKDIR $BUILD/$APPNAME
RUN chown build .
USER build
ARG BUILD_DOC=0
ARG BUILD_ID
RUN cmake $SRC/$APPNAME -DTRIQS_ROOT=${INSTALL} -DBuild_Documentation=${BUILD_DOC} -DBuild_Deps=Always && make -j2 || make -j1 VERBOSE=1
ARG CMAKE_ARGS
RUN cmake $SRC/$APPNAME -DTRIQS_ROOT=${INSTALL} -DBuild_Deps=Always $CMAKE_ARGS && make -j4 || make -j1 VERBOSE=1
USER root
RUN make install

29
Jenkinsfile vendored
View File

@ -25,12 +25,12 @@ def platforms = [:]
/****************** linux builds (in docker) */
/* Each platform must have a cooresponding Dockerfile.PLATFORM in triqs/packaging */
def dockerPlatforms = ["ubuntu-clang", "ubuntu-gcc", "centos-gcc"]
def dockerPlatforms = ["ubuntu-clang", "ubuntu-gcc", "sanitize"]
/* .each is currently broken in jenkins */
for (int i = 0; i < dockerPlatforms.size(); i++) {
def platform = dockerPlatforms[i]
platforms[platform] = { -> node('docker') {
stage(platform) { timeout(time: 1, unit: 'HOURS') {
platforms[platform] = { -> node('linux && docker && triqs') {
stage(platform) { timeout(time: 1, unit: 'HOURS') { ansiColor('xterm') {
checkout scm
/* construct a Dockerfile for this base */
sh """
@ -38,7 +38,12 @@ 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} --build-arg BUILD_ID=${env.BUILD_TAG} .")
def args = ''
if (platform == documentationPlatform)
args = '-DBuild_Documentation=1'
else if (platform == "sanitize")
args = '-DASAN=ON -DUBSAN=ON'
def img = docker.build("flatironinstitute/${dockerName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_ID=${env.BUILD_TAG} --build-arg CMAKE_ARGS='${args}' .")
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
img.inside() {
sh "make -C \$BUILD/${projectName} test CTEST_OUTPUT_ON_FAILURE=1"
@ -47,20 +52,20 @@ for (int i = 0; i < dockerPlatforms.size(); i++) {
if (!keepInstall) {
sh "docker rmi --no-prune ${img.imageName()}"
}
} }
} } }
} }
}
/****************** osx builds (on host) */
def osxPlatforms = [
["gcc", ['CC=gcc-10', 'CXX=g++-10', 'FC=gfortran-10']],
["clang", ['CC=$BREW/opt/llvm/bin/clang', 'CXX=$BREW/opt/llvm/bin/clang++', 'FC=gfortran-10', 'CXXFLAGS=-I$BREW/opt/llvm/include', 'LDFLAGS=-L$BREW/opt/llvm/lib']]
["gcc", ['CC=gcc-11', 'CXX=g++-11', 'FC=gfortran-11']],
["clang", ['CC=$BREW/opt/llvm/bin/clang', 'CXX=$BREW/opt/llvm/bin/clang++', 'FC=gfortran-11', 'CXXFLAGS=-I$BREW/opt/llvm/include', 'LDFLAGS=-L$BREW/opt/llvm/lib']]
]
for (int i = 0; i < osxPlatforms.size(); i++) {
def platformEnv = osxPlatforms[i]
def platform = platformEnv[0]
platforms["osx-$platform"] = { -> node('osx && triqs') {
stage("osx-$platform") { timeout(time: 1, unit: 'HOURS') {
stage("osx-$platform") { timeout(time: 1, unit: 'HOURS') { ansiColor('xterm') {
def srcDir = pwd()
def tmpDir = pwd(tmp:true)
def buildDir = "$tmpDir/build"
@ -82,13 +87,13 @@ for (int i = 0; i < osxPlatforms.size(); i++) {
"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.8/site-packages",
"PYTHONPATH=$installDir/lib/python3.9/site-packages",
"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"
sh "cmake $srcDir -DCMAKE_INSTALL_PREFIX=$installDir -DTRIQS_ROOT=$triqsDir -DBuild_Deps=Always"
sh "make -j2"
sh "make -j2 || make -j1 VERBOSE=1"
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') { try {
sh "make test CTEST_OUTPUT_ON_FAILURE=1"
} catch (exc) {
@ -97,7 +102,7 @@ for (int i = 0; i < osxPlatforms.size(); i++) {
} }
sh "make install"
} }
} }
} } }
} }
}
@ -105,7 +110,7 @@ for (int i = 0; i < osxPlatforms.size(); i++) {
def error = null
try {
parallel platforms
if (keepInstall) { node("docker") {
if (keepInstall) { node('linux && docker && triqs') {
/* Publish results */
stage("publish") { timeout(time: 5, unit: 'MINUTES') {
def commit = sh(returnStdout: true, script: "git rev-parse HEAD").trim()

2
deps/CMakeLists.txt vendored
View File

@ -35,7 +35,7 @@ include(external_dependency.cmake)
# In particular the dependency will not be installed.
if(NOT DEFINED Build_Deps)
set(Build_Deps "IfNotFound" CACHE STRING "Do we build dependencies from source? [Never/Always/IfNotFound]")
set(Build_Deps "Always" CACHE STRING "Do we build dependencies from source? [Never/Always/IfNotFound]")
else()
set(Build_Deps_Opts "Never" "Always" "IfNotFound")
if(NOT ${Build_Deps} IN_LIST Build_Deps_Opts)

View File

@ -1 +1,4 @@
# Required python packages for this application (these should also be added to Dockerfile for Jenkins)
mako
numpy
scipy