Page MenuHomeHEPForge

No OneTemporary

diff --git a/cmake/NuWroSetup.cmake b/cmake/NuWroSetup.cmake
index 149bfb9..f649bff 100644
--- a/cmake/NuWroSetup.cmake
+++ b/cmake/NuWroSetup.cmake
@@ -1,93 +1,112 @@
# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
################################################################################
# This file is part of NUISANCE.
#
# NUISANCE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# NUISANCE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with NUISANCE. If not, see <http://www.gnu.org/licenses/>.
################################################################################
if(NOT NUWRO_INPUT_FILE STREQUAL "")
if(NOT EXISTS ${NUWRO_INPUT_FILE})
cmessage(FATAL_ERROR "Expected -DNUWRO_INPUT_FILE to point to a valid input file. Cannot find: '${NUWRO_INPUT_FILE}'")
endif()
if(CMAKE_BUILD_TYPE MATCHES DEBUG)
BuildROOTProject(NuWro_event1 ${NUWRO_INPUT_FILE} "event,vec,vect,particle,flags,params,line" STATIC)
SET(ROOTLIBNAME "libNuWro_event1.a")
else(CMAKE_BUILD_TYPE MATCHES RELEASE)
BuildROOTProject(NuWro_event1 ${NUWRO_INPUT_FILE} "event,vec,vect,particle,flags,params,line" SHARED)
SET(ROOTLIBNAME "libNuWro_event1.so")
endif()
ADD_CUSTOM_TARGET(NuWro_event1HeaderLink ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink
${CMAKE_BINARY_DIR}/NuWro_event1/event.h
${CMAKE_BINARY_DIR}/NuWro_event1/event1.h
DEPENDS NuWro_event1)
LIST(APPEND EXTRA_CXX_FLAGS -D__NUWRO_ENABLED__)
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/NuWro_event1)
LIST(APPEND EXTRA_LINK_DIRS ${CMAKE_BINARY_DIR})
LIST(APPEND EXTRA_LIBS NuWro_event1)
LIST(APPEND PROJECTWIDE_EXTRA_DEPENDENCIES NuWro_event1HeaderLink )
install(TARGETS NuWro_event1 DESTINATION lib)
SET(NUWRO_BUILT_FROM_FILE TRUE)
else()
if(NUWRO STREQUAL "")
cmessage(FATAL_ERROR "Variable NUWRO is not defined. "
"This must be set to point to a prebuilt NuWro instance.")
endif()
- if(NUWRO_INC STREQUAL "")
- cmessage(FATAL_ERROR "Variable NUWRO_INC is not defined. "
- "This must be set to point to an installed NuWro instance.")
- endif()
# If you are using a version of NuWro without reweighting use this to compile.
if(USE_NuWro_RW)
+ if(NUWRO_INC STREQUAL "")
+ cmessage(FATAL_ERROR "Variable NUWRO_INC is not defined. "
+ "This must be set to point to an installed NuWro instance.")
+ endif()
+
LIST(APPEND EXTRA_CXX_FLAGS -D__NUWRO_ENABLED__ -D__NUWRO_REWEIGHT_ENABLED__)
if(USE_NuWro_SRW_Event)
LIST(APPEND EXTRA_CXX_FLAGS -D__USE_NUWRO_SRW_EVENTS__)
endif()
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES
${NUWRO}/src
${NUWRO}/src/reweight
${NUWRO_INC}/nuwro)
LIST(APPEND EXTRA_LINK_DIRS ${NUWRO}/build/${CMAKE_SYSTEM_NAME}/lib)
LIST(APPEND EXTRA_LIBS reweight event)
else ()
LIST(APPEND EXTRA_CXX_FLAGS -D__NUWRO_ENABLED__)
LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES ${NUWRO}/src)
- LIST(APPEND EXTRA_SHAREDOBJS ${NUWRO}/bin/event1.so)
+ if(NOT EXISTS ${NUWRO}/bin/event1.so)
+ if(EXISTS ${NUWRO}/build/${CMAKE_SYSTEM_NAME}/lib)
+
+ if(NUWRO_INC STREQUAL "")
+ cmessage(FATAL_ERROR "Variable NUWRO_INC is not defined. "
+ "This must be set to point to an installed NuWro instance.")
+ endif()
+
+ LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES ${NUWRO_INC}/nuwro)
+
+ LIST(APPEND EXTRA_LINK_DIRS ${NUWRO}/build/${CMAKE_SYSTEM_NAME}/lib)
+ LIST(APPEND EXTRA_LIBS event)
+ else()
+ cmessage(FATAL_ERROR "Expected to find the NuWro event library in: ${NUWRO}/bin/event1.so, or if using NuWro with reweight support: ${NUWRO}/build/${CMAKE_SYSTEM_NAME}/lib/libevent.a. Is NuWro built?")
+ endif()
+ else()
+ LIST(APPEND EXTRA_SHAREDOBJS ${NUWRO}/bin/event1.so)
+ endif()
+
endif()
set(NEED_PYTHIA6 TRUE)
set(NEED_ROOTPYTHIA6 TRUE)
endif()
diff --git a/cmake/setup.sh.in b/cmake/setup.sh.in
index 9acb3f8..f5ef12e 100644
--- a/cmake/setup.sh.in
+++ b/cmake/setup.sh.in
@@ -1,130 +1,134 @@
# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
################################################################################
# This file is part of NUISANCE.
#
# NUISANCE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# NUISANCE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with NUISANCE. If not, see <http://www.gnu.org/licenses/>.
################################################################################
#!/bin/sh
if ! [[ ":$PATH:" == *":@CMAKE_INSTALL_PREFIX@/bin:"* ]]; then
export PATH=@CMAKE_INSTALL_PREFIX@/bin:$PATH
fi
if ! [[ ":$LD_LIBRARY_PATH:" == *":@CMAKE_INSTALL_PREFIX@/lib:"* ]]; then
export LD_LIBRARY_PATH=@CMAKE_INSTALL_PREFIX@/lib:$LD_LIBRARY_PATH
fi
if [[ ! "${ROOTSYS}" ]]; then
echo "[INFO]: Sourcing ROOT from: @CMAKE_ROOTSYS@"
source "@CMAKE_ROOTSYS@/bin/thisroot.sh"
fi
if [[ "@USE_NEUT@" != "FALSE" ]]; then
echo "[INFO]: Adding NEUT library paths to the environment."
export NEUT_ROOT=@NEUT_ROOT@
export CERN=@CERN@
export CERN_LEVEL=@CERN_LEVEL@
if ! [[ ":$LD_LIBRARY_PATH:" == *":${NEUT_ROOT}/lib/Linux_pc:"* ]]; then
export LD_LIBRARY_PATH=${NEUT_ROOT}/lib/Linux_pc:$LD_LIBRARY_PATH
fi
if ! [[ ":$LD_LIBRARY_PATH:" == *":${NEUT_ROOT}/src/reweight:"* ]]; then
export LD_LIBRARY_PATH=${NEUT_ROOT}/src/reweight:$LD_LIBRARY_PATH
fi
fi
if [[ "@USE_NuWro@" != "FALSE" ]]; then
if [[ "@NUWRO_BUILT_FROM_FILE@" == "FALSE" ]]; then
echo "[INFO]: Adding NuWro library paths to the environment."
export NUWRO="@NUWRO@"
if ! [[ ":$LD_LIBRARY_PATH:" == *":@NUWRO@/build/@CMAKE_SYSTEM_NAME@/lib:"* ]]; then
export LD_LIBRARY_PATH=@NUWRO@/build/@CMAKE_SYSTEM_NAME@/lib:$LD_LIBRARY_PATH
fi
+
+ if [[ "@NUWRO_INC@" ]]; then
+ export NUWRO_INC=@NUWRO_INC@
+ fi
else
echo "[INFO]: NuWro support included from input event file."
fi
fi
if [[ "@NEED_PYTHIA6@" != "FALSE" ]]; then
echo "[INFO]: Adding PYTHIA6 library paths to the environment."
export PYTHIA6="@PYTHIA6@"
if ! [[ ":$LD_LIBRARY_PATH:" == *":@PYTHIA6@:"* ]]; then
export LD_LIBRARY_PATH=@PYTHIA6@:$LD_LIBRARY_PATH
fi
fi
if [[ "@USE_GENIE@" != "FALSE" ]]; then
echo "[INFO]: Adding GENIE paths to the environment."
export GENIE="@GENIE@"
export LHAPDF_LIB="@LHAPDF_LIB@"
export LHAPDF_INC="@LHAPDF_INC@"
export LIBXML2_LIB="@LIBXML2_LIB@"
export LIBXML2_INC="@LIBXML2_INC@"
export LOG4CPP_LIB="@LOG4CPP_LIB@"
export LOG4CPP_INC="@LOG4CPP_INC@"
if [[ "@LHAPATH@" ]]; then
export LHAPATH="@LHAPATH@"
fi
if ! [[ ":$PATH:" == *":@GENIE@/bin:"* ]]; then
export PATH=@GENIE@/bin:$PATH
fi
if ! [[ ":$LD_LIBRARY_PATH:" == *":@GENIE@/lib:"* ]]; then
export LD_LIBRARY_PATH=@GENIE@/lib:$LD_LIBRARY_PATH
fi
if ! [[ ":$LD_LIBRARY_PATH:" == *":@LHAPDF_LIB@:"* ]]; then
export LD_LIBRARY_PATH=@LHAPDF_LIB@:$LD_LIBRARY_PATH
fi
if ! [[ ":$LD_LIBRARY_PATH:" == *":@LIBXML2_LIB@:"* ]]; then
export LD_LIBRARY_PATH=@LIBXML2_LIB@:$LD_LIBRARY_PATH
fi
if ! [[ ":$LD_LIBRARY_PATH:" == *":@LOG4CPP_LIB@:"* ]]; then
export LD_LIBRARY_PATH=@LOG4CPP_LIB@:$LD_LIBRARY_PATH
fi
fi
if [[ "@USE_NIWG@" != "FALSE" ]]; then
echo "[INFO]: Adding NIWG paths to the environment."
export NIWG=@NIWG_ROOT@
export NIWGREWEIGHT_INPUTS=@NIWG_ROOT@/inputs
if ! [[ ":$LD_LIBRARY_PATH:" == *":@NIWG_ROOT@:"* ]]; then
export LD_LIBRARY_PATH=${NIWG}:${LD_LIBRARY_PATH}
fi
fi
if [[ "@USE_T2K@" != "FALSE" ]]; then
echo "[INFO]: Adding T2K paths to the environment."
export T2KREWEIGHT=@T2KREWEIGHT@
if ! [[ ":$LD_LIBRARY_PATH:" == *":@T2KREWEIGHT@/lib:"* ]]; then
export LD_LIBRARY_PATH=${T2KREWEIGHT}/lib:${LD_LIBRARY_PATH}
fi
fi
if [[ "@BUILD_GiBUU@" != "FALSE" ]]; then
echo "[INFO]: Sourcing GiBUU tools."
source @CMAKE_BINARY_DIR@/GiBUUTools/src/GiBUUTools-build/Linux/setup.sh
fi
export NUISANCE="@CMAKE_SOURCE_DIR@"

File Metadata

Mime Type
text/x-diff
Expires
Sun, Feb 23, 2:47 PM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4472801
Default Alt Text
(8 KB)

Event Timeline