Skip to content
Snippets Groups Projects
Commit f11bb588 authored by Eleni Mathioulaki's avatar Eleni Mathioulaki
Browse files

get correct compiler path from self.compiler

parent aad1e4fd
No related branches found
No related tags found
2 merge requests!450create new experimental release,!447Find real compiler path during compile time
Pipeline #25709 passed with stage
in 2 hours and 26 seconds
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a924f3ebf..641e15d09 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,6 +23,13 @@ cmake_minimum_required( VERSION 3.19 )
list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
project( nest CXX C )
+
+# In case the CXX compiler set is a symlink that disappears at runtime, we want
+# to resolve to the actual binary.
+# (Required e.g. for Docker build-images with Spack installations / EBRAINS Jupyter)
+file(REAL_PATH ${CMAKE_CXX_COMPILER} CMAKE_CXX_COMPILER)
+file(REAL_PATH ${CMAKE_C_COMPILER} CMAKE_C_COMPILER)
+
set( NEST_USER_EMAIL "users@nest-simulator.org" )
include( ColorMessages )
diff --git a/bin/nest-config.in b/bin/nest-config.in
index a54ae0352..43bff5286 100755
--- a/bin/nest-config.in
+++ b/bin/nest-config.in
@@ -71,7 +71,7 @@
echo "-L$prefix/@CMAKE_INSTALL_LIBDIR@/nest @MODULE_LINK_LIBS@"
;;
--compiler)
- echo "@CMAKE_CXX_COMPILER@"
+ echo "@SPACK_CXX_COMPILER@"
;;
--compiler-name)
echo "@CMAKE_CXX_COMPILER_ID@"
......@@ -160,7 +160,10 @@ class Nest(CMakePackage):
make("install")
def cmake_args(self):
args = ["-DCMAKE_INSTALL_LIBDIR=lib"]
args = [
"-DCMAKE_INSTALL_LIBDIR=lib",
"-DSPACK_CXX_COMPILER=" + self.compiler.cxx
]
for flag in "boost mpi openmp optimize".split():
if '+' + flag in self.spec:
......
......@@ -34,4 +34,3 @@ class PyNestml(PythonPackage):
depends_on('py-odetoolbox', type=('build', 'run'))
depends_on('nest', type=('build', 'run'))
depends_on('py-pytest', type='test')
depends_on('gcc', type=('build', 'test', 'run')) # this should be whatever compiler is used for the env
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment