Skip to content

Commit

Permalink
adding back templates and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ruck314 committed Jul 6, 2024
1 parent 1f255c5 commit f8f7a09
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 105 deletions.
35 changes: 18 additions & 17 deletions templates/RogueConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ set(NO_PYTHON @NO_PYTHON@)
# Boost + Python
#####################################
if ( NOT NO_PYTHON )
find_package(PythonInterp 3 QUIET REQUIRED)
find_package(PythonLibs 3 QUIET REQUIRED)
# Search for newest version of Python3 first
set(Python3_FIND_STRATEGY "VERSION")
find_package(Python3 QUIET REQUIRED COMPONENTS Interpreter Development)

# Find Numpy
execute_process(
Expand All @@ -47,21 +48,21 @@ if ( NOT NO_PYTHON )

# Hint for boost on anaconda
if (DEFINED ENV{CONDA_PREFIX})
set(BOOST_ROOT $ENV{CONDA_PREFIX})
set(Boost_ROOT $ENV{CONDA_PREFIX})

# SLAC AFS custom path
elseif (DEFINED ENV{BOOST_PATH})
set(BOOST_ROOT $ENV{BOOST_PATH})
set(Boost_ROOT $ENV{BOOST_PATH})
endif()

# libboost_python3.7 style libraries
message("Looking for libboost_python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
FIND_PACKAGE(Boost 1.58 QUIET COMPONENTS python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
message("Looking for libboost_python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
FIND_PACKAGE(Boost 1.58 QUIET COMPONENTS python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})

# libboost_python3 style libraries
if (NOT Boost_FOUND)
message("Looking for libboost_python${PYTHON_VERSION_MAJOR}")
FIND_PACKAGE(Boost 1.58 QUIET COMPONENTS python${PYTHON_VERSION_MAJOR})
message("Looking for libboost_python${Python3_VERSION_MAJOR}")
FIND_PACKAGE(Boost 1.58 QUIET COMPONENTS python${Python3_VERSION_MAJOR})
endif()

# libboost_python style libraries
Expand All @@ -72,14 +73,14 @@ if ( NOT NO_PYTHON )

# libboost_python-py37 style libraries
if (NOT Boost_FOUND)
message("Looking for libboost_python-py${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
FIND_PACKAGE(Boost 1.58 QUIET COMPONENTS python-py${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
message("Looking for libboost_python-py${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
FIND_PACKAGE(Boost 1.58 QUIET COMPONENTS python-py${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
endif()

# libboost_python3-py37 style libraries
if (NOT Boost_FOUND)
message("Looking for libboost_python3-py${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
FIND_PACKAGE(Boost 1.58 QUIET COMPONENTS python3-py${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
message("Looking for libboost_python3-py${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
FIND_PACKAGE(Boost 1.58 QUIET COMPONENTS python3-py${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
endif()

# Nothing worked
Expand Down Expand Up @@ -145,8 +146,8 @@ endif()
# These variables are now defined
# ${Boost_INCLUDE_DIRS}
# ${Boost_LIBRARIES}
# ${PYTHON_INCLUDE_DIRS}
# ${PYTHON_LIBRARIES}
# ${Python3_INCLUDE_DIRS}
# ${Python3_LIBRARIES}
# ${ZeroMQ_INCLUDE_DIR}
# ${ZeroMQ_LIBRARY}
# ${BZIP2_INCLUDE_DIR}
Expand All @@ -163,7 +164,7 @@ set(ROGUE_LIBRARIES_ONLY @CONF_LIBRARIES@)
# Rogue Include paths
set(ROGUE_INCLUDE_DIRS @CONF_INCLUDE_DIRS@
${Boost_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS}
${Python3_INCLUDE_DIRS}
${Python3_NumPy_INCLUDE_DIRS}
${ZeroMQ_INCLUDE_DIR}
${BZIP2_INCLUDE_DIR}
Expand All @@ -172,7 +173,7 @@ set(ROGUE_INCLUDE_DIRS @CONF_INCLUDE_DIRS@
# Rogue libraries
set(ROGUE_LIBRARIES @CONF_LIBRARIES@
${Boost_LIBRARIES}
${PYTHON_LIBRARIES}
${Python3_LIBRARIES}
${ZeroMQ_LIBRARY}
${BZIP2_LIBRARIES}
${EPICS_LIBRARIES})
Expand Down Expand Up @@ -200,7 +201,7 @@ else()
message("-- Found boost: ${Boost_INCLUDE_DIRS}")
message("-- Found boost: ${Boost_LIBRARIES}")
message("")
message("-- Found python: ${PYTHON_LIBRARIES}")
message("-- Found python: ${Python3_LIBRARIES}")
message("-- Found numpy: ${Python3_NumPy_INCLUDE_DIRS}")
endif()

Expand Down
2 changes: 0 additions & 2 deletions tests/test_block_overlap.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def __init__(self, **kwargs):
name = "DataBlock",
description = "Large Data Block",
offset = 0,
bitSize = 32 * numRegs,
bitOffset = 0,
numValues = numRegs,
valueBits = 32,
Expand Down Expand Up @@ -70,7 +69,6 @@ def __init__(self, **kwargs):
name = "ListVar",
description = "List Variable",
offset = (numRegs//2)*4,
bitSize = 32 * numRegs//2,
bitOffset = 0,
numValues = numRegs//2,
valueBits = 32,
Expand Down
Loading

0 comments on commit f8f7a09

Please sign in to comment.