Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding LCG to thisREST.sh if LCG environment is identified #532

Merged
merged 17 commits into from
Jul 20, 2024
Merged
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions cmake/thisREST.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Write thisREST.[c]sh to INSTALL directory

# Checking if we are using CVMFS LCG GCC11 environment
set(lcg_found FALSE)

# Check if the CMAKE_COMMAND contains both "cvmfs", "lcg" and "x86_64-el9-gcc11"
LouisHelary marked this conversation as resolved.
Show resolved Hide resolved
string(FIND "${CMAKE_COMMAND}" "cvmfs" cvmfs_pos)
string(FIND "${CMAKE_COMMAND}" "lcg" lcg_pos)
string(FIND "${CMAKE_COMMAND}" "x86_64-el9-gcc11" gcc_pos)

if (lcg_pos GREATER -1
AND cvmfs_pos GREATER -1
AND gcc_pos GREATER -1)
set(lcg_found TRUE)
endif ()

set(loadLCG "")
if (lcg_found)
set(loadLCG
"\# We load LCG_104 environment.\nsource /cvmfs/sft.cern.ch/lcg/views/LCG_104/x86_64-el9-gcc11-opt/setup.sh\n\n"
)
endif ()

# We identify the thisroot.sh script for the corresponding ROOT version
execute_process(
COMMAND root-config --prefix
Expand Down Expand Up @@ -97,6 +118,8 @@ file( WRITE \${CMAKE_INSTALL_PREFIX}/thisREST.sh

\"\#!/bin/bash

${loadLCG}

\# check active shell by checking for existence of _VERSION variable
if [[ -n \\\"\\\${BASH_VERSION}\\\" ]]; then
thisdir=\\\$(cd \\\$(dirname \\\${BASH_ARGV[0]}); pwd)
Expand Down
Loading