From a7934d605b6013f602bf0272249df7d8118095d9 Mon Sep 17 00:00:00 2001
From: Giovanni La Mura <giovanni.lamura@inaf.it>
Date: Mon, 25 Dec 2023 16:47:01 +0100
Subject: [PATCH] Use GCC compiler for C++ code in pipeline

---
 .gitlab-ci.yml | 31 ++++++++++---------------------
 1 file changed, 10 insertions(+), 21 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bcbe59be..5e1b0836 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -22,12 +22,11 @@ stages:
 building_stage:
    stage: build
    allow_failure: false
-   image: debian:bookworm-slim
    artifacts:
       paths:
          - build/cluster/*
          - build/sphere/*
-         - build/trapping/*
+         #- build/trapping/*
       exclude:
          - ".git*"
          - ".git/**/*"
@@ -40,27 +39,25 @@ building_stage:
       - echo $CI_COMMIT_BRANCH
       - echo "Getting system info ..."
       - cat /etc/os-release
-      - echo "Updating system ..."
-      - apt update
-      - echo "Installing dependencies"
-      - apt install -y g++ gfortran make
-      - cd src
-      - echo "Running make"
-      - make
+      - cd src/sphere
+      - echo "Building SPHERE ..."
+      - gcc -O2 -lstdc++ -lm np_sphere.cpp sphere.cpp ../libnptm/Commons.cpp ../libnptm/Configuration.cpp ../libnptm/Parsers.cpp -o ../../build/sphere/np_sphere
+      - cd ../cluster
+      - echo "Building CLUSTER ..."
+      - gcc -O2 -lstdc++ -lm np_cluster.cpp cluster.cpp ../libnptm/Commons.cpp ../libnptm/Configuration.cpp ../libnptm/Parsers.cpp ../sphere/sphere.cpp -o ../../build/cluster/np_cluster
 
 running_stage:
    stage: run
    allow_failure: false
    needs:
       - job: building_stage
-   image: debian:bookworm-slim
    dependencies:
       - building_stage
    artifacts:
       paths:
-         - build/cluster/*
-         - build/sphere/*
-         - build/trapping/*
+         - build/cluster/c_*
+         - build/sphere/c_*
+         #- build/trapping/*
       exclude:
          - ".git*"
          - ".git/**/*"
@@ -71,10 +68,6 @@ running_stage:
       - hostname
       - echo $CI_COMMIT_SHA
       - echo $CI_COMMIT_BRANCH
-      - echo "Updating system ..."
-      - apt update
-      - echo "Installing dependencies ..."
-      - apt install -y g++ gfortran gdb
       - cd build/sphere
       - echo "Running np_sphere"
       - chmod +x np_sphere
@@ -107,10 +100,6 @@ testing_stage:
       - hostname
       - echo $CI_COMMIT_SHA
       - echo $CI_COMMIT_BRANCH
-      - echo "Updating system ..."
-      - apt update
-      - echo "Installing dependencies ..."
-      - apt install -y python3
       - cd build/sphere
       - export FFILE=../../test_data/sphere/OSPH
       - echo "Comparing output of SPHERE"
-- 
GitLab