-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cmake changes to almost get the feedback analyzer working.
Added a modeule to find the EPICS libraries on the adaq cluster, and a CMakeList to compile the Feedback library if both EPICS and ET have been found. I wasn't able to get the QwFeedback library and the feedback executable to both be compiled and linked though. Maybe @wdconinc can look at it...
- Loading branch information
Showing
5 changed files
with
126 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
#---------------------------------------------------------------------------- | ||
# ROOT | ||
# | ||
set(minimum_root_version 6.0) | ||
find_package(ROOT ${minimum_root_version} REQUIRED) | ||
config_add_dependency(ROOT ${minimum_root_version}) | ||
|
||
#---------------------------------------------------------------------------- | ||
# CODA ET | ||
# | ||
find_package(ET) | ||
|
||
#---------------------------------------------------------------------------- | ||
# EPICS | ||
find_package(EPICS) | ||
|
||
message(STATUS "*********** In Feedback Cmake") | ||
set_compiler_flags("${ROOT_CXX_FLAGS}") | ||
#set_diagnostic_flags(WALL WEXTRA) | ||
set_diagnostic_flags(WALL) | ||
report_build_info() | ||
|
||
#---------------------------------------------------------------------------- | ||
# Feedback needs both ET and EPICS | ||
IF(ET_FOUND) | ||
IF(EPICS_FOUND) | ||
include_directories(${ROOT_INCLUDE_DIR}) | ||
include_directories(${ET_INCLUDE_DIR}) | ||
include_directories(${EPICS_INCLUDE_DIR} | ||
${EPICS_INCLUDE_DIR}/os/Linux | ||
${EPICS_INCLUDE_DIR}/compiler/gcc) | ||
include_directories(${PROJECT_SOURCE_DIR}/Analysis/include | ||
${PROJECT_SOURCE_DIR}/Parity/include) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) | ||
|
||
set(feedback_sources | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/GreenMonster.cc | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/QwEPICSControl.cc | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/QwHelicityCorrelatedFeedback.cc | ||
${CMAKE_CURRENT_SOURCE_DIR}/src/cfSockCli.cc | ||
) | ||
add_library(QwFeedback SHARED ${feedback_sources}) | ||
target_include_directories(QwFeedback PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR}/include | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> | ||
) | ||
target_compile_options(QwFeedback | ||
PUBLIC | ||
${${PROJECT_NAME_UC}_CXX_FLAGS_LIST} | ||
PRIVATE | ||
${${PROJECT_NAME_UC}_DIAG_FLAGS_LIST} | ||
) | ||
target_link_libraries(QwFeedback | ||
PUBLIC | ||
EVIO::ET | ||
ROOT::Libraries | ||
${EPICS_CA_LIBRARY} ${EPICS_CAS_LIBRARY} ${EPICS_COM_LIBRARY} ${EPICS_GDD_LIBRARY} | ||
) | ||
|
||
install(TARGETS QwFeedback | ||
EXPORT ${MAIN_PROJECT_NAME_LC}-exports | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
) | ||
|
||
install(FILES ${my_feedback_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
|
||
endif(EPICS_FOUND) | ||
endif(ET_FOUND) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
extern "C" { | ||
#include "cfSockCli.c" | ||
} /* End extern "C" */ | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
### The path for EPICS is restricted to a single copy on the Hall A cluster | ||
### which has been compiled for 64-bit architecture. | ||
### In principle this could be generalized, but would need to have guards | ||
### to verify the library has been compiled with the correct flag. | ||
|
||
|
||
find_library(EPICS_CA_LIBRARY ca | ||
PATHS /adaqfs/apps/epics/lib/linux-x86_64 | ||
DOC "EPICS CA library" | ||
) | ||
find_library(EPICS_CAS_LIBRARY cas | ||
PATHS /adaqfs/apps/epics/lib/linux-x86_64 | ||
DOC "EPICS CAS library" | ||
) | ||
find_library(EPICS_COM_LIBRARY Com | ||
PATHS /adaqfs/apps/epics/lib/linux-x86_64 | ||
DOC "EPICS COM library" | ||
) | ||
find_library(EPICS_GDD_LIBRARY gdd | ||
PATHS /adaqfs/apps/epics/lib/linux-x86_64 | ||
DOC "EPICS GDD library" | ||
) | ||
# Needs to build this line: -L/adaqfs/apps/epics/lib/linux-x86_64 -lca -lcas -lCom -lgdd | ||
|
||
find_path(EPICS_INCLUDE_DIR | ||
NAMES cadef.h | ||
PATHS /adaqfs/apps/epics/include | ||
# $ENV{CODA}/common/include | ||
DOC "EPICS header include base directory" | ||
) | ||
# Needs to get all three: -I /adaqfs/apps/epics/include -I /adaqfs/apps/epics/include/os/Linux -I /adaqfs/apps/epics/include/compiler/gcc | ||
|
||
include(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EPICS "The EPICS libraries were not found; feedback analysis will be disabled." EPICS_CA_LIBRARY EPICS_CAS_LIBRARY EPICS_COM_LIBRARY EPICS_GDD_LIBRARY EPICS_INCLUDE_DIR) |
ad878dc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the issue is that the following fails?
ad878dc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config_add_dependency
is provided by cmake/modules/CMakeEnv.cmake this is not expected to build from inside Feedback, right