Skip to content

Commit

Permalink
Merge pull request #96 from spaulaus/feature/94-updating-cmake
Browse files Browse the repository at this point in the history
Resolves #94
  • Loading branch information
spaulaus authored Dec 8, 2020
2 parents 97afd60 + d29292a commit dd811de
Show file tree
Hide file tree
Showing 73 changed files with 1,601 additions and 1,462 deletions.
36 changes: 22 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- python3
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- BUILD_OPTIONS="-DPAASS_BUILD_TESTS=ON -DPAASS_BUILD_UTKSCAN=ON -DPAASS_BUILD_ROOT_SCANNER=OFF -DPAASS_BUILD_SETUP=ON"
- BUILD_OPTIONS="-DPAASS_BUILD_TESTS=ON"
- name: GCC 8 Test
addons:
apt:
Expand All @@ -33,7 +33,7 @@ jobs:
- python3
env:
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
- BUILD_OPTIONS="-DPAASS_BUILD_TESTS=ON -DPAASS_BUILD_UTKSCAN=ON -DPAASS_BUILD_ROOT_SCANNER=OFF -DPAASS_BUILD_SETUP=ON"
- BUILD_OPTIONS="-DPAASS_BUILD_TESTS=ON"
- name: GCC 9 Test
addons:
apt:
Expand All @@ -45,23 +45,31 @@ jobs:
- python3
env:
- MATRIX_EVAL=""
- BUILD_OPTIONS="-DPAASS_BUILD_TESTS=ON -DPAASS_BUILD_UTKSCAN=ON -DPAASS_BUILD_ROOT_SCANNER=OFF -DPAASS_BUILD_SETUP=ON"

- BUILD_OPTIONS="-DPAASS_BUILD_TESTS=ON"

before_install:
- sudo apt-get -qq update --install-suggests
- eval "${MATRIX_EVAL}"
- export ORIG_DIR=$PWD
- mkdir -p /opt/plx/ && cd /opt/plx
- git clone https://github.com/spaulaus/plx-api.git && ln -s plx-api current && cd plx-api
- export PLX_SDK_DIR=$PWD && make all && cd ${ORIG_DIR}
- git clone https://github.com/spaulaus/xia-api.git && cd xia-api
- python3 waf configure build install --prefix=${ORIG_DIR} && cd $ORIG_DIR
- export XIA_ROOT_DIR=${ORIG_DIR}/xia
- export ORIG_DIR=${PWD}
- git clone https://github.com/spaulaus/plx-api.git
- cd plx-api
- export PLX_SDK_DIR=$PWD
- make all
- cd ${ORIG_DIR}
- git clone https://github.com/spaulaus/xia-api.git
- cd xia-api
- mkdir build
- cd build
- cmake ../ -DCMAKE_INSTALL_PREFIX=${ORIG_DIR}
- make -j12 install
- export XIA_PIXIE_SDK=${ORIG_DIR}/xia/pixie/sdk
- cd ${ORIG_DIR}
- wget https://root.cern/download/root_v6.22.02.Linux-ubuntu20-x86_64-gcc9.3.tar.gz
- tar xzf root_v6.22.02.Linux-ubuntu20-x86_64-gcc9.3.tar.gz
- source root/bin/thisroot.sh

script:
- mkdir paass-build && cd paass-build
- cmake ../ ${BUILD_OPTIONS} && make -j8 && ./Tests/tests
- mkdir build
- cd build
- cmake ../ ${BUILD_OPTIONS}
- make -j12
- ./Tests/tests
37 changes: 15 additions & 22 deletions Acquisition/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
# @authors S. V. Paulauskas, K. Smith, and C. R. Thornsberry

#Adds the install prefix for referencing in the source code
add_definitions(-D INSTALL_PREFIX="\\"${CMAKE_INSTALL_PREFIX}\\"")
#Build the pixie interface
include_directories(Interface/include)
add_subdirectory(Interface/source)
#Build the MCA objects
include_directories(MCA/include)
add_subdirectory(MCA)
#Build PxiDump
add_subdirectory(set2root)
add_subdirectory(Utilities/set2root)
add_subdirectory(Setup)
#TODO: We need to revist where this guy lives as he's dependent on the scan libraries. Maybe should live there??
#add_subdirectory(Utilities/DataGenerator)
#Build poll
add_subdirectory(Poll)
if (PAASS_BUILD_ACQ)
find_package(PLX REQUIRED)
find_package(XIA REQUIRED)
XIA_CONFIG()
if(PAASS_BUILD_ANALYSIS)
add_subdirectory(Utilities/DataGenerator)
endif(PAASS_BUILD_ANALYSIS)
add_subdirectory(Interface)
add_subdirectory(MCA)
add_subdirectory(Poll)
add_subdirectory(Utilities/listener)
add_subdirectory(Utilities/monitor)
add_subdirectory(Utilities/send_alarm)
endif (PAASS_BUILD_ACQ)
#Build the setup tools
if (PAASS_BUILD_SETUP)
add_subdirectory(Setup)
endif (PAASS_BUILD_SETUP)
9 changes: 9 additions & 0 deletions Acquisition/Interface/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_library(PixieInterface SHARED source/PixieInterface.cpp source/Lock.cpp source/PixieSupport.cpp source/Utility.cpp)
target_include_directories(PixieInterface PUBLIC include ${PROJECT_SOURCE_DIR}/Core/include ${XIA_INCLUDE_DIR})
target_link_directories(PixieInterface PUBLIC ${XIA_LIBRARY_DIR} ${PLX_LIBRARY_DIR})
target_link_libraries(PixieInterface PaassCore ${XIA_LIBRARIES} ${PLX_LIBRARIES})
target_compile_options(PixieInterface PRIVATE "-DPLX_LINUX")

file(GLOB PIXIE_INTERFACE_PUBLIC_HEADERS include/*.h)
set_target_properties(PixieInterface PROPERTIES PUBLIC_HEADER "${PIXIE_INTERFACE_PUBLIC_HEADERS}")
install(TARGETS PixieInterface LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include)
13 changes: 0 additions & 13 deletions Acquisition/Interface/source/CMakeLists.txt

This file was deleted.

19 changes: 12 additions & 7 deletions Acquisition/MCA/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# @authors C. R. Thornsberry, K. Smith
include_directories(include)
if(ROOT_FOUND)
add_subdirectory(source)
else ()
message(STATUS "MCA not built as no compatible histogramming routines selected.")
endif ()
add_library(MCALibrary SHARED source/MCA.cpp source/MCA_ROOT.cpp)
target_include_directories(MCALibrary PUBLIC include ${PROJECT_SOURCE_DIR}/Acquisition/Interface/include ${ROOT_INCLUDE_DIR})
target_link_libraries(MCALibrary PixieInterface ${ROOT_LIBRARIES})

file(GLOB MCA_PUBLIC_HEADERS include/*.h)
set_target_properties(MCALibrary PROPERTIES PUBLIC_HEADER "${MCA_PUBLIC_HEADERS}")
install(TARGETS MCALibrary LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include)

add_executable(mca source/MCA_exec.cpp)
target_include_directories(mca PUBLIC include ${PROJECT_SOURCE_DIR}/Acquisition/Interface/include ${ROOT_INCLUDE_DIR})
target_link_libraries(mca PixieInterface MCALibrary ${ROOT_LIBRARIES})
install(TARGETS mca DESTINATION bin)
9 changes: 0 additions & 9 deletions Acquisition/MCA/source/CMakeLists.txt

This file was deleted.

12 changes: 4 additions & 8 deletions Acquisition/Poll/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#@authors K. Smith
include_directories(include)
add_subdirectory(source)

install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/send_alarm
PERMISSIONS OWNER_EXECUTE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
DESTINATION bin)
add_executable(poll2 source/poll2.cpp source/poll2_core.cpp source/poll2_stats.cpp)
target_include_directories(poll2 PUBLIC include ${PROJECT_SOURCE_DIR}/Resources/include)
target_link_libraries(poll2 PixieInterface MCALibrary ${CMAKE_THREAD_LIBS_INIT})
install(TARGETS poll2 DESTINATION bin)
16 changes: 0 additions & 16 deletions Acquisition/Poll/source/CMakeLists.txt

This file was deleted.

25 changes: 21 additions & 4 deletions Acquisition/Setup/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
#@author K. Smith
include_directories(include)
add_subdirectory(source)
add_subdirectory(Traces)
set(SETUP_UTILS adjust_offsets find_tau copy_params pread pwrite pmread pmwrite
rate boot trace get_traces csr_test toggle set_standard set_pileups_only
set_pileups_reject set_hybrid)

foreach (UTIL ${SETUP_UTILS})
add_executable(${UTIL} source/${UTIL}.cpp)
target_compile_definitions(${UTIL} PUBLIC "-DPLX_LINUX")
target_link_libraries(${UTIL} PixieInterface)
target_include_directories(${UTIL} PUBLIC include ${PROJECT_SOURCE_DIR}/Acquisition/Interface/include)
endforeach (UTIL)

install(TARGETS ${SETUP_UTILS} DESTINATION bin)

add_executable(paramScan source/paramScan.cpp)
target_include_directories(paramScan PUBLIC include ${PROJECT_SOURCE_DIR}/Acquisition/Interface/include
${ROOT_INCLUDE_DIR})
target_link_libraries(paramScan PixieInterface MCALibrary ${ROOT_LIBRARIES} "-lSpectrum")
install(TARGETS paramScan DESTINATION bin)

install(DIRECTORY share/traces DESTINATION share)
install(PROGRAMS bin/viewBaseline.sh DESTINATION bin RENAME viewBaseline)
5 changes: 0 additions & 5 deletions Acquisition/Setup/Traces/CMakeLists.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
19 changes: 0 additions & 19 deletions Acquisition/Setup/source/CMakeLists.txt

This file was deleted.

4 changes: 4 additions & 0 deletions Acquisition/Utilities/listener/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
add_executable(listener source/listener.cpp)
target_include_directories(listener PUBLIC ${PROJECT_SOURCE_DIR}/Core/include)
target_link_libraries(listener PaassCore)
install(TARGETS listener DESTINATION bin)
File renamed without changes.
5 changes: 5 additions & 0 deletions Acquisition/Utilities/monitor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
add_executable(monitor source/monitor.cpp)
target_include_directories(monitor PUBLIC ${PROJECT_SOURCE_DIR}/Core/include)
target_link_libraries(monitor PaassCore)
install(TARGETS monitor DESTINATION bin)
install(FILES bin/monitor.bash DESTINATION bin)
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions Acquisition/Utilities/send_alarm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
install(FILES bin/send_alarm DESTINATION bin)
File renamed without changes.
9 changes: 9 additions & 0 deletions Acquisition/Utilities/set2root/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_executable(set2ascii source/set2root.cpp)
target_include_directories(set2ascii PUBLIC include ${PROJECT_SOURCE_DIR}/Resources/include)
install(TARGETS set2ascii DESTINATION bin)

add_executable(set2root source/set2root.cpp)
set_target_properties(set2root PROPERTIES COMPILE_FLAGS "-DUSE_ROOT_OUTPUT")
target_include_directories(set2root PUBLIC include ${PROJECT_SOURCE_DIR}/Resources/include ${ROOT_INCLUDE_DIR})
target_link_libraries(set2root ${ROOT_LIBRARIES})
install(TARGETS set2root DESTINATION bin)
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions Acquisition/set2root/CMakeLists.txt

This file was deleted.

11 changes: 0 additions & 11 deletions Acquisition/set2root/source/CMakeLists.txt

This file was deleted.

50 changes: 15 additions & 35 deletions Analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,18 @@
#@authors K. Smith, S. V. Paulauskas, C. R. Thornsberry
option(PAASS_USE_HRIBF "Use HRIBF library for scan base." OFF)

#Check if GSL is installed
find_package(GSL REQUIRED)
include_directories(${GSL_INCLUDE_DIRS})
link_directories(${GSL_LIBRARY_DIRS})
if (${GSL_VERSION} LESS 2.0)
add_definitions("-D GSL_VERSION_ONE")
endif (${GSL_VERSION} LESS 2.0)

#Everything below is dependent on these two sets of libaries so we include the headers.
include_directories(Resources/include)
include_directories(ScanLibraries/include)

if (PAASS_USE_HRIBF)
#Find HRIBF Libraries
find_package(HRIBF REQUIRED)
add_definitions("-D USE_HRIBF")

enable_language(Fortran)

#If we are using HRIBF interface we need to include the ScanorInterface header for the following code.
include_directories(Scanor/include)
add_subdirectory(Scanor)
endif (PAASS_USE_HRIBF)

#We will always build these two since they include static lib for the rest
add_subdirectory(ScanLibraries)
add_subdirectory(Resources)

#Build utilities.
add_subdirectory(ScanLibraries)
add_subdirectory(Utilities)
add_subdirectory(Utkscan)

#option(PAASS_USE_HRIBF "Use HRIBF library for scan base." OFF)
#if (PAASS_USE_HRIBF)
# #Find HRIBF Libraries
# find_package(HRIBF REQUIRED)
# add_definitions("-D USE_HRIBF")
#
# enable_language(Fortran)
#
# #If we are using HRIBF interface we need to include the ScanorInterface header for the following code.
# include_directories(Scanor/include)
# add_subdirectory(Scanor)
#endif (PAASS_USE_HRIBF)

option(PAASS_BUILD_UTKSCAN "Build utkscan" OFF)
if (PAASS_BUILD_UTKSCAN)
add_subdirectory(Utkscan)
endif (PAASS_BUILD_UTKSCAN)
18 changes: 16 additions & 2 deletions Analysis/Resources/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
#author S. V. Paulauskas
add_subdirectory(source)
add_library(AnalysisResources SHARED source/ChannelConfiguration.cpp source/CrystalBallFunction.cpp
source/CsiFunction.cpp source/EmCalTimingFunction.cpp source/GslFitter.cpp source/PolynomialCfd.cpp
source/RootFitter.cpp source/SiPmtFastTimingFunction.cpp source/TimingConfiguration.cpp source/TraceFilter.cpp
source/TraditionalCfd.cpp source/VandleTimingFunction.cpp source/XiaCfd.cpp)

if (${GSL_VERSION} LESS 2.0)
target_compile_definitions(AnalysisResource "-DGSL_VERSION_ONE")
endif (${GSL_VERSION} LESS 2.0)

target_include_directories(AnalysisResources PUBLIC include ${PROJECT_SOURCE_DIR}/Resources/include
${PROJECT_SOURCE_DIR}/Analysis/ScanLibraries/include ${GSL_INCLUDE_DIRS})
target_link_libraries(AnalysisResources PaassResources ${ROOT_LIBRARIES} ${GSL_LIBRARIES})

file(GLOB ANALYSIS_RESOURCES_PUBLIC_HEADERS include/*.hpp)
set_target_properties(AnalysisResources PROPERTIES PUBLIC_HEADER "${ANALYSIS_RESOURCES_PUBLIC_HEADERS}")
install(TARGETS AnalysisResources LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include)
18 changes: 0 additions & 18 deletions Analysis/Resources/source/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit dd811de

Please sign in to comment.