blob: 217eccfacb81bbcf7dfba714d3609cde3af33046 [file] [log] [blame]
Marc Kupietz97ada392022-04-10 14:06:00 +02001image: gcc
2
Marc Kupietzf3b1db02023-12-21 13:13:16 +01003variables:
4 # Set `CCACHE_BASEDIR` and `CCACHE_DIR` to point `ccache` towards the cached
5 # path on the gitlab-runner. This enables to cache the output of `ccache`
6 # between various runs.
7 CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
8 CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
9 # Set `ccache` to `content` to prevent rebuilding of the CI/CD containers to
10 # trigger a recreate of the cache. By using `content` the compiler's `mtime`
11 # is not considered as part of the hash.
12 CCACHE_COMPILERCHECK: "content"
13 # Enable caching for `apt-get`.
14 APT_CACHE_DIR: "${CI_PROJECT_DIR}/apt-cache"
15 # Export `noninteractive` frontend to prevent requesting user input.
16 DEBIAN_FRONTEND: "noninteractive"
17
Marc Kupietz2a93f3a2022-04-10 15:11:16 +020018build-and-test:
Marc Kupietz97ada392022-04-10 14:06:00 +020019 stage: build
Marc Kupietz2a0c25a2022-04-13 12:41:59 +020020 cache:
Marc Kupietzf3b1db02023-12-21 13:13:16 +010021 # Cache is shared between branches, but has a unique cache per job.
22 key: dereko2vec
23 paths:
24 # Note: directories should align with `$APT_CACHE_DIR` and `$CCACHE_DIR`.
25 - apt-cache/
26 - ccache/
27
Marc Kupietz97ada392022-04-10 14:06:00 +020028 before_script:
Marc Kupietz485be1c2022-04-10 14:21:45 +020029 - pwd
30 - source `find .. -name section_helper.sh`
31
32 - start_section install_linux_packages "Installing missing Linux packages"
Marc Kupietzf3b1db02023-12-21 13:13:16 +010033 - mkdir -pv $APT_CACHE_DIR ccache
34 - apt-get update && apt-get -o dir::cache::archives="$APT_CACHE_DIR" -y install ccache cmake libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev libomp-dev
35 - ln -s $(which ccache) /usr/local/sbin/gcc
36 - ln -s $(which ccache) /usr/local/sbin/g++
Marc Kupietz485be1c2022-04-10 14:21:45 +020037 - end_section install_linux_packages
38
39 - start_section install_rocksdb_static "Building and installing rocksdb-static"
Marc Kupietzf47b8cb2025-08-05 20:09:29 +020040 - git clone --branch 5.11.fb https://github.com/kupietz/rocksdb.git
Marc Kupietz6eab2f42023-12-21 11:15:14 +010041 - cd rocksdb
Marc Kupietz6eab2f42023-12-21 11:15:14 +010042 - export PROCS=$(nproc)
Marc Kupietz97ada392022-04-10 14:06:00 +020043 - make -j $PROCS static_lib DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w
Marc Kupietzf3b1db02023-12-21 13:13:16 +010044 - ccache --show-stats
Marc Kupietz97ada392022-04-10 14:06:00 +020045 - make install-static DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w
Marc Kupietz485be1c2022-04-10 14:21:45 +020046 - end_section install_rocksdb_static
47
48 - start_section install_rocksdb_shared "Building and installing rocksdb-shared"
Marc Kupietz97ada392022-04-10 14:06:00 +020049 - make -j $PROCS shared_lib DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w
50 - make install-shared DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w
Marc Kupietz2a0c25a2022-04-13 12:41:59 +020051 - ldconfig
Marc Kupietz97ada392022-04-10 14:06:00 +020052 - cd ..
Marc Kupietz485be1c2022-04-10 14:21:45 +020053 - end_section rocksdb_shared
54
55 - start_section install_collocatordb "Building and installing collocatordb"
Marc Kupietzb738ec72022-04-13 12:42:17 +020056 - git clone "https://korap.ids-mannheim.de/gerrit/ids-kl/collocatordb"
Marc Kupietz97ada392022-04-10 14:06:00 +020057 - cd collocatordb
58 - mkdir -p build
59 - cd build
Marc Kupietzf3b1db02023-12-21 13:13:16 +010060 - cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache ..
Marc Kupietz485be1c2022-04-10 14:21:45 +020061 - make
Marc Kupietzf3b1db02023-12-21 13:13:16 +010062 - ccache --show-stats
Marc Kupietz485be1c2022-04-10 14:21:45 +020063 - make install # && ctest --extra-verbose
Marc Kupietz2a0c25a2022-04-13 12:41:59 +020064 - ldconfig
Marc Kupietz485be1c2022-04-10 14:21:45 +020065 - end_section install_collocatordb
66 - cd ../..
67
Marc Kupietz97ada392022-04-10 14:06:00 +020068 script:
Marc Kupietz2a93f3a2022-04-10 15:11:16 +020069 - start_section build_dereko2vec "Building and testing dereko2vec"
Marc Kupietz485be1c2022-04-10 14:21:45 +020070 - pwd
Marc Kupietz97ada392022-04-10 14:06:00 +020071 - mkdir build
72 - cd build
Marc Kupietz8b169772025-02-10 20:55:47 +010073 - cmake -DSTATIC_DEREKO2VEC=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache ..
74 - make || (cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache .. && make)
Marc Kupietzf3b1db02023-12-21 13:13:16 +010075 - ccache --show-stats
Marc Kupietz2a93f3a2022-04-10 15:11:16 +020076 - ctest --extra-verbose
77 - end_section build_dereko2vec
Marc Kupietz485be1c2022-04-10 14:21:45 +020078
Marc Kupietz97ada392022-04-10 14:06:00 +020079 artifacts:
80 paths:
81 - build/dereko2vec
Marc Kupietz97ada392022-04-10 14:06:00 +020082