From 3d23f9ed0911b38c80799e0b23cc4265900336da Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Wed, 5 Jan 2022 12:10:58 -0600 Subject: [PATCH] CI: switch to cmake --- utils/tests/gitlab-ci-clang.yml | 2 +- utils/tests/gitlab-ci-doc.yml | 6 +-- utils/tests/gitlab-ci-fedora.yml | 2 +- utils/tests/gitlab-ci-gcc.yml | 39 ++++----------- utils/tests/gitlab-ci-pybindgen.yml | 46 +++++++++--------- utils/tests/gitlab-ci-test.yml | 23 ++++----- utils/tests/gitlab-ci-ubuntu.yml | 8 ++-- utils/tests/gitlab-ci.yml | 74 ++++++++++++++--------------- 8 files changed, 91 insertions(+), 109 deletions(-) diff --git a/utils/tests/gitlab-ci-clang.yml b/utils/tests/gitlab-ci-clang.yml index 59018850f..ffbe112f2 100644 --- a/utils/tests/gitlab-ci-clang.yml +++ b/utils/tests/gitlab-ci-clang.yml @@ -16,7 +16,7 @@ - $CLANG_BUILD_ENABLE == "True" before_script: - apt-get --quiet update --yes - - apt-get --quiet install gsl-bin libgsl-dev ccache sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk-3-0 libgtk-3-dev libboost-all-dev libgsl23 --yes + - apt-get --quiet install cmake ninja-build gsl-bin libgsl-dev ccache sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk-3-0 libgtk-3-dev libboost-all-dev libgsl23 --yes - apt-get --quiet install software-properties-common gnupg wget --yes - echo -en "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-$CLANG main \n deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-$CLANG main" > /etc/apt/sources.list.d/llvm.list - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - diff --git a/utils/tests/gitlab-ci-doc.yml b/utils/tests/gitlab-ci-doc.yml index 6cbed1e85..778680893 100644 --- a/utils/tests/gitlab-ci-doc.yml +++ b/utils/tests/gitlab-ci-doc.yml @@ -5,7 +5,7 @@ stage: documentation before_script: - pacman -Syu --noconfirm - - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost --noconfirm + - pacman -Sy base-devel ninja cmake python ccache gsl libgcrypt gtk3 boost --noconfirm - pacman -Sy git doxygen graphviz imagemagick dia texlive-core texlive-bin texlive-latexextra python-sphinx --noconfirm # no policy is a good policy. - mv /etc/ImageMagick-7/policy.xml /etc/ImageMagick-7/policy.xml.bak @@ -23,8 +23,8 @@ doxygen: - mkdir -p $CCACHE_BASEDIR_VALUE - export CCACHE_BASEDIR=${PWD} - export CCACHE_DIR=${PWD}/$CCACHE_BASEDIR_VALUE - - CXX="ccache $COMPILER" ./waf configure --enable-examples --enable-tests --enable-asserts -d release - - ./waf + - ./ns3 configure -d release -GNinja --enable-examples --enable-tests --enable-asserts + - ./ns3 build # - mkdir -p public/doxygen - git remote add ns-3-origin https://gitlab.com/nsnam/ns-3-dev.git || true - git fetch ns-3-origin diff --git a/utils/tests/gitlab-ci-fedora.yml b/utils/tests/gitlab-ci-fedora.yml index 3783948b9..6dba0de67 100644 --- a/utils/tests/gitlab-ci-fedora.yml +++ b/utils/tests/gitlab-ci-fedora.yml @@ -14,7 +14,7 @@ - $RELEASE == "weekly" - $FEDORA == "True" before_script: - - dnf install gcc gcc-c++ python python-devel ccache gsl gsl-devel libgcrypt gtk3 gtk3-devel sqlite sqlite-devel libxml2 libxml2-devel openmpi openmpi-devel boost-devel pygobject3-devel python3-gobject gobject-introspection-devel goocanvas2-devel graphviz-devel graphviz ipython --assumeyes + - dnf install gcc gcc-c++ cmake ninja-build python python-devel ccache gsl gsl-devel libgcrypt gtk3 gtk3-devel sqlite sqlite-devel libxml2 libxml2-devel openmpi openmpi-devel boost-devel pygobject3-devel python3-gobject gobject-introspection-devel goocanvas2-devel graphviz-devel graphviz ipython --assumeyes variables: COMPILER: g++ diff --git a/utils/tests/gitlab-ci-gcc.yml b/utils/tests/gitlab-ci-gcc.yml index 8ac8a48d4..3cb5d540e 100644 --- a/utils/tests/gitlab-ci-gcc.yml +++ b/utils/tests/gitlab-ci-gcc.yml @@ -16,48 +16,29 @@ before_script: - apt-get --quiet update --yes - update-alternatives --install /usr/bin/gfortran gfortran /usr/local/bin/gfortran 999 - - apt-get --quiet install gcc g++ python python3 python-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev ccache flex bison libfl-dev sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk-3-dev libboost-all-dev gsl-bin libgsl0-dev --yes + - apt-get --quiet install gcc g++ cmake ninja-build python python3 python-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev ccache flex bison libfl-dev sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk-3-dev libboost-all-dev gsl-bin libgsl0-dev --yes variables: COMPILER: g++ -# GCC 7 -# weekly-build-gcc-7-debug: +# GCC 8 +# weekly-build-gcc-8-debug: # extends: .weekly-build-gcc -# image: gcc:7 +# image: gcc:8 # variables: # MODE: debug -# -# weekly-build-gcc-7-release: + +# weekly-build-gcc-8-release: # extends: .weekly-build-gcc -# image: gcc:7 +# image: gcc:8 # variables: # MODE: release -# -# weekly-build-gcc-7-optimized: + +# weekly-build-gcc-8-optimized: # extends: .weekly-build-gcc -# image: gcc:7 +# image: gcc:8 # variables: # MODE: optimized -# GCC 8 -weekly-build-gcc-8-debug: - extends: .weekly-build-gcc - image: gcc:8 - variables: - MODE: debug - -weekly-build-gcc-8-release: - extends: .weekly-build-gcc - image: gcc:8 - variables: - MODE: release - -weekly-build-gcc-8-optimized: - extends: .weekly-build-gcc - image: gcc:8 - variables: - MODE: optimized - # GCC 9 weekly-build-gcc-9-debug: extends: .weekly-build-gcc diff --git a/utils/tests/gitlab-ci-pybindgen.yml b/utils/tests/gitlab-ci-pybindgen.yml index e40b6ff6f..1170f39b1 100644 --- a/utils/tests/gitlab-ci-pybindgen.yml +++ b/utils/tests/gitlab-ci-pybindgen.yml @@ -1,24 +1,24 @@ -pybindgen: - stage: build - image: archlinux - only: - variables: - - $PYBINDGEN == "True" - before_script: - - pacman -Syu --noconfirm - - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost wget git --noconfirm - - wget --no-check-certificate https://nat.onthewifi.net/ns3/castxml-git-0.3.4.r19.g8625aed-1-x86_64.pkg.tar - - wget --no-check-certificate https://nat.onthewifi.net/ns3/python-pybindgen-0.21.0-1-x86_64.pkg.tar - - wget --no-check-certificate https://nat.onthewifi.net/ns3/python-pygccxml-git-1.9.0.r104.g84be336-1-any.pkg.tar - - pacman -U --noconfirm python-pygccxml-git-1.9.0.r104.g84be336-1-any.pkg.tar python-pybindgen-0.21.0-1-x86_64.pkg.tar castxml-git-0.3.4.r19.g8625aed-1-x86_64.pkg.tar - script: - - git clone https://github.com/afq984/python-cxxfilt.git - - mv python-cxxfilt/cxxfilt bindings/python - - CXX="g++" ./waf configure --disable-examples --disable-tests -d debug - - ./waf --apiscan=$MODULE - - git diff src > pybindgen_new.patch - artifacts: - paths: - - pybindgen_new.patch - timeout: 9h +# pybindgen: +# stage: build +# image: archlinux +# only: +# variables: +# - $PYBINDGEN == "True" +# before_script: +# - pacman -Syu --noconfirm +# - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost wget git --noconfirm +# - wget --no-check-certificate https://nat.onthewifi.net/ns3/castxml-git-0.3.4.r19.g8625aed-1-x86_64.pkg.tar +# - wget --no-check-certificate https://nat.onthewifi.net/ns3/python-pybindgen-0.21.0-1-x86_64.pkg.tar +# - wget --no-check-certificate https://nat.onthewifi.net/ns3/python-pygccxml-git-1.9.0.r104.g84be336-1-any.pkg.tar +# - pacman -U --noconfirm python-pygccxml-git-1.9.0.r104.g84be336-1-any.pkg.tar python-pybindgen-0.21.0-1-x86_64.pkg.tar castxml-git-0.3.4.r19.g8625aed-1-x86_64.pkg.tar +# script: +# - git clone https://github.com/afq984/python-cxxfilt.git +# - mv python-cxxfilt/cxxfilt bindings/python +# - CXX="g++" ./waf configure --disable-examples --disable-tests -d debug +# - ./waf --apiscan=$MODULE +# - git diff src > pybindgen_new.patch +# artifacts: +# paths: +# - pybindgen_new.patch +# timeout: 9h diff --git a/utils/tests/gitlab-ci-test.yml b/utils/tests/gitlab-ci-test.yml index 800006618..d4fd11692 100644 --- a/utils/tests/gitlab-ci-test.yml +++ b/utils/tests/gitlab-ci-test.yml @@ -11,9 +11,10 @@ - mkdir -p $CCACHE_BASEDIR_VALUE - export CCACHE_BASEDIR=${PWD} - export CCACHE_DIR=${PWD}/$CCACHE_BASEDIR_VALUE - - CXX="ccache $COMPILER" ./waf configure --enable-examples --enable-tests --disable-gtk --disable-python -d $MODE - - ./waf - - ./test.py --nowaf $VALGRIND_FLAG $FULLNESS + # missing the flag --disable-python + - ./ns3 configure -d $MODE -GNinja --enable-examples --enable-tests --disable-gtk + - ./ns3 build + - ./test.py -n $VALGRIND_FLAG $FULLNESS cache: key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" paths: @@ -38,7 +39,7 @@ daily-test-debug: - linux before_script: - pacman -Syu --noconfirm - - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind --noconfirm + - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind ninja cmake --noconfirm # Run the test.py script with files compiled in release mode daily-test-release: @@ -52,7 +53,7 @@ daily-test-release: - $RELEASE == "daily" before_script: - pacman -Syu --noconfirm - - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind --noconfirm + - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind ninja cmake --noconfirm # Run the test.py script with files compiled in optimized mode daily-test-optimized: @@ -66,7 +67,7 @@ daily-test-optimized: - $RELEASE == "daily" before_script: - pacman -Syu --noconfirm - - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind --noconfirm + - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind ninja cmake --noconfirm ### Valgrind tests # Run the test.py script with files compiled in optimized mode + valgrind (daily) @@ -85,7 +86,7 @@ daily-test-optimized-valgrind: - linux before_script: - pacman -Syu --noconfirm - - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind --noconfirm + - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind ninja cmake --noconfirm # Run the test.py script with files compiled in debug mode weekly-test-debug-valgrind: @@ -103,7 +104,7 @@ weekly-test-debug-valgrind: - linux before_script: - pacman -Syu --noconfirm - - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind --noconfirm + - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind ninja cmake --noconfirm # Run the test.py script with files compiled in release mode weekly-test-release-valgrind: @@ -121,7 +122,7 @@ weekly-test-release-valgrind: - linux before_script: - pacman -Syu --noconfirm - - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind --noconfirm + - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind ninja cmake --noconfirm # Run the test.py script with files compiled in optimized mode weekly-test-optimized-valgrind: @@ -139,7 +140,7 @@ weekly-test-optimized-valgrind: - linux before_script: - pacman -Syu --noconfirm - - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind --noconfirm + - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind ninja cmake --noconfirm # Do a check for the TAKES_FOREVER jobs, only in optimized mode weekly-test-takes-forever-optimized: @@ -157,4 +158,4 @@ weekly-test-takes-forever-optimized: - linux before_script: - pacman -Syu --noconfirm - - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind --noconfirm + - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost valgrind ninja cmake --noconfirm diff --git a/utils/tests/gitlab-ci-ubuntu.yml b/utils/tests/gitlab-ci-ubuntu.yml index cbf68c720..8f02de409 100644 --- a/utils/tests/gitlab-ci-ubuntu.yml +++ b/utils/tests/gitlab-ci-ubuntu.yml @@ -16,7 +16,7 @@ before_script: - apt-get --quiet update --yes - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata - - apt-get --quiet install gcc g++ python python3 python-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev gsl-bin libgsl-dev ccache flex bison libfl-dev sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk-3-dev libboost-all-dev $LIBGSL --yes + - apt-get --quiet install gcc g++ cmake ninja-build python python3 python-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev gsl-bin libgsl-dev ccache flex bison libfl-dev sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk-3-dev libboost-all-dev $LIBGSL --yes variables: COMPILER: g++ @@ -27,7 +27,7 @@ weekly-build-ubuntu-18.04-debug: before_script: - apt-get --quiet update --yes - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata - - apt-get --quiet install gcc-8 g++-8 python python3 python-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev gsl-bin libgsl-dev ccache flex bison libfl-dev sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk-3-dev libboost-all-dev $LIBGSL --yes + - apt-get --quiet install gcc-8 g++-8 cmake ninja-build python python3 python-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev gsl-bin libgsl-dev ccache flex bison libfl-dev sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk-3-dev libboost-all-dev $LIBGSL --yes - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7 - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 variables: @@ -40,7 +40,7 @@ weekly-build-ubuntu-18.04-release: before_script: - apt-get --quiet update --yes - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata - - apt-get --quiet install gcc-8 g++-8 python python3 python-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev gsl-bin libgsl-dev ccache flex bison libfl-dev sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk-3-dev libboost-all-dev $LIBGSL --yes + - apt-get --quiet install gcc-8 g++-8 cmake ninja-build python python3 python-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev gsl-bin libgsl-dev ccache flex bison libfl-dev sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk-3-dev libboost-all-dev $LIBGSL --yes - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7 - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 variables: @@ -53,7 +53,7 @@ weekly-build-ubuntu-18.04-optimized: before_script: - apt-get --quiet update --yes - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata - - apt-get --quiet install gcc-8 g++-8 python python3 python-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev gsl-bin libgsl-dev ccache flex bison libfl-dev sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk-3-dev libboost-all-dev $LIBGSL --yes + - apt-get --quiet install gcc-8 g++-8 cmake ninja-build python python3 python-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev gsl-bin libgsl-dev ccache flex bison libfl-dev sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk-3-dev libboost-all-dev $LIBGSL --yes - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7 - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 variables: diff --git a/utils/tests/gitlab-ci.yml b/utils/tests/gitlab-ci.yml index 24ce845fd..b7e68c5d4 100644 --- a/utils/tests/gitlab-ci.yml +++ b/utils/tests/gitlab-ci.yml @@ -37,9 +37,9 @@ stages: - mkdir -p $CCACHE_BASEDIR_VALUE - export CCACHE_BASEDIR=${PWD} - export CCACHE_DIR=${PWD}/$CCACHE_BASEDIR_VALUE - - CXX="ccache $COMPILER" ./waf configure --enable-examples --enable-tests --enable-asserts -d $MODE - - ./waf - - if [ "$MODE" != "debug" ]; then ./test.py --nowaf; fi + - ./ns3 configure -d $MODE -GNinja --enable-examples --enable-tests --enable-asserts + - ./ns3 build + - if [ "$MODE" != "debug" ]; then ./test.py -n; fi cache: # Use separate key for each (debug/optimized/release) jobs because # they run in parallel and will otherwise overwrite each other @@ -70,7 +70,7 @@ per-commit-compile-debug: MODE: debug before_script: - pacman -Syu --noconfirm - - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost --noconfirm + - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost ninja cmake --noconfirm per-commit-compile-release: extends: .base-build @@ -85,7 +85,7 @@ per-commit-compile-release: MODE: release before_script: - pacman -Syu --noconfirm - - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost --noconfirm + - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost ninja cmake --noconfirm per-commit-compile-optimized: extends: .base-build @@ -98,41 +98,41 @@ per-commit-compile-optimized: variables: COMPILER: g++ MODE: optimized - before_script: - - pacman -Syu --noconfirm - - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost --noconfirm - -.cmake-build: - stage: build - script: - - mkdir -p $CCACHE_BASEDIR_VALUE - - export CCACHE_BASEDIR=${PWD} - - export CCACHE_DIR=${PWD}/$CCACHE_BASEDIR_VALUE - - ./ns3 configure -d $MODE -GNinja --enable-examples --enable-tests - - ./ns3 build - - ./test.py --nowaf - cache: - paths: - - $CCACHE_BASEDIR_VALUE/ - timeout: 9h - variables: - CCACHE_BASEDIR_VALUE: ns-3-ccache-storage - -per-commit-compile-release-cmake: - extends: .cmake-build - except: - variables: - - $PYBINDGEN == "True" - - $RELEASE == "weekly" - - $RELEASE == "daily" - image: archlinux - variables: - COMPILER: g++ - MODE: release before_script: - pacman -Syu --noconfirm - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost ninja cmake --noconfirm +# .cmake-build: +# stage: build +# script: +# - mkdir -p $CCACHE_BASEDIR_VALUE +# - export CCACHE_BASEDIR=${PWD} +# - export CCACHE_DIR=${PWD}/$CCACHE_BASEDIR_VALUE +# - ./ns3 configure -d $MODE -GNinja --enable-examples --enable-tests +# - ./ns3 build +# - ./test.py -n +# cache: +# paths: +# - $CCACHE_BASEDIR_VALUE/ +# timeout: 9h +# variables: +# CCACHE_BASEDIR_VALUE: ns-3-ccache-storage + +# per-commit-compile-release-cmake: +# extends: .cmake-build +# except: +# variables: +# - $PYBINDGEN == "True" +# - $RELEASE == "weekly" +# - $RELEASE == "daily" +# image: archlinux +# variables: +# COMPILER: g++ +# MODE: release +# before_script: +# - pacman -Syu --noconfirm +# - pacman -Sy base-devel python ccache gsl libgcrypt gtk3 boost ninja cmake --noconfirm + # Weekly jobs for other distribution and compilers include: - 'utils/tests/gitlab-ci-ubuntu.yml' @@ -141,4 +141,4 @@ include: - 'utils/tests/gitlab-ci-clang.yml' - 'utils/tests/gitlab-ci-test.yml' - 'utils/tests/gitlab-ci-doc.yml' - - 'utils/tests/gitlab-ci-pybindgen.yml' +# - 'utils/tests/gitlab-ci-pybindgen.yml'