Package list votca-xtp / upstream/latest .gitlab-ci.yml
upstream/latest

Tree @upstream/latest (Download .tar.gz)

.gitlab-ci.yml @upstream/latestraw · history · blame

stages:
  - build

.build_script:
  retry:
    max: 2
  variables:
    CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
  stage: build
  artifacts:
    paths:
      - ${CI_PROJECT_DIR}/votca
    when: always
  dependencies: []
  cache:
    paths:
      - ccache/
  script:
    - ccache -z
    - j="$(grep -c processor /proc/cpuinfo 2>/dev/null)" || j=0; ((j++))
    - git branch commit_of_build_${CI_BUILD_ID} ${CI_COMMIT_SHA}
    - git clone https://github.com/votca/votca
    - pushd votca
    - if [[ ${CI_COMMIT_TAG} = v[12].[0-9]* ]]; then
        git checkout -b ${CI_COMMIT_TAG} ${CI_COMMIT_TAG};
      elif [[ ( ${CI_COMMIT_REF_NAME} =~ ^for/([^/]*)/.* || ${CI_COMMIT_REF_NAME} =~ ^(stable)$ ) && ${BASH_REMATCH[1]} != master ]]; then
        git checkout -b ${BASH_REMATCH[1]} origin/${BASH_REMATCH[1]};
      fi
    - git submodule update --recursive --init
    - git -C ${CI_PROJECT_NAME} fetch ${CI_PROJECT_DIR} commit_of_build_${CI_BUILD_ID}
    - git -C ${CI_PROJECT_DIR} branch -d commit_of_build_${CI_BUILD_ID}
    - git -C ${CI_PROJECT_NAME} checkout -f ${CI_COMMIT_SHA}
    - mkdir -p build
    - pushd build
    - cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_TESTING=ON -DBUILD_XTP=ON -DENABLE_WERROR=ON
      -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
      ${CMAKE_GENERATOR:+-G${CMAKE_GENERATOR}}
      -DMODULE_BUILD=${MODULE_BUILD} ${MODULE_BUILD:+-DCMAKE_INSTALL_PREFIX=/home/votca/votca.install}
      -DCMAKE_DISABLE_FIND_PACKAGE_MKL=${DISABLE_MKL}
      -DUSE_CUDA=${USE_CUDA}      
    - cmake --build . --parallel 2
    - ctest --output-on-failure
    - test -z "${MODULE_BUILD}" && DESTDIR=${PWD}/install cmake --install . && rm -rf ${PWD}/install/usr && rmdir ${PWD}/install
    - sudo cmake --install .
    - if [[ ${CLANG_FORMAT} ]]; then cmake --build . --target format && git -C ${CI_PROJECT_DIR}/votca/${CI_PROJECT_NAME} diff --exit-code; fi
    - ccache -s

.build:
  variables:
    DISTRO: "latest"
  image: votca/buildenv:${DISTRO}
  extends: .build_script
    
Debug GPU Ubuntu:
  variables:
    CC: "gcc"
    CXX: "g++"
    CMAKE_BUILD_TYPE: "Debug"
    USE_CUDA: "yes"
    DISABLE_MKL: "yes"
  before_script:
    - source /opt/gromacs-2019/bin/GMXRC.bash
  extends: .build_script
  allow_failure: true
  tags:
    - gpu