Geant4 Cross Reference |
1 #!/bin/bash -l 2 msg="=== $BASH_SOURCE :" 3 4 info(){ cat << EOI 5 $msg checking the environment 6 OPTICKS_HOME : $OPTICKS_HOME 7 CMAKE_PREFIX_PATH : 8 $(echo $CMAKE_PREFIX_PATH | tr ":" "\n") 9 The CMAKE_PREFIX_PATH is expected to contain about seven prefix directories including:: 10 OPTICKS_PREFIX : $OPTICKS_PREFIX 11 OPTICKS_PREFIX/externals : $OPTICKS_PREFIX/externals 12 Note that environment setup must be done in login scripts : .bashrc .bash_profile .opticks_config etc.. 13 Doing environment setup just in the current session will not work as scripts often invoke login scripts. 14 EOI 15 } 16 17 rc=0 18 if [ -z "$OPTICKS_HOME" -o -z "$OPTICKS_PREFIX" -o -z "$CMAKE_PREFIX_PATH" ]; then 19 echo $msg missing required envvars : your need to source .opticks_config 20 rc=1 21 fi 22 if [ "$CMAKE_PREFIX_PATH" == ${CMAKE_PREFIX_PATH/$OPTICKS_PREFIX:/} ]; then 23 echo $msg CMAKE_PREFIX_PATH does not contain the expected prefix : $OPTICKS_PREFIX : you need to invoke opticks-setup from .opticks_config 24 rc=2 25 fi 26 if [ "$CMAKE_PREFIX_PATH" == ${CMAKE_PREFIX_PATH/$OPTICKS_PREFIX\/externals\:/} ]; then 27 echo $msg CMAKE_PREFIX_PATH does not contain the expected prefix : $OPTICKS_PREFIX/externals : you need to invoke opticks-setup from .opticks_config 28 rc=3 29 fi 30 31 if [ $rc -ne 0 ]; then 32 info 33 echo $msg environment check FAILED : rc $rc 34 else 35 [ -n "$VERBOSE" ] && info 36 echo $msg environment check PASSED : rc $rc 37 fi 38 exit $rc