From c508b3131273c947d81038fa33eda500998efd66 Mon Sep 17 00:00:00 2001
From: "Mulas, Giacomo" <gmulas@oa-cagliari.inaf.it>
Date: Wed, 22 May 2024 15:57:59 +0200
Subject: [PATCH] Add nvidia-cuda-dev to the container of the gitlab runner
 Remove unneeded explicit link with nvidia library

---
 containers/docker/Dockerfile                        |  3 +++
 .../docker/dockerstuff/debianrepos/debian.sources   | 13 +++++++++++++
 src/make.inc                                        |  3 ++-
 3 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 containers/docker/dockerstuff/debianrepos/debian.sources

diff --git a/containers/docker/Dockerfile b/containers/docker/Dockerfile
index 0b456148..d2ae57c8 100644
--- a/containers/docker/Dockerfile
+++ b/containers/docker/Dockerfile
@@ -9,6 +9,7 @@ WORKDIR /root
 #RUN cat /etc/apt/sources.list.d/oneAPI.list && sleep 5s
 #RUN ls -l /usr/share/keyrings/oneapi-archive-keyring.gpg && sleep 5s
 # make sure the debian bullseye us up to date, install needed packages
+COPY --chown=root:root containers/docker/dockerstuff/debianrepos/debian.sources /etc/apt/sources.list.d/
 RUN apt update
 RUN DEBIAN_FRONTEND=noninteractive apt -y upgrade
 # install packages needed to build binaries
@@ -22,6 +23,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt -y install intel-oneapi-compiler-fortran
 RUN DEBIAN_FRONTEND=noninteractive apt -y install liblapacke-dev liblapacke64-dev libopenblas-dev libopenblas-openmp-dev libopenblas64-dev libopenblas64-openmp-dev
 # install MPI stack
 RUN DEBIAN_FRONTEND=noninteractive apt -y install mpi-default-dev mpi-default-bin
+# install packages needed for nvtx instrumentation
+RUN DEBIAN_FRONTEND=noninteractive apt -y install nvidia-cuda-dev
 # install packages needed to run python scripts for checks
 RUN DEBIAN_FRONTEND=noninteractive apt -y install python3 python-is-python3 python3-regex
 # install packages needed to run doxygen to create html docs
diff --git a/containers/docker/dockerstuff/debianrepos/debian.sources b/containers/docker/dockerstuff/debianrepos/debian.sources
new file mode 100644
index 00000000..b04cc015
--- /dev/null
+++ b/containers/docker/dockerstuff/debianrepos/debian.sources
@@ -0,0 +1,13 @@
+Types: deb
+# http://snapshot.debian.org/archive/debian/20240423T150000Z
+URIs: http://deb.debian.org/debian
+Suites: bookworm bookworm-updates bookworm-proposed-updates
+Components: main non-free non-free-firmware contrib
+Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
+
+Types: deb
+# http://snapshot.debian.org/archive/debian-security/20240423T150000Z
+URIs: http://deb.debian.org/debian-security
+Suites: bookworm-security
+Components: main non-free non-free-firmware contrib
+Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
diff --git a/src/make.inc b/src/make.inc
index 70a9cb63..24ec96e3 100644
--- a/src/make.inc
+++ b/src/make.inc
@@ -102,7 +102,8 @@ endif
 ifdef CUDA_HOME
 override MAGMA_LDFLAGS+= -L$(CUDA_HOME)/lib64
 endif
-override MAGMA_LDFLAGS+= -lmagma -lcudart -lnvToolsExt
+#override MAGMA_LDFLAGS+= -lmagma -lcudart -lnvToolsExt
+override MAGMA_LDFLAGS+= -lmagma -lcudart
 #the next endif is for USE_MAGMA
 endif
 
-- 
GitLab