Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating CMake #96

Merged
merged 48 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
4c3a0ca
#94: Updating pugixml version to 1.11.1 and fixing its build.
spaulaus Dec 5, 2020
bb61afc
#94: Updated PaassResources library build
spaulaus Dec 5, 2020
9a3c99c
#94: Fixing the builds so that they install the includes
spaulaus Dec 5, 2020
fdad5ff
#94: Updating Core files so that they build properly
spaulaus Dec 5, 2020
51fb3e1
#94: Updating FindPLX.cmake to look for the stock lib names
spaulaus Dec 5, 2020
54189d1
#94: Updating FindXIA.cmake to take into account latest XIA updates
spaulaus Dec 5, 2020
be42799
#94: Fixing CI build script due to changes in the APIs
spaulaus Dec 5, 2020
1e415bc
#94: Interface builds and installs as expected
spaulaus Dec 5, 2020
8880f45
#94: Removing a confusing message from CMakeLists.txt
spaulaus Dec 5, 2020
1a7e093
#94: MCA binary and library build and install
spaulaus Dec 5, 2020
705641d
#94: poll2 binary builds and installs
spaulaus Dec 5, 2020
ef7a5c5
#94: Moved listener to the Acquisition/Utilities folder
spaulaus Dec 5, 2020
40f21c9
#94: Moved monitor to the Acquisition/Utilities folder
spaulaus Dec 5, 2020
b227b31
#94: Moved monitor.bash to keep it organized
spaulaus Dec 5, 2020
29450a0
#94: Updated so that we install monitor.bash
spaulaus Dec 5, 2020
069c336
#94: Organizing send_alarm to be in Utilities
spaulaus Dec 5, 2020
c082dc9
#94: Updating set2root build and install
spaulaus Dec 5, 2020
3df5c10
#94: Moving set2root to live with the other Utilities
spaulaus Dec 5, 2020
05d5cb3
#94: Building and installing individual setup programs
spaulaus Dec 5, 2020
f1084e4
#94: Adding note about the DataGenerator
spaulaus Dec 5, 2020
887f2bf
#94: Moving PLX and XIA SDK finds to the Acquisition CMakeLists.txt
spaulaus Dec 5, 2020
5c2f0ac
#94: Adding missing library to poll2 build
spaulaus Dec 5, 2020
56b3c6c
#94: Analysis/Resources builds and installs as expected.
spaulaus Dec 5, 2020
f72089e
#94: Adding Acquisition/Setup/Traces to install
spaulaus Dec 5, 2020
38cf0bb
#94: EventReader builds and installs
spaulaus Dec 5, 2020
489da2c
#94: HeadReader builds and installs
spaulaus Dec 6, 2020
ed9e9c5
#94: HexReader builds and installs
spaulaus Dec 6, 2020
0bac096
#94: Fixing CI build script
spaulaus Dec 6, 2020
2367075
#94: RootScanner builds and installs
spaulaus Dec 6, 2020
0dee74f
#94: Adding GSL library to the linker for AnalysisResources
spaulaus Dec 6, 2020
865733f
#94: Scope builds and installs
spaulaus Dec 6, 2020
7a1769a
#94: Skeleton builds and installs
spaulaus Dec 6, 2020
145c54e
#94: utkscan builds and installs
spaulaus Dec 6, 2020
025f111
#94: Adding GSL Option to AnalysisResources to allow GSL 1.X or 2.X u…
spaulaus Dec 6, 2020
a92082c
#94: Adding compilation flag to PixieInterface to ensure we get the L…
spaulaus Dec 6, 2020
13ebfcb
#94: Cleaning up the root directory's CMakeLists.txt
spaulaus Dec 6, 2020
c905823
#94: Ensuring tests pass and CTerminalTest builds.
spaulaus Dec 6, 2020
4b37a3f
#94: Adding missing compiler flag to Setup utilities
spaulaus Dec 6, 2020
74da5cd
#94: Updating CI build script
spaulaus Dec 6, 2020
5c20234
#94: Removing build options as we don't need them in the CI now.
spaulaus Dec 6, 2020
a7ba7b3
#94: Don't need to carry around our own FindGSL anymore.
spaulaus Dec 7, 2020
e283d01
#94: Fixing install prefix settings and adjusting install paths
spaulaus Dec 7, 2020
aaab4cb
#94: Taking the opportunity to update modulefile
spaulaus Dec 7, 2020
50c9af9
#94: Removing all the jazz around generating compile_commands.json
spaulaus Dec 7, 2020
f855e64
#94: Turning off tests by default.
spaulaus Dec 7, 2020
3bfbb8c
#94: Fixing install name for modulefile
spaulaus Dec 7, 2020
60c14ef
#94: Now that we don't have the tests built by default we need to adj…
spaulaus Dec 7, 2020
d29292a
#94: Fixing documentation in FindXIA.cmake
spaulaus Dec 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

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)
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.
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)
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