Skip to content
Snippets Groups Projects
Commit 8ff2380c authored by Meg Millhouse's avatar Meg Millhouse
Browse files

Installation updates

parent 76eea0f9
No related branches found
No related tags found
No related merge requests found
......@@ -945,13 +945,20 @@ def condor_job_config(job_type, condor_job, config_parser):
"""
valid_job_types=['bayeswave','bayeswave_post','bayeswave_fpeak','bayeswave_clean_frame','megaplot']
# When using default env, need to add capitalization etc in
executableNames = {'bayeswave':'BayesWave','bayeswave_post':'BayesWavePost','bayeswave_fpeak':'BayesWaveFpeak','bayeswave_clean_frame':'BayesWaveCleanFrame','megaplot':'megaplot.py'}
try:
job_index = valid_job_types.index(job_type)
except ValueError:
print("unrecognized job type", file=sys.stderr)
# --- Set executable and choose singularity image
executable=config_parser.get('engine',job_type)
try:
executable=config_parser.get('engine',job_type)
except:
condaenv=sys.prefix+'/bin/'
executable=condaenv+executableNames[job_type]
print("Using executable...", executable)
universe=config_parser.get('condor','universe')
pipeline.CondorDAGJob.__init__(condor_job,universe,executable)
pipeline.AnalysisJob.__init__(condor_job,config_parser)
......
#
# CMake packaging for BayesWave
# Copyright 2019 James Alexander Clark <james.clark@ligo.org>
# Copyright 2019 James Alexander Clark <james.clark@ligo.org>, Meg Millhouse <meg.millhouse@ligo.org>
# Based on CMake packaging for libframe & Frv by Duncan MacLeod <duncan.macleod@ligo.org>
#
......@@ -21,6 +21,32 @@ find_package(PkgConfig)
find_package(Git)
find_package(OpenMP)
#-----------------------------------------------------------------------
# Set rpath so you don't have to set $LD_LIBRARY_PATH before running
# instructions from:
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
IF(DEFINED ENV{CONDA_PREFIX})
MESSAGE(STATUS "CONDA_PREFIX: --[$ENV{CONDA_PREFIX}]--")
ELSE()
MESSAGE(STATUS "Warning: could not find conda environment")
ENDIF()
# use, i.e. don't skip the full RPATH for the build tree
set(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# In order to be able to install into a user specified directory, need to make sure the RPATH has the install directory first, and then the conda prefix.
# So make sure to remove environment rpath, and then explicitly add conda library back in.
# May be a more elegant way to do this
set(CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}:$ENV{CONDA_PREFIX}/lib") #
# -- build components -------
# C library | enable/disable with -DENABLE_C={yes,no} (default yes)
......
#!/bin/bash
set -e
INSTALL_PREFIX=$1
INSTALL_PREFIX=${1:-${CONDA_PREFIX}}
echo ${INSTALL_PREFIX}
# Get cmake
if hash cmake 2>/dev/null; then
......
......@@ -17,16 +17,26 @@
set -e
# Allow user to specify install location, otherwise default to conda environment
install_dir=${1}
# check if user-defined installation location is set
if [ -z $1 ] # if empty
then
install_dir=${CONDA_PREFIX}
dir_flag=1
else
install_dir=$1
fi
# Remove trailing slash if present
install_dir=$(echo ${install_dir} | sed 's|/$||' )
while [ $install_dir = "" ]
do
read -p 'Specify install path: ' install_dir
done
# while [ $install_dir = "" ]
# do
# read -p 'Specify install path: ' install_dir
# done
# echo "Installing to ${install_dir}"
echo "Installing to ${install_dir}"
#
......@@ -53,11 +63,20 @@ popd
mkdir -p ${install_dir}/etc
sed "s|INSTALL_DIR|${install_dir}|g" etc/bayeswave-user-env.sh > ${install_dir}/etc/bayeswave-user-env.sh
echo ""
echo "*****************************************************************************"
echo " DONE: BayesWave built and installed to: "
echo " ${install_dir}"
echo " To use: "
echo " source ${install_dir}/etc/bayeswave-user-env.sh"
echo "*****************************************************************************"
# Tell user where BW was installed
if [ -z $dir_flag ]
then
echo ""
echo "*****************************************************************************"
echo " DONE: BayesWave built and installed to: "
echo " ${install_dir}"
echo " To use: "
echo " source ${install_dir}/etc/bayeswave-user-env.sh"
echo "*****************************************************************************"
else
echo ""
echo "*****************************************************************************"
echo " DONE: BayesWave built and installed into conda environment: "
echo " ${CONDA_DEFAULT_ENV}"
echo "*****************************************************************************"
fi
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment