Skip to content

Commit

Permalink
Merge pull request #101 from DUNE/feature/Alma9_working_Makefile
Browse files Browse the repository at this point in the history
Change setup.sh and Makefile for Almalinux 9
  • Loading branch information
LiamOS authored May 3, 2024
2 parents 3d13bfd + bc88d2e commit cf2a9b5
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 59 deletions.
17 changes: 12 additions & 5 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ LD_SHARED=g++
ROOT_LIBS = $(shell root-config --evelibs)
ROOT_INC = $(shell root-config --cflags)

EDEP_LIBS = -L $(EDEPSIM_LIB) -ledepsim_io
# Need CLHEP for unit conversion, can probably just move this into a standalone header to remove dependency?
EDEP_INC = -I$(EDEPSIM_INC) -I$(CLHEP_INC)
# CLHEP_INC, EDEPSIM_INC, EDEPSIM_LIB need to be defined in the shell this is run in.
# If they're not, the -I<blank> -I... options might spook your compiler
GEANT4_LIBS = $(shell geant4-config --libs)
GEANT4_INC = $(shell geant4-config --prefix)/include/

CLHEP_LIBS = $(shell clhep-config --libs)
CLHEP_INC = $(shell clhep-config --prefix)/include/

ifndef CLHEP_INC # If not defined, normal build.
CLHEP_INC = $(shell clhep-config --prefix)/include/
CLHEP_LIBS = $(shell clhep-config --libs)
else # github CI passes CLHEP_INC as an environment var, use this to set lib dir
CLHEP_LIBS = $(CLHEP_INC)/../../lib64
endif

# The TMS includes
TMS_INC = -I../src
Expand Down
51 changes: 0 additions & 51 deletions setup.sh

This file was deleted.

44 changes: 44 additions & 0 deletions setup_FNAL.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
# @Liam on Slack when this breaks

echo "Make sure you source this in the top level directory of dune-tms/"

# Setup FNAL spack
source /cvmfs/larsoft.opensciencegrid.org/spack-packages/setup-env.sh
# Source Liam's spack environment that includes dune_spack repository and package binaries
source /exp/dune/data/users/losulliv/spack/my_spack/setup-env.sh

# Load up a load of schtuff with spack
# - All the good stuff is built with gcc 12.2.0 toolchain, load newer cmake
# - Load root, geant4, clhep, expatn and edep-sim built with above toolchain
spack load [email protected] && echo "Setup gcc..."
spack load [email protected]%[email protected] && echo "Setup cmake..."
spack load [email protected]%[email protected] && echo "Setup root..."
spack load [email protected]%[email protected] && echo "Setup geant4..."
spack load [email protected]%[email protected] && echo "Setup clhep..."
spack load [email protected]%[email protected] && echo "Setup expat..."
spack load [email protected]%[email protected] && echo "Setup edep-sim..."

export TMS_DIR=${PWD}
export PATH=${PATH}:${TMS_DIR}/bin
if [ "${LD_LIBRARY_PATH}x" == "x" ]; then
LD_LIBRARY_PATH=${TMS_DIR}/lib
else
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${TMS_DIR}/lib
fi

# Add edep-sim library path if available
if [ "${EDEP_ROOT}x" != "x" ]; then
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${EDEP_ROOT}/lib
fi

# Add edep-sim library path if available
which clhep-config > /dev/null 2>&1
if [ $? ]; then
CLHEP_ROOT=`clhep-config --prefix | sed 's/\"//g'` # (:
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${CLHEP_ROOT}/lib
fi

echo "TMS_DIR = ${TMS_DIR}"
echo "LD_LIBRARY_PATH = ${LD_LIBRARY_PATH}"
echo "Setup TMS environment :)"
15 changes: 12 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@ LD_SHARED=g++
ROOT_LIBS = $(shell root-config --evelibs)
ROOT_INC = $(shell root-config --cflags)

EDEP_LIBS = -L $(EDEPSIM_LIB) -ledepsim_io
# Need CLHEP for unit conversion, can probably just move this into a standalone header to remove dependency?
EDEP_INC = -I$(EDEPSIM_INC) -I$(CLHEP_INC)
GEANT4_LIBS = $(shell geant4-config --libs)
GEANT4_INC = $(shell geant4-config --prefix)/include/

ifndef CLHEP_INC # If not defined, normal build.
CLHEP_INC = $(shell clhep-config --prefix)/include/
CLHEP_LIBS = $(shell clhep-config --libs)
else # github CI passes CLHEP_INC as an environment var, use this to set lib dir
CLHEP_LIBS = $(CLHEP_INC)/../../lib64
endif

EDEP_LIBS = -L $(EDEPSIM_LIB) -ledepsim_io $(CLHEP_LIBS)
EDEP_INC = -I$(EDEPSIM_INC) -I$(GEANT4_INC) -I$(CLHEP_INC)

TOML_INC = -I../toml11/

Expand Down

0 comments on commit cf2a9b5

Please sign in to comment.