Commit b524007a authored by Andrea Valassi's avatar Andrea Valassi
Browse files

# review compiler-related link setup and runtime environment (CORALCOOL-2853)

# - set CC and CXX (with absolute paths) in the runtime environment
# - guess the path to stdc++.so, set it in rpath and LD_LIBRARY_PATH
#   skip this for Darwin (CORALCOOL-2806) - FIXME!
#   skip this for clang (similar to CORALCOOL-2806) - FIXME!
#   skip this for icc (CORALCOOL-2797) - FIXME!
# - no longer set the PATH to the compilers (use $CC and $CXX with full paths)


git-svn-id: file:///git/lcgcool.svndb/cool/trunk@19875 4525493e-7705-40b1-a816-d608a930855b
parent cb7b9e9c
......@@ -32,25 +32,23 @@ include(CORALEnableDistCC)
include(CORALEnvironmentHandling)
coral_enable_env()
# set CC and CXX for the compiler in the runtime environment
# use the full real path except for lcg-xxx-yyy wrapper (see CORALCOOL-2853)
IF("$ENV{CORALCOOL_CMAKE_LCGSUMMARY} " STREQUAL " ")
get_filename_component(compiler_c_path ${CMAKE_C_COMPILER} REALPATH)
get_filename_component(compiler_cxx_path ${CMAKE_CXX_COMPILER} REALPATH)
coral_build_and_release_env(SET CC ${compiler_c_path})
coral_build_and_release_env(SET CXX ${compiler_cxx_path})
ELSE()
coral_build_and_release_env(SET CC $ENV{CC})
coral_build_and_release_env(SET CXX $ENV{CXX})
ENDIF()
# guess the path to the compiler's libstdc++ to set LD_LIBRARY_PATH
# (but no need to do this for lcg-xxx-yyy wrappers, see CORALCOOL-2853)
IF("$ENV{CORALCOOL_CMAKE_LCGSUMMARY} " STREQUAL " " AND NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin" AND NOT BINARY_TAG MATCHES "clang" AND NOT BINARY_TAG MATCHES "icc")
# compiler-related link setup and runtime environment (CORALCOOL-2853)
# - set CC and CXX (with absolute paths) in the runtime environment
# - guess the path to stdc++.so, set it in rpath and LD_LIBRARY_PATH
# skip this for Darwin (CORALCOOL-2806) - FIXME!
# skip this for clang (similar to CORALCOOL-2806) - FIXME!
# skip this for icc (CORALCOOL-2797) - FIXME!
# - no longer set the PATH to the compilers (use $CC and $CXX with full paths)
# (exclude /usr/bin if you add it back, see CORALCOOL-2803)
coral_build_and_release_env(SET CC ${CMAKE_C_COMPILER})
coral_build_and_release_env(SET CXX ${CMAKE_CXX_COMPILER})
IF(NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin" AND NOT BINARY_TAG MATCHES "clang" AND NOT BINARY_TAG MATCHES "icc")
include(GuessCompilerRuntimePaths)
GuessCompilerRuntimePaths(compiler_lib_path compiler_bin_path)
# this ensures that the compiler libraries are in the rpath
link_directories(${compiler_lib_path})
# this is needed by test runtime also for lcg-xxx-yyy builds
coral_build_and_release_env(PREPEND LD_LIBRARY_PATH ${compiler_lib_path})
ENDIF()
enable_testing()
......@@ -86,20 +84,6 @@ if (NOT _path STREQUAL /usr/bin)
coral_build_and_release_env(PREPEND PATH ${_path})
endif()
# Add PATH and LD_LIBRARY_PATH for the compiler
IF("$ENV{CORALCOOL_CMAKE_LCGSUMMARY} " STREQUAL " " AND NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin" AND NOT BINARY_TAG MATCHES "clang" AND NOT BINARY_TAG MATCHES "icc")
coral_release_env(PREPEND PATH ${compiler_bin_path}
PREPEND LD_LIBRARY_PATH ${compiler_lib_path})
coral_build_env(PREPEND PATH ${compiler_bin_path}
PREPEND LD_LIBRARY_PATH ${compiler_lib_path})
ELSE()
# Avoid adding the compiler bin path twice (CORALCOOL-2853)
get_filename_component(_path ${CMAKE_CXX_COMPILER} PATH) # PATH to lcg-g++-xyz
if (NOT _path STREQUAL /usr/bin)
coral_build_and_release_env(PREPEND PATH ${_path})
endif()
ENDIF()
IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
execute_process(COMMAND env -i LANG=$ENV{LANG} man -C /private/etc/man.conf -w OUTPUT_VARIABLE default_manpath OUTPUT_STRIP_TRAILING_WHITESPACE)
ELSE()
......
......@@ -85,7 +85,9 @@ OK
/cvmfs/sft.cern.ch/lcg/releases/LCG_82/CppUnit/1.12.1_p1/x86_64-slc6-gcc48-dbg/lib
/cvmfs/sft.cern.ch/lcg/releases/LCG_82/Boost/1.59.0_python2.7/x86_64-slc6-gcc48-dbg/lib
/cvmfs/sft.cern.ch/lcg/releases/LCG_82/qt/4.8.4/x86_64-slc6-gcc48-dbg/lib
/cvmfs/sft.cern.ch/lcg/releases/gcc/4.8.4/x86_64-slc6/lib64
---
+ /cvmfs/sft.cern.ch/lcg/releases/gcc/4.8.4/x86_64-slc6/lib64
- /cvmfs/sft.cern.ch/lcg/releases/LCG_82/CORAL/3_1_1/x86_64-slc6-gcc48-dbg/lib
- /cvmfs/sft.cern.ch/lcg/releases/LCG_82/gcc/4.8.4/x86_64-slc6/lib64
- /cvmfs/sft.cern.ch/lcg/releases/LCG_82/xrootd/4.2.3/x86_64-slc6-gcc48-dbg/lib64
......@@ -180,7 +182,6 @@ OK
/cvmfs/sft.cern.ch/lcg/releases/LCG_82/ROOT/6.04.10/x86_64-slc6-gcc48-dbg/bin
/cvmfs/sft.cern.ch/lcg/releases/LCG_82/Python/2.7.10/x86_64-slc6-gcc48-dbg/bin
/cvmfs/sft.cern.ch/lcg/releases/LCG_82/qt/4.8.4/x86_64-slc6-gcc48-dbg/bin
/cvmfs/lhcb.cern.ch/lib/lhcb/LBSCRIPTS/prod/InstallArea/scripts
/cvmfs/sft.cern.ch/lcg/contrib/CMake/3.3.2/Linux-x86_64/bin
/cvmfs/sft.cern.ch/lcg/contrib/ninja/1.4.0/x86_64-slc6
/usr/local/bin
......@@ -188,7 +189,6 @@ OK
/usr/bin
---
- /afs/cern.ch/sw/contrib/CMT/v1r20p20090520/Linux-x86_64
+ /cvmfs/lhcb.cern.ch/lib/lhcb/LBSCRIPTS/prod/InstallArea/scripts
+ /cvmfs/sft.cern.ch/lcg/contrib/CMake/3.3.2/Linux-x86_64/bin
+ /cvmfs/sft.cern.ch/lcg/contrib/ninja/1.4.0/x86_64-slc6
- /cvmfs/sft.cern.ch/lcg/releases/LCG_82/CORAL/3_1_1/x86_64-slc6-gcc48-dbg/bin
......
......@@ -83,7 +83,9 @@ OK
/cvmfs/sft.cern.ch/lcg/releases/LCG_82/qt/4.8.4/x86_64-slc6-gcc48-dbg/lib
/home/avalassi/COOL/trunk/x86_64-slc6-gcc48-dbg/lib
/home/avalassi/COOL/trunk/x86_64-slc6-gcc48-dbg/examples/lib
/cvmfs/sft.cern.ch/lcg/releases/gcc/4.8.4/x86_64-slc6/lib64
---
+ /cvmfs/sft.cern.ch/lcg/releases/gcc/4.8.4/x86_64-slc6/lib64
- /cvmfs/sft.cern.ch/lcg/releases/LCG_82/CORAL/3_1_1/x86_64-slc6-gcc48-dbg/lib
- /cvmfs/sft.cern.ch/lcg/releases/LCG_82/gcc/4.8.4/x86_64-slc6/lib64
- /cvmfs/sft.cern.ch/lcg/releases/LCG_82/xrootd/4.2.3/x86_64-slc6-gcc48-dbg/lib64
......@@ -174,7 +176,6 @@ OK
/home/avalassi/COOL/trunk/x86_64-slc6-gcc48-dbg/bin
/home/avalassi/COOL/trunk/x86_64-slc6-gcc48-dbg/tests/bin
/home/avalassi/COOL/trunk/x86_64-slc6-gcc48-dbg/examples/bin
/cvmfs/lhcb.cern.ch/lib/lhcb/LBSCRIPTS/prod/InstallArea/scripts
/cvmfs/sft.cern.ch/lcg/contrib/CMake/3.3.2/Linux-x86_64/bin
/cvmfs/sft.cern.ch/lcg/contrib/ninja/1.4.0/x86_64-slc6
/usr/local/bin
......@@ -182,7 +183,6 @@ OK
/usr/bin
---
- /afs/cern.ch/sw/contrib/CMT/v1r20p20090520/Linux-x86_64
+ /cvmfs/lhcb.cern.ch/lib/lhcb/LBSCRIPTS/prod/InstallArea/scripts
+ /cvmfs/sft.cern.ch/lcg/contrib/CMake/3.3.2/Linux-x86_64/bin
+ /cvmfs/sft.cern.ch/lcg/contrib/ninja/1.4.0/x86_64-slc6
- /cvmfs/sft.cern.ch/lcg/releases/LCG_82/CORAL/3_1_1/x86_64-slc6-gcc48-dbg/bin
......
Supports Markdown
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