Skip to content
Snippets Groups Projects
Commit 0c2403ea authored by Bertram Kopf's avatar Bertram Kopf
Browse files

added FindBoost.cmake and FindMinuit2.cmake

parent 60aea928
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,36 @@ include(WriteConfigFile) ...@@ -20,6 +20,36 @@ include(WriteConfigFile)
# mandatory # mandatory
find_package(ROOT REQUIRED) find_package(ROOT REQUIRED)
SET (Boost_USE_MULTITHREAD ON)
SET (Boost_ADDITIONAL_VERSIONS "1.42" "1.43.0")
FIND_PACKAGE(Boost 1.42 REQUIRED COMPONENTS
date_time
filesystem
program_options
regex
serialization
system
thread
)
# The test component is not necessary for the library, but needed for the tests
FIND_PACKAGE(Boost 1.42 COMPONENTS
test_exec_monitor
)
MESSAGE("Boost_INCLUDE_DIRS: " ${Boost_INCLUDE_DIRS})
MESSAGE("Boost_LIBRARIES: " ${Boost_LIBRARIES})
MESSAGE("Boost_LIBRARY_DIRS: " ${Boost_LIBRARY_DIRS})
FIND_PACKAGE(Minuit2 REQUIRED)
MESSAGE("Minuit2_INCLUDE_DIRS: " ${Minuit2_INCLUDE_DIRS})
MESSAGE("Minuit2_LIBRARY_DIRS: " ${Minuit2_LIBRARY_DIRS})
MESSAGE("Minuit2_LIBRARIES: " ${Minuit2_LIBRARIES})
# Set the library type to static by default # Set the library type to static by default
IF( NOT PAWIAN_STATIC ) IF( NOT PAWIAN_STATIC )
SET( PAWIAN_STATIC TRUE ) SET( PAWIAN_STATIC TRUE )
......
...@@ -3,6 +3,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.4.3 FATAL_ERROR) ...@@ -3,6 +3,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.4.3 FATAL_ERROR)
SET ( CMAKEFILES SET ( CMAKEFILES
FindROOT.cmake FindROOT.cmake
FindBoost.cmake
FindMinuit2.cmake
) )
INSTALL ( FILES ${CMAKEFILES} DESTINATION CMakeModules ) INSTALL ( FILES ${CMAKEFILES} DESTINATION CMakeModules )
This diff is collapsed.
# If Minuit2_ROOT was defined in the environment, use it.
if(NOT Minuit2_ROOT AND NOT $ENV{Minuit2_ROOT} STREQUAL "")
set(Minuit2_ROOT $ENV{Minuit2_ROOT})
endif()
if(Minuit2_ROOT)
set(_Minuit2_INCLUDE_SEARCH_DIRS
${Minuit2_INCLUDEDIR}
${Minuit2_ROOT}/include
${Minuit2_ROOT}/inc
${Minuit2_ROOT})
set(_Minuit2_LIBRARIES_SEARCH_DIRS
${Minuit2_LIBRARYDIR}
${Minuit2_ROOT}/lib
${Minuit2_ROOT}/src/.libs
${Minuit2_ROOT})
endif()
find_path(Minuit2_INCLUDE_DIRS Minuit2/FCNBase.h
HINTS ${_Minuit2_INCLUDE_SEARCH_DIRS})
set(Minuit2_LIBRARIES Minuit2)
find_library(Minuit2_LIBRARY ${Minuit2_LIBRARIES}
HINTS ${_Minuit2_LIBRARIES_SEARCH_DIRS})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Minuit2 DEFAULT_MSG
Minuit2_INCLUDE_DIRS Minuit2_LIBRARY)
# If Minuit2 is built with GCC and OpenMP enabled, it contains
# undefined references to some omp_* and GOMP_* symbols. 3rd-party
# programs therefore need to link to gomp on their own.
# if(UNIX)
# execute_process(COMMAND ldd -r ${Minuit2_LIBRARY}
# ERROR_VARIABLE Minuit2_LDD_ERROR OUTPUT_QUIET)
# if (Minuit2_LDD_ERROR MATCHES "undefined.*GOMP")
# set(Minuit2_LIBRARIES ${Minuit2_LIBRARIES} gomp)
# endif()
# endif()
get_filename_component(Minuit2_LIBRARY_DIRS ${Minuit2_LIBRARY} PATH)
mark_as_advanced(
Minuit2_INCLUDE_DIRS
Minuit2_LIBRARY_DIRS
Minuit2_LIBRARIES)
...@@ -116,7 +116,7 @@ IF (ROOT_FOUND) ...@@ -116,7 +116,7 @@ IF (ROOT_FOUND)
# STRING(REGEX MATCHALL "-L([^ ])+" root_library ${root_flags}) # STRING(REGEX MATCHALL "-L([^ ])+" root_library ${root_flags})
# REMOVE_FROM_LIST(root_flags "${root_libs_all}" "${root_library}") # REMOVE_FROM_LIST(root_flags "${root_libs_all}" "${root_library}")
SET(root_flags ${root_flags} -lMinuit) SET(root_flags ${root_flags})
SET(ROOT_LIBRARIES ${root_flags}) SET(ROOT_LIBRARIES ${root_flags})
# MESSAGE("ROOT_LIBRARIES: " ${ROOT_LIBRARIES}) # MESSAGE("ROOT_LIBRARIES: " ${ROOT_LIBRARIES})
......
...@@ -8,14 +8,18 @@ endif(COMMAND cmake_policy) ...@@ -8,14 +8,18 @@ endif(COMMAND cmake_policy)
SET (INCLUDE_DIRECTORIES SET (INCLUDE_DIRECTORIES
${ROOT_INCLUDE_DIR} ${ROOT_INCLUDE_DIR}
${Minuit2_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR} ) ${CMAKE_SOURCE_DIR} )
INCLUDE_DIRECTORIES (AFTER INCLUDE_DIRECTORIES (AFTER
${ROOT_INCLUDE_DIR} ${ROOT_INCLUDE_DIR}
${Minuit2_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}
) )
LINK_DIRECTORIES(${ROOT_LIBRARY_DIR}) LINK_DIRECTORIES(
${Minuit2_LIBRARY_DIRS}
${ROOT_LIBRARY_DIR})
######## Linking "compton_scatteringApp ########################### ######## Linking "compton_scatteringApp ###########################
...@@ -74,9 +78,9 @@ ADD_EXECUTABLE(${EXECUTABLENAME} ...@@ -74,9 +78,9 @@ ADD_EXECUTABLE(${EXECUTABLENAME}
) )
MESSAGE("ROOT_LIBRARIES: " ${ROOT_LIBRARIES}) MESSAGE("ROOT_LIBRARIES: " ${ROOT_LIBRARIES})
TARGET_LINK_LIBRARIES (${EXECUTABLENAME} TARGET_LINK_LIBRARIES (${EXECUTABLENAME}
Minuit2 ${Minuit2_LIBRARIES}
${ROOT_LIBRARIES}
qft++ qft++
${ROOT_LIBRARIES}
) )
INSTALL ( TARGETS ${EXECUTABLENAME} DESTINATION bin/${EXECUTABLENAME}) INSTALL ( TARGETS ${EXECUTABLENAME} DESTINATION bin/${EXECUTABLENAME})
......
...@@ -191,18 +191,18 @@ Tensor<complex<double> > EtacToa1320pi0fit::calcSpin2Amp(Vector4<double>& pi_cm, ...@@ -191,18 +191,18 @@ Tensor<complex<double> > EtacToa1320pi0fit::calcSpin2Amp(Vector4<double>& pi_cm,
Tensor<complex<double> > result(0); //rank-0 Tensor for the amplitude Tensor<complex<double> > result(0); //rank-0 Tensor for the amplitude
Vector4<double> a1320_cm=eta_cm + pi_cm; Vector4<double> inter_cm=eta_cm + pi_cm;
PolVector a1320_Pol_cm(2); PolVector inter_Pol_cm(2);
a1320_Pol_cm.SetP4(a1320_cm,a1320_cm.M()); inter_Pol_cm.SetP4(inter_cm,inter_cm.M());
OrbitalTensor orb_eta_To_a2_piRecoil(2); OrbitalTensor orb_eta_To_a2_piRecoil(2);
orb_eta_To_a2_piRecoil.SetP4(a1320_cm, pi_recoil_cm); orb_eta_To_a2_piRecoil.SetP4(inter_cm, pi_recoil_cm);
OrbitalTensor orb_a2_To_pieta(2); OrbitalTensor orb_a2_To_pieta(2);
orb_a2_To_pieta.SetP4(pi_cm, eta_cm); orb_a2_To_pieta.SetP4(pi_cm, eta_cm);
result = (orb_a2_To_pieta) | ( a1320_Pol_cm.Projector() | orb_eta_To_a2_piRecoil ); result = (orb_a2_To_pieta) | ( inter_Pol_cm.Projector() | orb_eta_To_a2_piRecoil );
return result; return result;
} }
...@@ -213,18 +213,18 @@ Tensor<complex<double> > EtacToa1320pi0fit::calcSpin1Amp(Vector4<double>& pi_cm, ...@@ -213,18 +213,18 @@ Tensor<complex<double> > EtacToa1320pi0fit::calcSpin1Amp(Vector4<double>& pi_cm,
Tensor<complex<double> > result(0); // rank-0 Tensor for the amplitude Tensor<complex<double> > result(0); // rank-0 Tensor for the amplitude
Vector4<double> a1320_cm=eta_cm + pi_cm; Vector4<double> inter_cm=eta_cm + pi_cm;
PolVector a1320_Pol_cm(1); PolVector inter_Pol_cm(1);
a1320_Pol_cm.SetP4(a1320_cm,a1320_cm.M()); inter_Pol_cm.SetP4(inter_cm,inter_cm.M());
OrbitalTensor orb_eta_To_a2_piRecoil(1); OrbitalTensor orb_eta_To_a2_piRecoil(1);
orb_eta_To_a2_piRecoil.SetP4(a1320_cm, pi_recoil_cm); orb_eta_To_a2_piRecoil.SetP4(inter_cm, pi_recoil_cm);
OrbitalTensor orb_a2_To_pieta(1); OrbitalTensor orb_a2_To_pieta(1);
orb_a2_To_pieta.SetP4(pi_cm, eta_cm); orb_a2_To_pieta.SetP4(pi_cm, eta_cm);
result = (orb_a2_To_pieta) | ( a1320_Pol_cm.Projector() | orb_eta_To_a2_piRecoil ); result = (orb_a2_To_pieta) | ( inter_Pol_cm.Projector() | orb_eta_To_a2_piRecoil );
return result; return result;
} }
......
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