From 098160bfae7ffa838a3f16a7d555b01a9bfb527b Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Fri, 3 Feb 2023 15:13:09 +0100 Subject: [PATCH 01/48] simpler boost detection on mac --- sparta/cmake/sparta-config.cmake | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sparta/cmake/sparta-config.cmake b/sparta/cmake/sparta-config.cmake index c5d1ba3e00..53db6d7ca8 100644 --- a/sparta/cmake/sparta-config.cmake +++ b/sparta/cmake/sparta-config.cmake @@ -47,13 +47,11 @@ endif () if (APPLE AND NOT USING_CONDA) - set (Boost_NO_BOOST_CMAKE ON) set (CMAKE_CXX_COMPILER_VERSION 10.0) - find_package (Boost 1.65.0 REQUIRED HINTS /usr/local/Cellar/boost/* COMPONENTS ${_BOOST_COMPONENTS}) -else () - find_package (Boost 1.65.0 REQUIRED COMPONENTS ${_BOOST_COMPONENTS}) endif () +find_package (Boost 1.65.0 REQUIRED COMPONENTS ${_BOOST_COMPONENTS}) + set (BUILD_SHARED_LIBS ${existing_build_shared}) message (STATUS "Using BOOST ${Boost_VERSION_STRING}") From b2b5a2e1600ca79745acc8874a15519d1535f249 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Mon, 6 Feb 2023 10:00:22 +0100 Subject: [PATCH 02/48] cmake clean up: target specific include paths --- sparta/CMakeLists.txt | 31 +++++++++++++------------------ sparta/simdb/CMakeLists.txt | 10 ++++++++++ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/sparta/CMakeLists.txt b/sparta/CMakeLists.txt index 932857f956..f40c074f0e 100644 --- a/sparta/CMakeLists.txt +++ b/sparta/CMakeLists.txt @@ -10,23 +10,6 @@ set (GEN_DEBUG_INFO ON CACHE BOOL "Genearate debug info in compile & link -g") set (SPARTA_BASE ${CMAKE_CURRENT_SOURCE_DIR}) include (${SPARTA_BASE}/cmake/sparta-config.cmake) -# Add RapidJSON -include_directories (SYSTEM ${RAPIDJSON_INCLUDE_DIRS}) - -# Add YAML CPP -include_directories (SYSTEM ${YAML_CPP_INCLUDE_DIR}) - -# Add local includes -include_directories ("./") -include_directories ("simdb/include") - -# Add Boost (not typical system install) -include_directories (SYSTEM ${Boost_INCLUDE_DIRS}) - -# Add HDF5 (not typical system install) -include_directories (SYSTEM ${HDF5_C_INCLUDE_DIRS}) -include_directories (SYSTEM ${HDF5_INCLUDE_DIRS}) - # Add the source for libsparta.a list (APPEND SourceCppFiles src/ArgosOutputter.cpp @@ -105,6 +88,19 @@ if (COMPILE_WITH_PYTHON) python/sparta_support/Completer.cpp) endif () +add_library (sparta ${SourceCppFiles}) + +# Add Inlude path for libs +target_include_directories (sparta SYSTEM PUBLIC ${Boost_INCLUDE_DIRS} + PUBLIC ${RAPIDJSON_INCLUDE_DIRS} + PUBLIC ${YAML_CPP_INCLUDE_DIR} + PUBLIC ${HDF5_C_INCLUDE_DIRS} + PUBLIC ${HDF5_INCLUDE_DIRS}) + +# Add local includes +target_include_directories (sparta PRIVATE "./") +target_include_directories (sparta INTERFACE "simdb/include") + execute_process (COMMAND bash "-c" "git describe --tags --always" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE GIT_REPO_VERSION RESULT_VARIABLE rc @@ -215,7 +211,6 @@ set (CPPCHECK_EXCLUDES ) find_package (Cppcheck) -add_library (sparta ${SourceCppFiles}) set (SPARTA_STATIC_LIBS ${PROJECT_BINARY_DIR}/libsparta.a) # Build the SimDB library diff --git a/sparta/simdb/CMakeLists.txt b/sparta/simdb/CMakeLists.txt index 84fe33e2b3..c07635c6eb 100644 --- a/sparta/simdb/CMakeLists.txt +++ b/sparta/simdb/CMakeLists.txt @@ -14,6 +14,16 @@ list(APPEND SimDB_CPP src/simdb.cpp) add_library(simdb ${SimDB_CPP}) + + +# Add Inlude path for libs +target_include_directories (simdb SYSTEM PUBLIC ${Boost_INCLUDE_DIRS} + PUBLIC ${RAPIDJSON_INCLUDE_DIRS} + PUBLIC ${YAML_CPP_INCLUDE_DIR} + PUBLIC ${HDF5_C_INCLUDE_DIRS} + PUBLIC ${HDF5_INCLUDE_DIRS}) + + add_subdirectory(test EXCLUDE_FROM_ALL) install(TARGETS simdb From e141720a0ccb7d4c864dab74c8a299c994db0717 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Mon, 6 Feb 2023 10:35:36 +0100 Subject: [PATCH 03/48] boost 1.76 --- sparta/cmake/sparta-config.cmake | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sparta/cmake/sparta-config.cmake b/sparta/cmake/sparta-config.cmake index 53db6d7ca8..0d8ea0f211 100644 --- a/sparta/cmake/sparta-config.cmake +++ b/sparta/cmake/sparta-config.cmake @@ -45,12 +45,7 @@ else () set (USING_CONDA OFF) endif () - -if (APPLE AND NOT USING_CONDA) - set (CMAKE_CXX_COMPILER_VERSION 10.0) -endif () - -find_package (Boost 1.65.0 REQUIRED COMPONENTS ${_BOOST_COMPONENTS}) +find_package (Boost 1.76.0 REQUIRED COMPONENTS ${_BOOST_COMPONENTS}) set (BUILD_SHARED_LIBS ${existing_build_shared}) message (STATUS "Using BOOST ${Boost_VERSION_STRING}") From adce649fb8a9c42e82ea408423d40c491102d929 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Mon, 6 Feb 2023 10:36:23 +0100 Subject: [PATCH 04/48] boost 1.72 specific magic no longer needed --- sparta/cmake/sparta-config.cmake | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sparta/cmake/sparta-config.cmake b/sparta/cmake/sparta-config.cmake index 0d8ea0f211..5393d2f05d 100644 --- a/sparta/cmake/sparta-config.cmake +++ b/sparta/cmake/sparta-config.cmake @@ -27,11 +27,6 @@ endif() set (Boost_USE_STATIC_LIBS OFF) -# BOOST_CMAKE logic for in versions before 1.72 to ask for the shared libraries is broken, you can only force it to use -# them if you're building shared libs? wtf? -set (existing_build_shared ${BUILD_SHARED_LIBS}) -set (BUILD_SHARED_LIBS ON) - execute_process (COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE CXX_VERSION_STRING RESULT_VARIABLE rc) if (NOT rc EQUAL "0") message (FATAL_ERROR "could not run compiler command '${CMAKE_CXX_COMPILER} --version', rc=${rc}") @@ -47,7 +42,6 @@ endif () find_package (Boost 1.76.0 REQUIRED COMPONENTS ${_BOOST_COMPONENTS}) -set (BUILD_SHARED_LIBS ${existing_build_shared}) message (STATUS "Using BOOST ${Boost_VERSION_STRING}") # Find YAML CPP From 93a031f9205f1e13ec871f76f5d09a4e18eb2508 Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Mon, 6 Feb 2023 10:55:31 -0600 Subject: [PATCH 05/48] Merged Peter's master branch with some cmake fixes on my end --- helios/pipeViewer/transactiondb/CMakeLists.txt | 2 +- sparta/cmake/sparta-config.cmake | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/helios/pipeViewer/transactiondb/CMakeLists.txt b/helios/pipeViewer/transactiondb/CMakeLists.txt index 3c2c07cae1..5c28a354a9 100644 --- a/helios/pipeViewer/transactiondb/CMakeLists.txt +++ b/helios/pipeViewer/transactiondb/CMakeLists.txt @@ -16,7 +16,7 @@ set(TRANSACTIONDB_SRC_DIR ${PROJECT_SOURCE_DIR}/src) ################################################################## # FIXME use consistent cmake recipe for python extensions here and in .. add_custom_command(OUTPUT transactiondb.sh - COMMAND printf 'SYSINCDIRS="$ENV{SYSINCDIRS}" + COMMAND printf 'SYSINCDIRS="${YAML_CPP_INCLUDE_DIR}" PY_SRC_DIR="${CMAKE_CURRENT_SOURCE_DIR}/src" SPARTA_BASE="${SPARTA_BASE}" TARGETDIR="lib" diff --git a/sparta/cmake/sparta-config.cmake b/sparta/cmake/sparta-config.cmake index 5393d2f05d..a6183a88d2 100644 --- a/sparta/cmake/sparta-config.cmake +++ b/sparta/cmake/sparta-config.cmake @@ -25,8 +25,6 @@ if (Sparta_VERBOSE) set (CMAKE_FIND_DEBUG_MODE ON) # verbosity for find_package endif() -set (Boost_USE_STATIC_LIBS OFF) - execute_process (COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE CXX_VERSION_STRING RESULT_VARIABLE rc) if (NOT rc EQUAL "0") message (FATAL_ERROR "could not run compiler command '${CMAKE_CXX_COMPILER} --version', rc=${rc}") @@ -40,31 +38,37 @@ else () set (USING_CONDA OFF) endif () +# Find Boost +set (Boost_USE_STATIC_LIBS OFF) find_package (Boost 1.76.0 REQUIRED COMPONENTS ${_BOOST_COMPONENTS}) - message (STATUS "Using BOOST ${Boost_VERSION_STRING}") +include_directories (SYSTEM ${Boost_INCLUDE_DIRS}) # Find YAML CPP find_package (yaml-cpp 0.6 REQUIRED) message (STATUS "Using YAML CPP ${yaml-cpp_VERSION}") get_property(YAML_CPP_INCLUDE_DIR TARGET yaml-cpp PROPERTY INTERFACE_INCLUDE_DIRECTORIES) +include_directories (SYSTEM ${YAML_CPP_INCLUDE_DIR}) # Find RapidJSON find_package (RapidJSON 1.1 REQUIRED) +include_directories (SYSTEM ${RapidJSON_INCLUDE_DIRS}) message (STATUS "Using RapidJSON CPP ${RapidJSON_VERSION}") # Find SQLite3 find_package (SQLite3 3.19 REQUIRED) +include_directories (SYSTEM ${SQLite3_INCLUDE_DIRS}) message (STATUS "Using SQLite3 ${SQLite3_VERSION}") # Find zlib find_package(ZLIB REQUIRED) -message (STATUS "Using zlib ${ZLIB_VERSION_STRING}") include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS}) +message (STATUS "Using zlib ${ZLIB_VERSION_STRING}") # Find HDF5. Need to enable C language for HDF5 testing enable_language (C) find_package (HDF5 1.10 REQUIRED) +include_directories (SYSTEM ${HDF5_INCLUDE_DIRS}) # Populate the Sparta_LIBS variable with the required libraries for # basic Sparta linking From 120aafd4046c1588c7426df7652cb0de8335bf7e Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Mon, 6 Feb 2023 11:00:33 -0600 Subject: [PATCH 06/48] Moved reliance on include paths back to sparta.cmake file --- sparta/CMakeLists.txt | 8 -------- sparta/simdb/CMakeLists.txt | 27 +++++++++------------------ 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/sparta/CMakeLists.txt b/sparta/CMakeLists.txt index e3d9b30284..835266b978 100644 --- a/sparta/CMakeLists.txt +++ b/sparta/CMakeLists.txt @@ -90,13 +90,6 @@ endif () add_library (sparta ${SourceCppFiles}) -# Add Inlude path for libs -target_include_directories (sparta SYSTEM PUBLIC ${Boost_INCLUDE_DIRS} - PUBLIC ${RAPIDJSON_INCLUDE_DIRS} - PUBLIC ${YAML_CPP_INCLUDE_DIR} - PUBLIC ${HDF5_C_INCLUDE_DIRS} - PUBLIC ${HDF5_INCLUDE_DIRS}) - # Add local includes target_include_directories (sparta PRIVATE "./") target_include_directories (sparta INTERFACE "simdb/include") @@ -228,7 +221,6 @@ add_subdirectory (simdb) add_subdirectory (test EXCLUDE_FROM_ALL) add_subdirectory (example EXCLUDE_FROM_ALL) - # # Installation # diff --git a/sparta/simdb/CMakeLists.txt b/sparta/simdb/CMakeLists.txt index c07635c6eb..83b70091e9 100644 --- a/sparta/simdb/CMakeLists.txt +++ b/sparta/simdb/CMakeLists.txt @@ -6,28 +6,19 @@ include_directories(${SIMDB_BASE}/include) include(${SIMDB_BASE}/cmake/simdb-config.cmake) list(APPEND SimDB_CPP - src/HDF5Connection.cpp - src/ObjectManager.cpp - src/ObjectRef.cpp - src/SQLiteConnection.cpp - src/TableRef.cpp - src/simdb.cpp) + src/HDF5Connection.cpp + src/ObjectManager.cpp + src/ObjectRef.cpp + src/SQLiteConnection.cpp + src/TableRef.cpp + src/simdb.cpp) add_library(simdb ${SimDB_CPP}) - -# Add Inlude path for libs -target_include_directories (simdb SYSTEM PUBLIC ${Boost_INCLUDE_DIRS} - PUBLIC ${RAPIDJSON_INCLUDE_DIRS} - PUBLIC ${YAML_CPP_INCLUDE_DIR} - PUBLIC ${HDF5_C_INCLUDE_DIRS} - PUBLIC ${HDF5_INCLUDE_DIRS}) - - add_subdirectory(test EXCLUDE_FROM_ALL) install(TARGETS simdb - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - ) + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) install(DIRECTORY include/ DESTINATION include) From 39c889e510fd3e1803cb671bbe23696e0faefd75 Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Mon, 6 Feb 2023 11:26:57 -0600 Subject: [PATCH 07/48] Made simdb include a private include --- sparta/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sparta/CMakeLists.txt b/sparta/CMakeLists.txt index 835266b978..48a4c1ad47 100644 --- a/sparta/CMakeLists.txt +++ b/sparta/CMakeLists.txt @@ -92,7 +92,7 @@ add_library (sparta ${SourceCppFiles}) # Add local includes target_include_directories (sparta PRIVATE "./") -target_include_directories (sparta INTERFACE "simdb/include") +target_include_directories (sparta PRIVATE "simdb/include") execute_process (COMMAND bash "-c" "git describe --tags --always" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} From 1f7ed09c41b6ac8079bb86013faeec2dd0dd9225 Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Mon, 6 Feb 2023 14:16:26 -0600 Subject: [PATCH 08/48] PUBLIC includes for Sparta and SimDB to pass to regression --- sparta/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sparta/CMakeLists.txt b/sparta/CMakeLists.txt index 48a4c1ad47..7ebd2ebdf8 100644 --- a/sparta/CMakeLists.txt +++ b/sparta/CMakeLists.txt @@ -91,8 +91,8 @@ endif () add_library (sparta ${SourceCppFiles}) # Add local includes -target_include_directories (sparta PRIVATE "./") -target_include_directories (sparta PRIVATE "simdb/include") +target_include_directories (sparta PUBLIC "./") +target_include_directories (sparta PUBLIC "simdb/include") execute_process (COMMAND bash "-c" "git describe --tags --always" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} From cc8f62fed4730289818541990d18d45448408a94 Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Mon, 6 Feb 2023 14:46:14 -0600 Subject: [PATCH 09/48] Small cleanup; added missing SimDB testers target include --- sparta/cmake/sparta-config.cmake | 5 +++-- sparta/simdb/test/TestingMacros.cmake | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sparta/cmake/sparta-config.cmake b/sparta/cmake/sparta-config.cmake index a6183a88d2..be9a8f7212 100644 --- a/sparta/cmake/sparta-config.cmake +++ b/sparta/cmake/sparta-config.cmake @@ -41,14 +41,14 @@ endif () # Find Boost set (Boost_USE_STATIC_LIBS OFF) find_package (Boost 1.76.0 REQUIRED COMPONENTS ${_BOOST_COMPONENTS}) -message (STATUS "Using BOOST ${Boost_VERSION_STRING}") include_directories (SYSTEM ${Boost_INCLUDE_DIRS}) +message (STATUS "Using BOOST ${Boost_VERSION_STRING}") # Find YAML CPP find_package (yaml-cpp 0.6 REQUIRED) -message (STATUS "Using YAML CPP ${yaml-cpp_VERSION}") get_property(YAML_CPP_INCLUDE_DIR TARGET yaml-cpp PROPERTY INTERFACE_INCLUDE_DIRECTORIES) include_directories (SYSTEM ${YAML_CPP_INCLUDE_DIR}) +message (STATUS "Using YAML CPP ${yaml-cpp_VERSION}") # Find RapidJSON find_package (RapidJSON 1.1 REQUIRED) @@ -69,6 +69,7 @@ message (STATUS "Using zlib ${ZLIB_VERSION_STRING}") enable_language (C) find_package (HDF5 1.10 REQUIRED) include_directories (SYSTEM ${HDF5_INCLUDE_DIRS}) +message (STATUS "Using HDF5 ${HDF5_VERSION}") # Populate the Sparta_LIBS variable with the required libraries for # basic Sparta linking diff --git a/sparta/simdb/test/TestingMacros.cmake b/sparta/simdb/test/TestingMacros.cmake index 0259a2bc83..c23a6a7475 100644 --- a/sparta/simdb/test/TestingMacros.cmake +++ b/sparta/simdb/test/TestingMacros.cmake @@ -25,7 +25,8 @@ function(simdb_fully_named_test name target run_valgrind) set_tests_properties(valgrind_${name} PROPERTIES LABELS ${VALGRIND_TEST_LABEL}) endif() endif() - target_link_libraries(${target} ${SimDB_LIBS}) + target_link_libraries (${target} ${SimDB_LIBS}) + target_include_directories (${target} PUBLIC "${SPARTA_BASE}") endfunction (simdb_fully_named_test) # Tell simdb to run the following target with the following name. From 667ec0c6003d0aec86fc2a4b63781bb93c048566 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Thu, 9 Feb 2023 08:47:37 +0100 Subject: [PATCH 10/48] cmake file to enable find_package(Sparta) in other projects --- sparta/CMakeLists.txt | 2 + sparta/cmake/FindSparta.cmake | 79 +++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 sparta/cmake/FindSparta.cmake diff --git a/sparta/CMakeLists.txt b/sparta/CMakeLists.txt index 7ebd2ebdf8..f3bf85f013 100644 --- a/sparta/CMakeLists.txt +++ b/sparta/CMakeLists.txt @@ -226,3 +226,5 @@ add_subdirectory (example EXCLUDE_FROM_ALL) # install(DIRECTORY sparta/ DESTINATION include/sparta) install(FILES ${SPARTA_STATIC_LIBS} DESTINATION lib) +install(DIRECTORY cmake/ DESTINATION lib/cmake/sparta) +install(FILES test/TestingMacros.cmake DESTINATION lib/cmake/sparta) diff --git a/sparta/cmake/FindSparta.cmake b/sparta/cmake/FindSparta.cmake new file mode 100644 index 0000000000..35a7269ddb --- /dev/null +++ b/sparta/cmake/FindSparta.cmake @@ -0,0 +1,79 @@ +include(FindPackageHandleStandardArgs) + +if(NOT SPARTA_FOUND) + find_package(Boost REQUIRED COMPONENTS timer filesystem serialization program_options) + find_package(HDF5 REQUIRED) + find_package(SQLite3 REQUIRED) + find_package(ZLIB REQUIRED) + find_package(yaml-cpp REQUIRED) + find_package(RapidJSON REQUIRED) + find_package(Threads REQUIRED) + + #set(CMAKE_FIND_DEBUG_MODE TRUE) + + find_path(SPARTA_INCLUDE_DIRS sparta/sparta.hpp + HINTS ${SPARTA_INCLUDE_DIR} ${SPARTA_SEARCH_DIR} + HINTS ENV CPATH + HINTS ENV SPARTA_INSTALL_HOME + PATH_SUFFIXES include) + + find_path(SIMDB_INCLUDE_DIRS simdb/ObjectManager.hpp + HINTS ${SPARTA_INCLUDE_DIR} ${SPARTA_SEARCH_DIR} + HINTS ENV CPATH + HINTS ENV SPARTA_INSTALL_HOME + PATH_SUFFIXES include) + list(APPEND SPARTA_INCLUDE_DIRS ${SIMDB_INCLUDE_DIRS}) + + set(SPARTA_SEARCH_COMPOMPONENTS simdb sparta) + foreach(_comp ${SPARTA_SEARCH_COMPOMPONENTS}) + # Search for the libraries + find_library(SPARTA_${_comp}_LIBRARY ${_comp} + HINTS ${SPARTA_LIBRARY} ${SPARTA_SEARCH_DIR} + HINTS ENV LIBRARY_PATH + HINTS ENV SPARTA_INSTALL_HOME + PATH_SUFFIXES lib) + + if(SPARTA_${_comp}_LIBRARY) + list(APPEND SPARTA_LIBRARIES "${SPARTA_${_comp}_LIBRARY}") + endif() + + if(SPARTA_${_comp}_LIBRARY AND EXISTS "${SPARTA_${_comp}_LIBRARY}") + set(SPARTA_${_comp}_FOUND TRUE) + else() + set(SPARTA_${_comp}_FOUND FALSE) + endif() + + # Mark internal variables as advanced + mark_as_advanced(SPARTA_${_comp}_LIBRARY) + endforeach() + + find_package_handle_standard_args(Sparta + REQUIRED_VARS SPARTA_INCLUDE_DIRS SPARTA_LIBRARIES + HANDLE_COMPONENTS + VERSION_VAR SPARTA_VERSION) + + ################################## + # Create targets + ################################## + + if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND SPARTA_FOUND) + add_library(SPARTA::libsparta STATIC IMPORTED) + set_property(TARGET SPARTA::libsparta PROPERTY IMPORTED_LOCATION "${SPARTA_sparta_LIBRARY}") + add_library(SPARTA::libsimdb STATIC IMPORTED) + set_property(TARGET SPARTA::libsimdb PROPERTY IMPORTED_LOCATION "${SPARTA_simdb_LIBRARY}") + + add_library(SPARTA::sparta INTERFACE IMPORTED) + set_property(TARGET SPARTA::sparta + PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${SPARTA_INCLUDE_DIRS} ${RAPIDJSON_INCLUDE_DIR} ${RapidJSON_INCLUDE_DIR}) + set_property(TARGET SPARTA::sparta + PROPERTY INTERFACE_LINK_LIBRARIES SPARTA::libsparta SPARTA::libsimdb hdf5::hdf5 SQLite::SQLite3 + Boost::filesystem Boost::serialization Boost::timer Boost::program_options + ZLIB::ZLIB yaml-cpp Threads::Threads) + set_property(TARGET SPARTA::sparta + PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_17) + endif() + + mark_as_advanced(SPARTA_INCLUDE_DIRS SPARTA_LIBRARIES) + + #set(CMAKE_FIND_DEBUG_MODE FALSE) +endif() From 4c3ab3fd198fb60f5c5763064186b8e2c1fedb26 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Thu, 9 Feb 2023 11:32:04 +0100 Subject: [PATCH 11/48] make sure we include the testing macros --- sparta/cmake/FindSparta.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/sparta/cmake/FindSparta.cmake b/sparta/cmake/FindSparta.cmake index 35a7269ddb..191dece27f 100644 --- a/sparta/cmake/FindSparta.cmake +++ b/sparta/cmake/FindSparta.cmake @@ -73,6 +73,7 @@ if(NOT SPARTA_FOUND) PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_17) endif() + include(${CMAKE_CURRENT_LIST_DIR}/TestingMacros.cmake) mark_as_advanced(SPARTA_INCLUDE_DIRS SPARTA_LIBRARIES) #set(CMAKE_FIND_DEBUG_MODE FALSE) From 736df39d6ce398b29e6bada2885e580a692f04f8 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Thu, 9 Feb 2023 11:32:34 +0100 Subject: [PATCH 12/48] also installing sparta/cache --- sparta/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/sparta/CMakeLists.txt b/sparta/CMakeLists.txt index f3bf85f013..d157d7ebe6 100644 --- a/sparta/CMakeLists.txt +++ b/sparta/CMakeLists.txt @@ -225,6 +225,7 @@ add_subdirectory (example EXCLUDE_FROM_ALL) # Installation # install(DIRECTORY sparta/ DESTINATION include/sparta) +install(DIRECTORY cache/ DESTINATION include/cache) install(FILES ${SPARTA_STATIC_LIBS} DESTINATION lib) install(DIRECTORY cmake/ DESTINATION lib/cmake/sparta) install(FILES test/TestingMacros.cmake DESTINATION lib/cmake/sparta) From 3af0543217eb99d6e105905974327a860e5c4f32 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Thu, 9 Feb 2023 13:21:09 +0100 Subject: [PATCH 13/48] make sure core setup.py actually uses the interpreter found by find_package(PythonInterp) --- helios/pipeViewer/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/helios/pipeViewer/CMakeLists.txt b/helios/pipeViewer/CMakeLists.txt index 9e7637323d..24a9de106f 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -7,8 +7,9 @@ find_package(PythonLibs 3.7 REQUIRED) set (CMAKE_CXX_STANDARD 17) set (CMAKE_CXX_STANDARD_REQUIRED ON) -if(NOT ${PYTHON}) - find_program(PYTHON 'python3') +if(NOT ${PYTHONINTERP_FOUND}) + message(WARNING "Cmake could not find PythonInterp, trying to fall back on system default python3") + find_program(PYTHON_EXECUTABLE 'python3') endif() set(SETUP_PY "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/setup.py") @@ -16,7 +17,7 @@ set(SETUP_PY "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/setup.py") set(PY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/core.so.built") add_custom_command(OUTPUT "${PY_OUTPUT}" - COMMAND ${CMAKE_COMMAND} -E env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} LD=${CMAKE_LINKER} TARGETDIR=${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core ${PYTHON} ${SETUP_PY} build_ext --inplace + COMMAND ${CMAKE_COMMAND} -E env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} LD=${CMAKE_LINKER} TARGETDIR=${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core -- ${PYTHON_EXECUTABLE} ${SETUP_PY} build_ext --inplace COMMAND ${CMAKE_COMMAND} -E touch ${PY_OUTPUT} DEPENDS ${SETUP_PY} "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/src/core.pyx" ) From eac0f29c15da0a7a1602acf09d2db86b7ebaa3f7 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Thu, 9 Feb 2023 14:53:05 +0100 Subject: [PATCH 14/48] more modern way to find python3, hopefully also robust in conda/venv --- helios/pipeViewer/CMakeLists.txt | 12 +++++++----- helios/pipeViewer/transactiondb/CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/helios/pipeViewer/CMakeLists.txt b/helios/pipeViewer/CMakeLists.txt index 24a9de106f..fcf2bfd93c 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -1,15 +1,17 @@ cmake_minimum_required(VERSION 3.15) project (PipeViewer) -find_package(PythonInterp 3.7 REQUIRED) -find_package(PythonLibs 3.7 REQUIRED) +# If we are in virtualenv or conda, that takes prio over any system python there might be +set(Python3_FIND_VIRTUALENV FIRST) + +find_package (Python3 3.7 REQUIRED COMPONENTS Interpreter Development) set (CMAKE_CXX_STANDARD 17) set (CMAKE_CXX_STANDARD_REQUIRED ON) -if(NOT ${PYTHONINTERP_FOUND}) +if(NOT ${Python3_FOUND}) message(WARNING "Cmake could not find PythonInterp, trying to fall back on system default python3") - find_program(PYTHON_EXECUTABLE 'python3') + find_program(Python3_EXECUTABLE 'python3') endif() set(SETUP_PY "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/setup.py") @@ -17,7 +19,7 @@ set(SETUP_PY "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/setup.py") set(PY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/core.so.built") add_custom_command(OUTPUT "${PY_OUTPUT}" - COMMAND ${CMAKE_COMMAND} -E env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} LD=${CMAKE_LINKER} TARGETDIR=${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core -- ${PYTHON_EXECUTABLE} ${SETUP_PY} build_ext --inplace + COMMAND ${CMAKE_COMMAND} -E env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} LD=${CMAKE_LINKER} TARGETDIR=${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core -- ${Python3_EXECUTABLE} ${SETUP_PY} build_ext --inplace COMMAND ${CMAKE_COMMAND} -E touch ${PY_OUTPUT} DEPENDS ${SETUP_PY} "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/src/core.pyx" ) diff --git a/helios/pipeViewer/transactiondb/CMakeLists.txt b/helios/pipeViewer/transactiondb/CMakeLists.txt index 5c28a354a9..8c950f4954 100644 --- a/helios/pipeViewer/transactiondb/CMakeLists.txt +++ b/helios/pipeViewer/transactiondb/CMakeLists.txt @@ -28,7 +28,7 @@ add_custom_command(OUTPUT transactiondb.sh CC="${CMAKE_C_COMPILER}" CXX="${CMAKE_CXX_COMPILER}" LD="${CMAKE_LINKER}" - python3 ${CMAKE_CURRENT_SOURCE_DIR}/setup.py build_ext --inplace;' > transactiondb.sh && chmod +x transactiondb.sh + ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py build_ext --inplace;' > transactiondb.sh && chmod +x transactiondb.sh DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/setup.py) add_custom_target (transactiondb_sh_driver ALL DEPENDS transactiondb.sh) From 41827fe53be7efd3748659daf33f291370f11637 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Fri, 10 Feb 2023 13:19:08 +0100 Subject: [PATCH 15/48] cleaner cmake for testing macros for simdb and sparta --- sparta/CMakeLists.txt | 1 - sparta/cmake/FindSparta.cmake | 3 ++- .../TestingMacros.cmake => cmake/SimdbTestingMacros.cmake} | 0 .../TestingMacros.cmake => cmake/SpartaTestingMacros.cmake} | 0 sparta/example/CoreModel/CMakeLists.txt | 1 - sparta/example/DynamicModelPipeline/CMakeLists.txt | 1 - sparta/example/SkeletonPipeline/CMakeLists.txt | 1 - sparta/example/SystemC/1_phase/CMakeLists.txt | 1 - sparta/example/SystemC/2_phase/CMakeLists.txt | 1 - sparta/simdb/test/CoreDatabase/CMakeLists.txt | 3 +-- sparta/simdb/test/HDF5Database/CMakeLists.txt | 2 +- sparta/simdb/test/SQLiteDatabase/CMakeLists.txt | 2 +- sparta/simdb/test/SharedDB/CMakeLists.txt | 2 +- sparta/simdb/test/Thread/CMakeLists.txt | 2 +- sparta/simdb/test/Thread/StandaloneCpp1/CMakeLists.txt | 2 +- sparta/simdb/test/Utils/CMakeLists.txt | 2 +- sparta/test/Array/CMakeLists.txt | 2 +- sparta/test/Audience/CMakeLists.txt | 2 +- sparta/test/BasicHistogram/CMakeLists.txt | 2 +- sparta/test/BitArray/CMakeLists.txt | 2 +- sparta/test/BoundedValue/CMakeLists.txt | 2 +- sparta/test/Buffer/CMakeLists.txt | 2 +- sparta/test/Bus/CMakeLists.txt | 2 +- sparta/test/CMakeLists.txt | 3 +++ sparta/test/CircularBuffer/CMakeLists.txt | 2 +- sparta/test/Clock/CMakeLists.txt | 4 ++-- sparta/test/Collection/CMakeLists.txt | 4 ++-- sparta/test/Color/CMakeLists.txt | 4 ++-- sparta/test/CommandLineSimulator/Args/CMakeLists.txt | 2 -- sparta/test/CommandLineSimulator/CMakeLists.txt | 4 ++-- sparta/test/ContextCounter/CMakeLists.txt | 4 ++-- sparta/test/Counter/CMakeLists.txt | 4 ++-- sparta/test/CycleHistogram/CMakeLists.txt | 3 ++- sparta/test/DAG/CMakeLists.txt | 4 ++-- sparta/test/DAG_Ordering/CMakeLists.txt | 2 -- sparta/test/DataView/CMakeLists.txt | 2 -- sparta/test/Enum/CMakeLists.txt | 2 -- sparta/test/EnumCycleHistogram/CMakeLists.txt | 2 -- sparta/test/Events/CMakeLists.txt | 2 -- sparta/test/ExportedPort/CMakeLists.txt | 2 -- sparta/test/FastCheckpoint/CMakeLists.txt | 2 -- sparta/test/FastCheckpoint/FILEStream/CMakeLists.txt | 2 -- .../FastCheckpoint/PersistentFastCheckpoint/CMakeLists.txt | 2 -- sparta/test/FastList/CMakeLists.txt | 2 -- sparta/test/HierarchicalBuilding/CMakeLists.txt | 2 -- sparta/test/Histogram/CMakeLists.txt | 2 -- sparta/test/KeyPairCollect/CMakeLists.txt | 2 -- sparta/test/KeyValue/CMakeLists.txt | 2 -- sparta/test/LockedValue/CMakeLists.txt | 2 -- sparta/test/Log/CMakeLists.txt | 2 -- sparta/test/LogAll/CMakeLists.txt | 2 -- sparta/test/Memory/CMakeLists.txt | 2 -- sparta/test/MemoryMap/CMakeLists.txt | 2 -- sparta/test/MetaTypeList/CMakeLists.txt | 2 -- sparta/test/MethodDelegate/CMakeLists.txt | 2 -- sparta/test/MirrorNotification/CMakeLists.txt | 2 -- sparta/test/Monitor/CMakeLists.txt | 2 -- sparta/test/NestedPEvents/CMakeLists.txt | 2 -- sparta/test/Notification/CMakeLists.txt | 2 -- sparta/test/PEvents/CMakeLists.txt | 2 -- sparta/test/PairCollector/CMakeLists.txt | 1 - sparta/test/Parameter/CMakeLists.txt | 2 -- sparta/test/Pipe/CMakeLists.txt | 2 -- sparta/test/Pipeline/CMakeLists.txt | 2 -- sparta/test/Port/CMakeLists.txt | 2 -- sparta/test/Preloading/CMakeLists.txt | 2 -- sparta/test/Queue/CMakeLists.txt | 2 -- sparta/test/Rational/CMakeLists.txt | 2 -- sparta/test/Register/CMakeLists.txt | 2 -- sparta/test/Report/CMakeLists.txt | 2 -- sparta/test/Report/Triggers/CMakeLists.txt | 2 -- sparta/test/ReportVerifier/CMakeLists.txt | 2 -- sparta/test/ResourceAssert/CMakeLists.txt | 2 -- sparta/test/Scheduler/CMakeLists.txt | 1 - sparta/test/Scheduler/CatchLoop/CMakeLists.txt | 2 -- sparta/test/Scheduler/NoLoopTest/CMakeLists.txt | 2 -- sparta/test/Scheduler/Timeout/CMakeLists.txt | 2 -- sparta/test/Scoreboard/CMakeLists.txt | 2 -- sparta/test/SharedData/CMakeLists.txt | 2 -- sparta/test/SimDB/CMakeLists.txt | 2 -- sparta/test/SmartLexCast/CMakeLists.txt | 2 -- sparta/test/SpartaException/CMakeLists.txt | 2 -- sparta/test/SpartaSharedPointer/CMakeLists.txt | 2 -- sparta/test/State/CMakeLists.txt | 2 -- sparta/test/StateResidencyTracker/CMakeLists.txt | 1 - sparta/test/StateTimer/CMakeLists.txt | 2 -- sparta/test/StaticInit/CMakeLists.txt | 2 -- sparta/test/Statistic/CMakeLists.txt | 2 -- sparta/test/StatisticExpression/CMakeLists.txt | 2 -- sparta/test/SubjectState/CMakeLists.txt | 2 -- sparta/test/SyncPort/CMakeLists.txt | 2 -- sparta/test/SystemC/CMakeLists.txt | 2 -- sparta/test/Tag/CMakeLists.txt | 2 -- .../test/TransactionDatabaseAPI/cpp_interface/CMakeLists.txt | 2 -- sparta/test/TreeFilter/CMakeLists.txt | 2 -- sparta/test/TreeNode/CMakeLists.txt | 2 -- sparta/test/TreeNodeDebug/CMakeLists.txt | 2 -- sparta/test/TreeNodePrivacy/CMakeLists.txt | 2 -- sparta/test/TreeNodeScope/CMakeLists.txt | 2 -- sparta/test/Trigger/CMakeLists.txt | 2 -- sparta/test/Utils/CMakeLists.txt | 2 -- sparta/test/ValidValue/CMakeLists.txt | 2 -- sparta/test/VirtualParameterTree/CMakeLists.txt | 1 - sparta/test/cache/simple_cache/CMakeLists.txt | 1 - 104 files changed, 36 insertions(+), 175 deletions(-) rename sparta/{simdb/test/TestingMacros.cmake => cmake/SimdbTestingMacros.cmake} (100%) rename sparta/{test/TestingMacros.cmake => cmake/SpartaTestingMacros.cmake} (100%) diff --git a/sparta/CMakeLists.txt b/sparta/CMakeLists.txt index d157d7ebe6..c9080c7e59 100644 --- a/sparta/CMakeLists.txt +++ b/sparta/CMakeLists.txt @@ -228,4 +228,3 @@ install(DIRECTORY sparta/ DESTINATION include/sparta) install(DIRECTORY cache/ DESTINATION include/cache) install(FILES ${SPARTA_STATIC_LIBS} DESTINATION lib) install(DIRECTORY cmake/ DESTINATION lib/cmake/sparta) -install(FILES test/TestingMacros.cmake DESTINATION lib/cmake/sparta) diff --git a/sparta/cmake/FindSparta.cmake b/sparta/cmake/FindSparta.cmake index 191dece27f..cf7bbc0c3f 100644 --- a/sparta/cmake/FindSparta.cmake +++ b/sparta/cmake/FindSparta.cmake @@ -73,7 +73,8 @@ if(NOT SPARTA_FOUND) PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_17) endif() - include(${CMAKE_CURRENT_LIST_DIR}/TestingMacros.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/SpartaTestingMacros.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/SimdbTestingMacros.cmake) mark_as_advanced(SPARTA_INCLUDE_DIRS SPARTA_LIBRARIES) #set(CMAKE_FIND_DEBUG_MODE FALSE) diff --git a/sparta/simdb/test/TestingMacros.cmake b/sparta/cmake/SimdbTestingMacros.cmake similarity index 100% rename from sparta/simdb/test/TestingMacros.cmake rename to sparta/cmake/SimdbTestingMacros.cmake diff --git a/sparta/test/TestingMacros.cmake b/sparta/cmake/SpartaTestingMacros.cmake similarity index 100% rename from sparta/test/TestingMacros.cmake rename to sparta/cmake/SpartaTestingMacros.cmake diff --git a/sparta/example/CoreModel/CMakeLists.txt b/sparta/example/CoreModel/CMakeLists.txt index 9446d772b0..c93921c0f1 100644 --- a/sparta/example/CoreModel/CMakeLists.txt +++ b/sparta/example/CoreModel/CMakeLists.txt @@ -49,7 +49,6 @@ add_custom_command(TARGET core_example_regress_valgrind POST_BUILD COMMAND ctest # # Testing # -include (../../test/TestingMacros.cmake) sparta_copy(sparta_core_example *.yaml) sparta_copy(sparta_core_example cpu_layout.alf) sparta_recursive_copy(sparta_core_example subdir_yamls*) diff --git a/sparta/example/DynamicModelPipeline/CMakeLists.txt b/sparta/example/DynamicModelPipeline/CMakeLists.txt index 9ede11a716..12d7f891e1 100644 --- a/sparta/example/DynamicModelPipeline/CMakeLists.txt +++ b/sparta/example/DynamicModelPipeline/CMakeLists.txt @@ -26,7 +26,6 @@ sparta_application(dynamic_model_pipeline) # # Testing # -include (../../test/TestingMacros.cmake) sparta_copy(dynamic_model_pipeline *.yaml) sparta_copy(dynamic_model_pipeline cpu_layout.alf) sparta_recursive_copy(dynamic_model_pipeline subdir_yamls*) diff --git a/sparta/example/SkeletonPipeline/CMakeLists.txt b/sparta/example/SkeletonPipeline/CMakeLists.txt index 030283ce78..11efd87e30 100644 --- a/sparta/example/SkeletonPipeline/CMakeLists.txt +++ b/sparta/example/SkeletonPipeline/CMakeLists.txt @@ -13,7 +13,6 @@ sparta_application(sparta_skeleton) # # Testing # -include (../../test/TestingMacros.cmake) sparta_copy(sparta_skeleton "test_final_cfg.sh") sparta_copy(sparta_skeleton "test_arch_with_override.sh") diff --git a/sparta/example/SystemC/1_phase/CMakeLists.txt b/sparta/example/SystemC/1_phase/CMakeLists.txt index 5aecf66c59..e97ab045a7 100644 --- a/sparta/example/SystemC/1_phase/CMakeLists.txt +++ b/sparta/example/SystemC/1_phase/CMakeLists.txt @@ -45,7 +45,6 @@ if(SYSTEMC_SUPPORT) ) - include (../../../test/TestingMacros.cmake) sparta_named_test(sparta_sys_phase1_tlm sparta_sysc_model_1_phase) endif() diff --git a/sparta/example/SystemC/2_phase/CMakeLists.txt b/sparta/example/SystemC/2_phase/CMakeLists.txt index 4a8364d3db..58904f8e11 100644 --- a/sparta/example/SystemC/2_phase/CMakeLists.txt +++ b/sparta/example/SystemC/2_phase/CMakeLists.txt @@ -44,7 +44,6 @@ if(SYSTEMC_SUPPORT) ../common/sparta-target/ ) - include (../../../test/TestingMacros.cmake) sparta_named_test(sparta_sys_phase2_tlm sparta_sysc_model_2_phase) endif() diff --git a/sparta/simdb/test/CoreDatabase/CMakeLists.txt b/sparta/simdb/test/CoreDatabase/CMakeLists.txt index 2371a0b09e..8647ac500b 100644 --- a/sparta/simdb/test/CoreDatabase/CMakeLists.txt +++ b/sparta/simdb/test/CoreDatabase/CMakeLists.txt @@ -1,8 +1,7 @@ project(SIMDB_CoreDatabase_test) add_executable(SIMDB_CoreDatabase_test CoreDatabase_test.cpp) - -include(../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SimdbTestingMacros.cmake) simdb_recursive_copy(SIMDB_CoreDatabase_test test_dbs) diff --git a/sparta/simdb/test/HDF5Database/CMakeLists.txt b/sparta/simdb/test/HDF5Database/CMakeLists.txt index 10025572ba..871242e82d 100644 --- a/sparta/simdb/test/HDF5Database/CMakeLists.txt +++ b/sparta/simdb/test/HDF5Database/CMakeLists.txt @@ -2,7 +2,7 @@ project(SIMDB_HDF5Database_test) add_executable(SIMDB_HDF5Database_test HDF5Database_test.cpp) -include(../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SimdbTestingMacros.cmake) simdb_recursive_copy(SIMDB_HDF5Database_test test_dbs) diff --git a/sparta/simdb/test/SQLiteDatabase/CMakeLists.txt b/sparta/simdb/test/SQLiteDatabase/CMakeLists.txt index 5ded471f3d..4c21ede1f4 100644 --- a/sparta/simdb/test/SQLiteDatabase/CMakeLists.txt +++ b/sparta/simdb/test/SQLiteDatabase/CMakeLists.txt @@ -2,7 +2,7 @@ project(SIMDB_SQLiteDatabase_test) add_executable(SIMDB_SQLiteDatabase_test SQLiteDatabase_test.cpp) -include(../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SimdbTestingMacros.cmake) simdb_recursive_copy(SIMDB_SQLiteDatabase_test test_dbs) diff --git a/sparta/simdb/test/SharedDB/CMakeLists.txt b/sparta/simdb/test/SharedDB/CMakeLists.txt index edea5ca299..923c5bf7c7 100644 --- a/sparta/simdb/test/SharedDB/CMakeLists.txt +++ b/sparta/simdb/test/SharedDB/CMakeLists.txt @@ -2,7 +2,7 @@ project(SIMDB_SharedDB_test) add_executable(SIMDB_SharedDB_test SharedDB_test.cpp) -include(../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SimdbTestingMacros.cmake) simdb_recursive_copy(SIMDB_SharedDB_test test_dbs) diff --git a/sparta/simdb/test/Thread/CMakeLists.txt b/sparta/simdb/test/Thread/CMakeLists.txt index 51a1f66abc..dc7eec9171 100644 --- a/sparta/simdb/test/Thread/CMakeLists.txt +++ b/sparta/simdb/test/Thread/CMakeLists.txt @@ -2,7 +2,7 @@ project(SIMDB_Thread_test) add_executable(SIMDB_Thread_test Thread_test.cpp) -include(../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SimdbTestingMacros.cmake) simdb_test(SIMDB_Thread_test SIMDB_Thread_test_RUN) diff --git a/sparta/simdb/test/Thread/StandaloneCpp1/CMakeLists.txt b/sparta/simdb/test/Thread/StandaloneCpp1/CMakeLists.txt index c6f1ccab8b..13ca6f7b83 100644 --- a/sparta/simdb/test/Thread/StandaloneCpp1/CMakeLists.txt +++ b/sparta/simdb/test/Thread/StandaloneCpp1/CMakeLists.txt @@ -2,6 +2,6 @@ project(SIMDB_StandaloneThread_test) add_executable(SIMDB_StandaloneThread_test1 StandaloneThread_test1.cpp) -include(../../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SimdbTestingMacros.cmake) simdb_test(SIMDB_StandaloneThread_test1 SIMDB_StandaloneThread_test1_RUN) diff --git a/sparta/simdb/test/Utils/CMakeLists.txt b/sparta/simdb/test/Utils/CMakeLists.txt index d293f9dad9..749e91dfb5 100644 --- a/sparta/simdb/test/Utils/CMakeLists.txt +++ b/sparta/simdb/test/Utils/CMakeLists.txt @@ -2,6 +2,6 @@ project(SIMDB_Utils_test) add_executable(SIMDB_Utils_test Utils_test.cpp) -include(../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SimdbTestingMacros.cmake) simdb_test(SIMDB_Utils_test SIMDB_Utils_test_RUN) diff --git a/sparta/test/Array/CMakeLists.txt b/sparta/test/Array/CMakeLists.txt index 86d57b35ce..c7b27c8de3 100644 --- a/sparta/test/Array/CMakeLists.txt +++ b/sparta/test/Array/CMakeLists.txt @@ -1,5 +1,5 @@ project(Array_test) -include(../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) sparta_add_test_executable(Array_test Array_test.cpp) sparta_test(Array_test Array_test_RUN) diff --git a/sparta/test/Audience/CMakeLists.txt b/sparta/test/Audience/CMakeLists.txt index 1b7f9c4d04..0b733d10a8 100644 --- a/sparta/test/Audience/CMakeLists.txt +++ b/sparta/test/Audience/CMakeLists.txt @@ -2,6 +2,6 @@ project(Audience_test) sparta_add_test_executable(Audience_test Audience_main.cpp) -include(../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) sparta_test(Audience_test Audience_test_RUN) diff --git a/sparta/test/BasicHistogram/CMakeLists.txt b/sparta/test/BasicHistogram/CMakeLists.txt index b3f4c08eea..3bbd49a532 100644 --- a/sparta/test/BasicHistogram/CMakeLists.txt +++ b/sparta/test/BasicHistogram/CMakeLists.txt @@ -2,7 +2,7 @@ project(BasicHistogram_test) sparta_add_test_executable(BasicHistogram_test BasicHistogram_test.cpp) -include(../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) sparta_test(BasicHistogram_test BasicHistogram_test_RUN) diff --git a/sparta/test/BitArray/CMakeLists.txt b/sparta/test/BitArray/CMakeLists.txt index 3ab407b163..9a33003ebb 100644 --- a/sparta/test/BitArray/CMakeLists.txt +++ b/sparta/test/BitArray/CMakeLists.txt @@ -1,4 +1,4 @@ project(BitArray_test) sparta_add_test_executable(BitArray_test BitArray_test.cpp) -include(../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) sparta_test(BitArray_test BitArray_test_RUN) diff --git a/sparta/test/BoundedValue/CMakeLists.txt b/sparta/test/BoundedValue/CMakeLists.txt index a28f17e110..8974a7e634 100644 --- a/sparta/test/BoundedValue/CMakeLists.txt +++ b/sparta/test/BoundedValue/CMakeLists.txt @@ -2,7 +2,7 @@ project(BoundedValue_test) sparta_add_test_executable(BoundedValue_test BoundedValue_test.cpp) -include(../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) sparta_test(BoundedValue_test BoundedValue_test_RUN) diff --git a/sparta/test/Buffer/CMakeLists.txt b/sparta/test/Buffer/CMakeLists.txt index 0ed092c691..be86c7f832 100644 --- a/sparta/test/Buffer/CMakeLists.txt +++ b/sparta/test/Buffer/CMakeLists.txt @@ -2,6 +2,6 @@ project(Buffer_test) sparta_add_test_executable(Buffer_test Buffer_test.cpp) -include(../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) sparta_test(Buffer_test Buffer_test_RUN) diff --git a/sparta/test/Bus/CMakeLists.txt b/sparta/test/Bus/CMakeLists.txt index 4af1caea28..35be6a5ca4 100644 --- a/sparta/test/Bus/CMakeLists.txt +++ b/sparta/test/Bus/CMakeLists.txt @@ -2,6 +2,6 @@ project(Bus_test) sparta_add_test_executable(Bus_test Bus_main.cpp) -include(../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) sparta_test(Bus_test Bus_test_RUN) diff --git a/sparta/test/CMakeLists.txt b/sparta/test/CMakeLists.txt index ce317ae357..ac62373a08 100644 --- a/sparta/test/CMakeLists.txt +++ b/sparta/test/CMakeLists.txt @@ -3,6 +3,9 @@ PROJECT (SPARTA_TESTS) # Enable testing and configures the test/DartConfiguration.tcl include (CTest) +# Convenience macros and functions for tests +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) + # Setup options for valgrind testing. find_program (VALGRIND_TOOL valgrind) if (VALGRIND_TOOL) diff --git a/sparta/test/CircularBuffer/CMakeLists.txt b/sparta/test/CircularBuffer/CMakeLists.txt index 56dd9c6cbe..14e12a1116 100644 --- a/sparta/test/CircularBuffer/CMakeLists.txt +++ b/sparta/test/CircularBuffer/CMakeLists.txt @@ -2,6 +2,6 @@ project(CircularBuffer_test) sparta_add_test_executable(CircularBuffer_test CircularBuffer_test.cpp) -include(../TestingMacros.cmake) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) sparta_test(CircularBuffer_test CircularBuffer_test_RUN) diff --git a/sparta/test/Clock/CMakeLists.txt b/sparta/test/Clock/CMakeLists.txt index bd70dc92be..84a824e5f4 100644 --- a/sparta/test/Clock/CMakeLists.txt +++ b/sparta/test/Clock/CMakeLists.txt @@ -1,7 +1,7 @@ project(Clock_test) -sparta_add_test_executable(Clock_test Clock_test.cpp) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) -include(../TestingMacros.cmake) +sparta_add_test_executable(Clock_test Clock_test.cpp) sparta_test(Clock_test Clock_test_RUN) diff --git a/sparta/test/Collection/CMakeLists.txt b/sparta/test/Collection/CMakeLists.txt index 10652262d9..36a5724024 100644 --- a/sparta/test/Collection/CMakeLists.txt +++ b/sparta/test/Collection/CMakeLists.txt @@ -1,7 +1,7 @@ project(Collection_test) -sparta_add_test_executable(Collection_test Collection_test.cpp) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) -include(../TestingMacros.cmake) +sparta_add_test_executable(Collection_test Collection_test.cpp) sparta_test(Collection_test Collection_test_RUN) diff --git a/sparta/test/Color/CMakeLists.txt b/sparta/test/Color/CMakeLists.txt index cbed7d0017..c4432c8905 100644 --- a/sparta/test/Color/CMakeLists.txt +++ b/sparta/test/Color/CMakeLists.txt @@ -1,7 +1,7 @@ project(Color_test) -sparta_add_test_executable(Color_test Color_test.cpp) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) -include(../TestingMacros.cmake) +sparta_add_test_executable(Color_test Color_test.cpp) sparta_test(Color_test Color_test_RUN) diff --git a/sparta/test/CommandLineSimulator/Args/CMakeLists.txt b/sparta/test/CommandLineSimulator/Args/CMakeLists.txt index 2800f59053..93d3dfe3e4 100644 --- a/sparta/test/CommandLineSimulator/Args/CMakeLists.txt +++ b/sparta/test/CommandLineSimulator/Args/CMakeLists.txt @@ -2,8 +2,6 @@ project(CommandLineSimulatorArgs_test) sparta_add_test_executable(CommandLineSimulatorArgs_test CommandLineSimulatorArgs_test.cpp) -include(../../TestingMacros.cmake) - sparta_copy(CommandLineSimulatorArgs_test *.yaml) sparta_test(CommandLineSimulatorArgs_test CommandLineSimulatorArgs_test_RUN) diff --git a/sparta/test/CommandLineSimulator/CMakeLists.txt b/sparta/test/CommandLineSimulator/CMakeLists.txt index f9e9c2bdc1..334c5ae72e 100644 --- a/sparta/test/CommandLineSimulator/CMakeLists.txt +++ b/sparta/test/CommandLineSimulator/CMakeLists.txt @@ -1,8 +1,8 @@ project(CommandLineSimulator_test) -sparta_add_test_executable(CommandLineSimulator_test CommandLineSimulator_test.cpp) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) -include(../TestingMacros.cmake) +sparta_add_test_executable(CommandLineSimulator_test CommandLineSimulator_test.cpp) add_subdirectory(Args) diff --git a/sparta/test/ContextCounter/CMakeLists.txt b/sparta/test/ContextCounter/CMakeLists.txt index a6fb94b45a..4002bae9aa 100644 --- a/sparta/test/ContextCounter/CMakeLists.txt +++ b/sparta/test/ContextCounter/CMakeLists.txt @@ -1,7 +1,7 @@ project(ContextCounter_test) -sparta_add_test_executable(ContextCounter_test ContextCounter_test.cpp) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) -include(../TestingMacros.cmake) +sparta_add_test_executable(ContextCounter_test ContextCounter_test.cpp) sparta_test(ContextCounter_test ContextCounter_test_RUN) diff --git a/sparta/test/Counter/CMakeLists.txt b/sparta/test/Counter/CMakeLists.txt index d72b261509..7033aad013 100644 --- a/sparta/test/Counter/CMakeLists.txt +++ b/sparta/test/Counter/CMakeLists.txt @@ -1,7 +1,7 @@ project(Counter_test) -sparta_add_test_executable(Counter_test Counter_test.cpp) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) -include(../TestingMacros.cmake) +sparta_add_test_executable(Counter_test Counter_test.cpp) sparta_test(Counter_test Counter_test_RUN) diff --git a/sparta/test/CycleHistogram/CMakeLists.txt b/sparta/test/CycleHistogram/CMakeLists.txt index e83a186106..f95bfc29db 100644 --- a/sparta/test/CycleHistogram/CMakeLists.txt +++ b/sparta/test/CycleHistogram/CMakeLists.txt @@ -1,5 +1,6 @@ project(CycleHistogram_test) -include(../TestingMacros.cmake) + +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) sparta_add_test_executable(CycleHistogram_test CycleHistogram_test.cpp) sparta_test(CycleHistogram_test CycleHistogram_test_RUN) diff --git a/sparta/test/DAG/CMakeLists.txt b/sparta/test/DAG/CMakeLists.txt index 911b0b0c02..7f10fc4143 100644 --- a/sparta/test/DAG/CMakeLists.txt +++ b/sparta/test/DAG/CMakeLists.txt @@ -1,7 +1,7 @@ project(Dag_test) -sparta_add_test_executable(DAG_test DAG_main.cpp) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) -include(../TestingMacros.cmake) +sparta_add_test_executable(DAG_test DAG_main.cpp) sparta_test(DAG_test DAG_test_RUN) diff --git a/sparta/test/DAG_Ordering/CMakeLists.txt b/sparta/test/DAG_Ordering/CMakeLists.txt index 0aa05f33ec..cbd85decca 100644 --- a/sparta/test/DAG_Ordering/CMakeLists.txt +++ b/sparta/test/DAG_Ordering/CMakeLists.txt @@ -2,8 +2,6 @@ project(Dag_ordering) sparta_add_test_executable(DAG_ordering DAG_Ordering_main.cpp) -include(../TestingMacros.cmake) - sparta_test(DAG_ordering DAG_ordering_RUN) #sparta_copy(DAG_ordering gold.gexf) #sparta_copy(DAG_ordering gold_cycle.gexf) diff --git a/sparta/test/DataView/CMakeLists.txt b/sparta/test/DataView/CMakeLists.txt index c4ae2d4c3e..ec8dbdbb19 100644 --- a/sparta/test/DataView/CMakeLists.txt +++ b/sparta/test/DataView/CMakeLists.txt @@ -2,6 +2,4 @@ project(Dataview_test) sparta_add_test_executable(DataView_test DataView_test.cpp) -include(../TestingMacros.cmake) - sparta_test(DataView_test DataView_test_RUN) diff --git a/sparta/test/Enum/CMakeLists.txt b/sparta/test/Enum/CMakeLists.txt index 43f8523bb6..b71e7f8d83 100644 --- a/sparta/test/Enum/CMakeLists.txt +++ b/sparta/test/Enum/CMakeLists.txt @@ -2,6 +2,4 @@ project(Enum_test) sparta_add_test_executable(Enum_test Enum_main.cpp) -include(../TestingMacros.cmake) - sparta_test(Enum_test Enum_test_RUN) diff --git a/sparta/test/EnumCycleHistogram/CMakeLists.txt b/sparta/test/EnumCycleHistogram/CMakeLists.txt index 6b26484b7b..cae74e8036 100644 --- a/sparta/test/EnumCycleHistogram/CMakeLists.txt +++ b/sparta/test/EnumCycleHistogram/CMakeLists.txt @@ -2,6 +2,4 @@ project(EnumCycleHistogram_test) sparta_add_test_executable(EnumCycleHistogram_test EnumCycleHistogram_test.cpp) -include(../TestingMacros.cmake) - sparta_test(EnumCycleHistogram_test EnumCycleHistogram_test_RUN) diff --git a/sparta/test/Events/CMakeLists.txt b/sparta/test/Events/CMakeLists.txt index 4158dae4f9..d2c521d591 100644 --- a/sparta/test/Events/CMakeLists.txt +++ b/sparta/test/Events/CMakeLists.txt @@ -1,7 +1,5 @@ project(Events_test) -include(../TestingMacros.cmake) - sparta_add_test_executable(Events_test Events.cpp) sparta_add_test_executable(AsyncEvent_test AsyncEvent.cpp) sparta_add_test_executable(GlobalEvent_test GlobalEvent_test.cpp) diff --git a/sparta/test/ExportedPort/CMakeLists.txt b/sparta/test/ExportedPort/CMakeLists.txt index 20635aeb1d..6a1bbd6be2 100644 --- a/sparta/test/ExportedPort/CMakeLists.txt +++ b/sparta/test/ExportedPort/CMakeLists.txt @@ -2,6 +2,4 @@ project(ExportedPort_test) sparta_add_test_executable(ExportedPort_test ExportedPort_test.cpp) -include(../TestingMacros.cmake) - sparta_test(ExportedPort_test) diff --git a/sparta/test/FastCheckpoint/CMakeLists.txt b/sparta/test/FastCheckpoint/CMakeLists.txt index 519461ac21..19c186e058 100644 --- a/sparta/test/FastCheckpoint/CMakeLists.txt +++ b/sparta/test/FastCheckpoint/CMakeLists.txt @@ -2,8 +2,6 @@ project(Fastcheckpoint_test) sparta_add_test_executable(FastCheckpoint_test FastCheckpoint_test.cpp) -include(../TestingMacros.cmake) - sparta_test(FastCheckpoint_test FastCheckpoint_test_RUN) add_subdirectory(FILEStream) diff --git a/sparta/test/FastCheckpoint/FILEStream/CMakeLists.txt b/sparta/test/FastCheckpoint/FILEStream/CMakeLists.txt index c883f29f9a..ff3249c3f9 100644 --- a/sparta/test/FastCheckpoint/FILEStream/CMakeLists.txt +++ b/sparta/test/FastCheckpoint/FILEStream/CMakeLists.txt @@ -2,6 +2,4 @@ project(FILEStream_test) sparta_add_test_executable(FILEStream_test FILEStream_test.cpp) -include(../../TestingMacros.cmake) - sparta_test(FILEStream_test FILEStream_test_RUN) diff --git a/sparta/test/FastCheckpoint/PersistentFastCheckpoint/CMakeLists.txt b/sparta/test/FastCheckpoint/PersistentFastCheckpoint/CMakeLists.txt index 82c16535b1..33d52e9284 100644 --- a/sparta/test/FastCheckpoint/PersistentFastCheckpoint/CMakeLists.txt +++ b/sparta/test/FastCheckpoint/PersistentFastCheckpoint/CMakeLists.txt @@ -2,6 +2,4 @@ project(PersistentFastCheckpoint_test) sparta_add_test_executable(PersistentFastCheckpoint_test PersistentFastCheckpoint_test.cpp) -include(../../TestingMacros.cmake) - sparta_test(PersistentFastCheckpoint_test PersistentFastCheckpoint_test_RUN) diff --git a/sparta/test/FastList/CMakeLists.txt b/sparta/test/FastList/CMakeLists.txt index 9ab634d38c..c74c8cadb3 100644 --- a/sparta/test/FastList/CMakeLists.txt +++ b/sparta/test/FastList/CMakeLists.txt @@ -2,6 +2,4 @@ project(FastList_test) sparta_add_test_executable(FastList_test FastList_test.cpp) -include(../TestingMacros.cmake) - sparta_test(FastList_test FastList_test_RUN) diff --git a/sparta/test/HierarchicalBuilding/CMakeLists.txt b/sparta/test/HierarchicalBuilding/CMakeLists.txt index bda0c265b1..28b62dfa4a 100644 --- a/sparta/test/HierarchicalBuilding/CMakeLists.txt +++ b/sparta/test/HierarchicalBuilding/CMakeLists.txt @@ -2,8 +2,6 @@ project(HierarchicalBuilding_test) sparta_add_test_executable(HierarchicalBuilding_test HierarchicalBuilding_test.cpp) -include(../TestingMacros.cmake) - #sparta_test(HierarchicalBuilding_test HierarchicalBuilding_test_RUN) #sparta_copy(HierarchicalBuilding_test *.yaml) diff --git a/sparta/test/Histogram/CMakeLists.txt b/sparta/test/Histogram/CMakeLists.txt index 7d58ef5a7b..94b9439e04 100644 --- a/sparta/test/Histogram/CMakeLists.txt +++ b/sparta/test/Histogram/CMakeLists.txt @@ -2,7 +2,5 @@ project(Histogram_test) sparta_add_test_executable(Histogram_test Histogram_test.cpp) -include(../TestingMacros.cmake) - sparta_test(Histogram_test Histogram_test_RUN) diff --git a/sparta/test/KeyPairCollect/CMakeLists.txt b/sparta/test/KeyPairCollect/CMakeLists.txt index 7e598725ce..255cae1af3 100644 --- a/sparta/test/KeyPairCollect/CMakeLists.txt +++ b/sparta/test/KeyPairCollect/CMakeLists.txt @@ -2,6 +2,4 @@ project(Keypaircollect) sparta_add_test_executable(KeyPairCollect KeyPairCollect_test.cpp) -include(../TestingMacros.cmake) - sparta_test(KeyPairCollect KeyPairCollect_RUN) diff --git a/sparta/test/KeyValue/CMakeLists.txt b/sparta/test/KeyValue/CMakeLists.txt index 53703a1b4a..75e6917f3b 100644 --- a/sparta/test/KeyValue/CMakeLists.txt +++ b/sparta/test/KeyValue/CMakeLists.txt @@ -2,6 +2,4 @@ project(Keyvalue_test) sparta_add_test_executable(KeyValue_test KeyValue_test.cpp) -include(../TestingMacros.cmake) - sparta_test(KeyValue_test KeyValue_test_RUN) diff --git a/sparta/test/LockedValue/CMakeLists.txt b/sparta/test/LockedValue/CMakeLists.txt index d62d14f20f..4da8146dc9 100644 --- a/sparta/test/LockedValue/CMakeLists.txt +++ b/sparta/test/LockedValue/CMakeLists.txt @@ -2,6 +2,4 @@ project(LockedValue_test) sparta_add_test_executable(LockedValue_test LockedValue_test.cpp) -include(../TestingMacros.cmake) - sparta_test(LockedValue_test LockedValue_test_RUN) diff --git a/sparta/test/Log/CMakeLists.txt b/sparta/test/Log/CMakeLists.txt index 2cccf01205..1a6c6ef77d 100644 --- a/sparta/test/Log/CMakeLists.txt +++ b/sparta/test/Log/CMakeLists.txt @@ -2,8 +2,6 @@ project(Log_test) sparta_add_test_executable(Log_test Log_test.cpp) -include(../TestingMacros.cmake) - sparta_test(Log_test Log_test_RUN) sparta_copy(Log_test *.EXPECTED) #sparta_copy(Log_test all.log.basic.EXPECTED) diff --git a/sparta/test/LogAll/CMakeLists.txt b/sparta/test/LogAll/CMakeLists.txt index 6f2948718c..6094170a45 100644 --- a/sparta/test/LogAll/CMakeLists.txt +++ b/sparta/test/LogAll/CMakeLists.txt @@ -2,7 +2,5 @@ project(Logall_test) sparta_add_test_executable(LogAll_test LogAll_test.cpp) -include(../TestingMacros.cmake) - sparta_test(LogAll_test LogAll_test_RUN) sparta_copy(LogAll_test everything.log.basic.EXPECTED) diff --git a/sparta/test/Memory/CMakeLists.txt b/sparta/test/Memory/CMakeLists.txt index 31a48a90a8..47c67a994b 100644 --- a/sparta/test/Memory/CMakeLists.txt +++ b/sparta/test/Memory/CMakeLists.txt @@ -2,8 +2,6 @@ project(Memory_test) sparta_add_test_executable(Memory_test Memory_test.cpp) -include(../TestingMacros.cmake) - sparta_named_test_no_valgrind(Memory_test Memory_test) # This test requires a larger stack size for valgrind diff --git a/sparta/test/MemoryMap/CMakeLists.txt b/sparta/test/MemoryMap/CMakeLists.txt index 131a18fee2..8a8bbea064 100644 --- a/sparta/test/MemoryMap/CMakeLists.txt +++ b/sparta/test/MemoryMap/CMakeLists.txt @@ -2,6 +2,4 @@ project(Memorymap_test) sparta_add_test_executable(MemoryMap_test MemoryMap_test.cpp) -include(../TestingMacros.cmake) - sparta_test(MemoryMap_test MemoryMap_test_RUN) diff --git a/sparta/test/MetaTypeList/CMakeLists.txt b/sparta/test/MetaTypeList/CMakeLists.txt index 4f4098cc21..56436321fe 100644 --- a/sparta/test/MetaTypeList/CMakeLists.txt +++ b/sparta/test/MetaTypeList/CMakeLists.txt @@ -2,8 +2,6 @@ project(MetaTypeList) sparta_add_test_executable(MetaTypeList MetaTypeList_test.cpp) -include(../TestingMacros.cmake) - sparta_test(MetaTypeList MetaTypeList_RUN) diff --git a/sparta/test/MethodDelegate/CMakeLists.txt b/sparta/test/MethodDelegate/CMakeLists.txt index 73ea606a41..a6c952805b 100644 --- a/sparta/test/MethodDelegate/CMakeLists.txt +++ b/sparta/test/MethodDelegate/CMakeLists.txt @@ -2,6 +2,4 @@ project(Methoddelegate_test) sparta_add_test_executable(MethodDelegate_test main.cpp) -include(../TestingMacros.cmake) - sparta_test(MethodDelegate_test MethodDelegate_test_RUN 10) diff --git a/sparta/test/MirrorNotification/CMakeLists.txt b/sparta/test/MirrorNotification/CMakeLists.txt index 5ade063baa..b17a7a4d22 100644 --- a/sparta/test/MirrorNotification/CMakeLists.txt +++ b/sparta/test/MirrorNotification/CMakeLists.txt @@ -2,6 +2,4 @@ project(MirrorNotifications_test) sparta_add_test_executable(MirrorNotifications_test MirrorNotifications_test.cpp) -include(../TestingMacros.cmake) - sparta_test(MirrorNotifications_test MirrorNotifications_test_RUN) diff --git a/sparta/test/Monitor/CMakeLists.txt b/sparta/test/Monitor/CMakeLists.txt index 90b308c3fb..dc7c871414 100644 --- a/sparta/test/Monitor/CMakeLists.txt +++ b/sparta/test/Monitor/CMakeLists.txt @@ -2,6 +2,4 @@ project(Monitor_test) sparta_add_test_executable(monitor_test Monitor_main.cpp) -include(../TestingMacros.cmake) - sparta_test(monitor_test monitor_test_RUN) diff --git a/sparta/test/NestedPEvents/CMakeLists.txt b/sparta/test/NestedPEvents/CMakeLists.txt index ac9f669381..138a807147 100644 --- a/sparta/test/NestedPEvents/CMakeLists.txt +++ b/sparta/test/NestedPEvents/CMakeLists.txt @@ -2,7 +2,5 @@ project(NestedPeventhelper) sparta_add_test_executable(NestedPEventHelper NestedPEventHelper_test.cpp) -include(../TestingMacros.cmake) - sparta_test(NestedPEventHelper NestedPEventHelper_RUN) diff --git a/sparta/test/Notification/CMakeLists.txt b/sparta/test/Notification/CMakeLists.txt index 4421049348..7261a840cb 100644 --- a/sparta/test/Notification/CMakeLists.txt +++ b/sparta/test/Notification/CMakeLists.txt @@ -2,6 +2,4 @@ project(Notification_test.cpp) sparta_add_test_executable(Notification_test Notification_test.cpp) -include(../TestingMacros.cmake) - sparta_test(Notification_test Notification_test_RUN) diff --git a/sparta/test/PEvents/CMakeLists.txt b/sparta/test/PEvents/CMakeLists.txt index da21b65652..d877c07c64 100644 --- a/sparta/test/PEvents/CMakeLists.txt +++ b/sparta/test/PEvents/CMakeLists.txt @@ -2,6 +2,4 @@ project(Peventhelper) sparta_add_test_executable(PEventHelper PEventHelper_test.cpp) -include(../TestingMacros.cmake) - sparta_test(PEventHelper PEventHelper_RUN) diff --git a/sparta/test/PairCollector/CMakeLists.txt b/sparta/test/PairCollector/CMakeLists.txt index 6bd80e20e0..eed083c14c 100644 --- a/sparta/test/PairCollector/CMakeLists.txt +++ b/sparta/test/PairCollector/CMakeLists.txt @@ -1,4 +1,3 @@ project(Collectable_test) sparta_add_test_executable(Collectable_test Collectable_test.cpp) -include(../TestingMacros.cmake) sparta_test(Collectable_test Collectable_test_RUN) diff --git a/sparta/test/Parameter/CMakeLists.txt b/sparta/test/Parameter/CMakeLists.txt index 81ad5f7dbc..5cad735fa5 100644 --- a/sparta/test/Parameter/CMakeLists.txt +++ b/sparta/test/Parameter/CMakeLists.txt @@ -2,6 +2,4 @@ project(Parameter_test) sparta_add_test_executable(Parameter_test Device.cpp Param_test.cpp) -include(../TestingMacros.cmake) - sparta_test(Parameter_test Parameter_test_RUN) diff --git a/sparta/test/Pipe/CMakeLists.txt b/sparta/test/Pipe/CMakeLists.txt index 8aa4d28ccc..1961d1d184 100644 --- a/sparta/test/Pipe/CMakeLists.txt +++ b/sparta/test/Pipe/CMakeLists.txt @@ -2,6 +2,4 @@ project(Pipe_test) sparta_add_test_executable(Pipe_test Pipe_test.cpp) -include(../TestingMacros.cmake) - sparta_test(Pipe_test Pipe_test_RUN) diff --git a/sparta/test/Pipeline/CMakeLists.txt b/sparta/test/Pipeline/CMakeLists.txt index 022a3aaab7..5a80cf51a5 100644 --- a/sparta/test/Pipeline/CMakeLists.txt +++ b/sparta/test/Pipeline/CMakeLists.txt @@ -2,6 +2,4 @@ project(Pipeline_test) sparta_add_test_executable(Pipeline_test Pipeline_test.cpp) -include(../TestingMacros.cmake) - sparta_test(Pipeline_test Pipeline_test_RUN) diff --git a/sparta/test/Port/CMakeLists.txt b/sparta/test/Port/CMakeLists.txt index 35fa174b07..192446ab77 100644 --- a/sparta/test/Port/CMakeLists.txt +++ b/sparta/test/Port/CMakeLists.txt @@ -2,6 +2,4 @@ project(Port_test) sparta_add_test_executable(Port_test Producer.cpp Consumer.cpp Port_test.cpp) -include(../TestingMacros.cmake) - sparta_test(Port_test Port_test_RUN) diff --git a/sparta/test/Preloading/CMakeLists.txt b/sparta/test/Preloading/CMakeLists.txt index 57c3c05aeb..5b8236321d 100644 --- a/sparta/test/Preloading/CMakeLists.txt +++ b/sparta/test/Preloading/CMakeLists.txt @@ -2,8 +2,6 @@ project(Preloading_test) sparta_add_test_executable(Preloading_test Preloading_main.cpp) -include(../TestingMacros.cmake) - sparta_copy(Preloading_test *.yaml) sparta_test(Preloading_test Preloading_test_RUN) diff --git a/sparta/test/Queue/CMakeLists.txt b/sparta/test/Queue/CMakeLists.txt index a64abe1e24..40945d2242 100644 --- a/sparta/test/Queue/CMakeLists.txt +++ b/sparta/test/Queue/CMakeLists.txt @@ -2,6 +2,4 @@ project(Queue_test) sparta_add_test_executable(Queue_test Queue_test.cpp) -include(../TestingMacros.cmake) - sparta_test(Queue_test Queue_test_RUN) diff --git a/sparta/test/Rational/CMakeLists.txt b/sparta/test/Rational/CMakeLists.txt index ca75e175f1..fa447e1166 100644 --- a/sparta/test/Rational/CMakeLists.txt +++ b/sparta/test/Rational/CMakeLists.txt @@ -2,6 +2,4 @@ project(Rational_test) sparta_add_test_executable(Rational_test main.cpp) -include(../TestingMacros.cmake) - sparta_test(Rational_test Rational_test_RUN) diff --git a/sparta/test/Register/CMakeLists.txt b/sparta/test/Register/CMakeLists.txt index 7969f74daf..3de2d345fe 100644 --- a/sparta/test/Register/CMakeLists.txt +++ b/sparta/test/Register/CMakeLists.txt @@ -2,6 +2,4 @@ project(Register_test) sparta_add_test_executable(Register_test Register_test.cpp) -include(../TestingMacros.cmake) - sparta_test(Register_test Register_test_RUN) diff --git a/sparta/test/Report/CMakeLists.txt b/sparta/test/Report/CMakeLists.txt index 9564f602fe..4d8a4f788a 100644 --- a/sparta/test/Report/CMakeLists.txt +++ b/sparta/test/Report/CMakeLists.txt @@ -2,8 +2,6 @@ project(Report_test) sparta_add_test_executable(Report_test Report_test.cpp) -include(../TestingMacros.cmake) - sparta_test(Report_test Report_test_RUN) sparta_copy(Report_test *.EXPECTED) sparta_copy(Report_test *.yaml) diff --git a/sparta/test/Report/Triggers/CMakeLists.txt b/sparta/test/Report/Triggers/CMakeLists.txt index fbb45aba27..b35964906d 100644 --- a/sparta/test/Report/Triggers/CMakeLists.txt +++ b/sparta/test/Report/Triggers/CMakeLists.txt @@ -2,7 +2,5 @@ project(Report_triggers_test) sparta_add_test_executable(Report_triggers_test Report_triggers.cpp) -include(../../TestingMacros.cmake) - sparta_test(Report_triggers_test Report_triggers_test_RUN) sparta_copy(Report_triggers_test *.yaml) diff --git a/sparta/test/ReportVerifier/CMakeLists.txt b/sparta/test/ReportVerifier/CMakeLists.txt index 5f77b47d9e..f6763e0268 100644 --- a/sparta/test/ReportVerifier/CMakeLists.txt +++ b/sparta/test/ReportVerifier/CMakeLists.txt @@ -2,6 +2,4 @@ project(ReportVerifier_test) sparta_add_test_executable(ReportVerifier_test ReportVerifier.cpp) -include(../TestingMacros.cmake) - sparta_test(ReportVerifier_test ReportVerifier_test_RUN) diff --git a/sparta/test/ResourceAssert/CMakeLists.txt b/sparta/test/ResourceAssert/CMakeLists.txt index c50f9dbc3c..62f00ebb9d 100644 --- a/sparta/test/ResourceAssert/CMakeLists.txt +++ b/sparta/test/ResourceAssert/CMakeLists.txt @@ -2,6 +2,4 @@ project(Resourceassert_test) sparta_add_test_executable(ResourceAssert_test ResourceAssert_test.cpp) -include(../TestingMacros.cmake) - sparta_test(ResourceAssert_test ResourceAssert_test_RUN) diff --git a/sparta/test/Scheduler/CMakeLists.txt b/sparta/test/Scheduler/CMakeLists.txt index 806c8c1c34..9255d31dba 100644 --- a/sparta/test/Scheduler/CMakeLists.txt +++ b/sparta/test/Scheduler/CMakeLists.txt @@ -5,7 +5,6 @@ add_subdirectory(CatchLoop) add_subdirectory(Timeout) sparta_add_test_executable(Scheduler_test Scheduler_test.cpp) -include(../TestingMacros.cmake) sparta_test(Scheduler_test Scheduler_test_RUN) diff --git a/sparta/test/Scheduler/CatchLoop/CMakeLists.txt b/sparta/test/Scheduler/CatchLoop/CMakeLists.txt index bea4cb8aa1..b554ad70ff 100644 --- a/sparta/test/Scheduler/CatchLoop/CMakeLists.txt +++ b/sparta/test/Scheduler/CatchLoop/CMakeLists.txt @@ -2,6 +2,4 @@ project(SchedulerCatchLoop_test) sparta_add_test_executable(SchedulerCatchLoop_test CatchLoop_test.cpp) -include(../../TestingMacros.cmake) - sparta_named_test_no_valgrind(SchedulerCatchLoop_test SchedulerCatchLoop_test) diff --git a/sparta/test/Scheduler/NoLoopTest/CMakeLists.txt b/sparta/test/Scheduler/NoLoopTest/CMakeLists.txt index f1e738b90d..067d23006a 100644 --- a/sparta/test/Scheduler/NoLoopTest/CMakeLists.txt +++ b/sparta/test/Scheduler/NoLoopTest/CMakeLists.txt @@ -2,6 +2,4 @@ project(Scheduler_noloop_test) sparta_add_test_executable(Scheduler_noloop_test Scheduler_noloop_test.cpp) -include(../../TestingMacros.cmake) - sparta_named_test_no_valgrind(Scheduler_noloop_test Scheduler_noloop_test Scheduler_noloop_test) diff --git a/sparta/test/Scheduler/Timeout/CMakeLists.txt b/sparta/test/Scheduler/Timeout/CMakeLists.txt index 754026516a..f9aa109856 100644 --- a/sparta/test/Scheduler/Timeout/CMakeLists.txt +++ b/sparta/test/Scheduler/Timeout/CMakeLists.txt @@ -2,6 +2,4 @@ project(SchedulerTimeout_test) sparta_add_test_executable(SchedulerTimeout_test Timeout_test.cpp) -include(../../TestingMacros.cmake) - sparta_named_test_no_valgrind(SchedulerTimeout_test SchedulerTimeout_test) diff --git a/sparta/test/Scoreboard/CMakeLists.txt b/sparta/test/Scoreboard/CMakeLists.txt index 464ab3e834..66e93b721f 100644 --- a/sparta/test/Scoreboard/CMakeLists.txt +++ b/sparta/test/Scoreboard/CMakeLists.txt @@ -2,6 +2,4 @@ project(Scoreboard_test) sparta_add_test_executable(Scoreboard_test Scoreboard_test.cpp) -include(../TestingMacros.cmake) - sparta_test(Scoreboard_test Scoreboard_test_RUN) diff --git a/sparta/test/SharedData/CMakeLists.txt b/sparta/test/SharedData/CMakeLists.txt index c9db30f545..72690c4659 100644 --- a/sparta/test/SharedData/CMakeLists.txt +++ b/sparta/test/SharedData/CMakeLists.txt @@ -2,6 +2,4 @@ project(SharedData) sparta_add_test_executable(SharedData_test SharedData_test.cpp) -include(../TestingMacros.cmake) - sparta_test(SharedData_test SharedData_test_RUN) diff --git a/sparta/test/SimDB/CMakeLists.txt b/sparta/test/SimDB/CMakeLists.txt index caef154a47..5da84a6a41 100644 --- a/sparta/test/SimDB/CMakeLists.txt +++ b/sparta/test/SimDB/CMakeLists.txt @@ -2,8 +2,6 @@ project(SimDB_test) sparta_add_test_executable(SimDB_test SimDB_test.cpp) -include(../TestingMacros.cmake) - sparta_copy(SimDB_test *.db) sparta_test(SimDB_test SimDB_test_RUN) diff --git a/sparta/test/SmartLexCast/CMakeLists.txt b/sparta/test/SmartLexCast/CMakeLists.txt index e7e2de97fb..331125eabb 100644 --- a/sparta/test/SmartLexCast/CMakeLists.txt +++ b/sparta/test/SmartLexCast/CMakeLists.txt @@ -2,6 +2,4 @@ project(Smartlexcast_test) sparta_add_test_executable(SmartLexCast_test SmartLexCast_test.cpp) -include(../TestingMacros.cmake) - sparta_test(SmartLexCast_test SmartLexCast_test_RUN) diff --git a/sparta/test/SpartaException/CMakeLists.txt b/sparta/test/SpartaException/CMakeLists.txt index 1118671a52..1df1b5b5cb 100644 --- a/sparta/test/SpartaException/CMakeLists.txt +++ b/sparta/test/SpartaException/CMakeLists.txt @@ -2,6 +2,4 @@ project(Spartaexception_test) sparta_add_test_executable(SpartaException_test SpartaException_test.cpp) -include(../TestingMacros.cmake) - sparta_test(SpartaException_test SpartaException_test_RUN) diff --git a/sparta/test/SpartaSharedPointer/CMakeLists.txt b/sparta/test/SpartaSharedPointer/CMakeLists.txt index dc2158d870..991e3bbc43 100644 --- a/sparta/test/SpartaSharedPointer/CMakeLists.txt +++ b/sparta/test/SpartaSharedPointer/CMakeLists.txt @@ -2,6 +2,4 @@ project(SpartaSharedPointer_test) sparta_add_test_executable(SpartaSharedPointer_test SpartaSharedPointer_test.cpp) -include(../TestingMacros.cmake) - sparta_test(SpartaSharedPointer_test SpartaSharedPointer_test_RUN) diff --git a/sparta/test/State/CMakeLists.txt b/sparta/test/State/CMakeLists.txt index 7b70272276..6ab8ecd41d 100644 --- a/sparta/test/State/CMakeLists.txt +++ b/sparta/test/State/CMakeLists.txt @@ -2,6 +2,4 @@ project(State_test) sparta_add_test_executable(State_test State_main.cpp) -include(../TestingMacros.cmake) - sparta_test(State_test State_test_RUN) diff --git a/sparta/test/StateResidencyTracker/CMakeLists.txt b/sparta/test/StateResidencyTracker/CMakeLists.txt index bff95fcf6d..c7b7dcb618 100644 --- a/sparta/test/StateResidencyTracker/CMakeLists.txt +++ b/sparta/test/StateResidencyTracker/CMakeLists.txt @@ -1,5 +1,4 @@ project(StateResidencyTracker_test) sparta_add_test_executable(StateResidencyTracker_test StateResidencyTracker_test.cpp) -include(../TestingMacros.cmake) sparta_test(StateResidencyTracker_test StateResidencyTracker_test_RUN) diff --git a/sparta/test/StateTimer/CMakeLists.txt b/sparta/test/StateTimer/CMakeLists.txt index 97fe714f0b..d517e370d0 100644 --- a/sparta/test/StateTimer/CMakeLists.txt +++ b/sparta/test/StateTimer/CMakeLists.txt @@ -2,6 +2,4 @@ project(StateTimer_test) sparta_add_test_executable(StateTimer_test StateTimer_test.cpp) -include(../TestingMacros.cmake) - sparta_test(StateTimer_test StateTimer_test_RUN) diff --git a/sparta/test/StaticInit/CMakeLists.txt b/sparta/test/StaticInit/CMakeLists.txt index 1d1bb4c60a..4d7505a352 100644 --- a/sparta/test/StaticInit/CMakeLists.txt +++ b/sparta/test/StaticInit/CMakeLists.txt @@ -2,6 +2,4 @@ project(Staticinit_test) sparta_add_test_executable(StaticInit_test StaticInit_test.cpp) -include(../TestingMacros.cmake) - sparta_test(StaticInit_test StaticInit_test_RUN) diff --git a/sparta/test/Statistic/CMakeLists.txt b/sparta/test/Statistic/CMakeLists.txt index 1ede1c2e17..9c998d784d 100644 --- a/sparta/test/Statistic/CMakeLists.txt +++ b/sparta/test/Statistic/CMakeLists.txt @@ -2,6 +2,4 @@ project(Statistic_test) sparta_add_test_executable(Statistic_test Statistic_test.cpp) -include(../TestingMacros.cmake) - sparta_test(Statistic_test Statistic_test_RUN) diff --git a/sparta/test/StatisticExpression/CMakeLists.txt b/sparta/test/StatisticExpression/CMakeLists.txt index 525276ca75..cc946128dc 100644 --- a/sparta/test/StatisticExpression/CMakeLists.txt +++ b/sparta/test/StatisticExpression/CMakeLists.txt @@ -2,6 +2,4 @@ project(Statisticexpression_test) sparta_add_test_executable(StatisticExpression_test StatisticExpression_test.cpp) -include(../TestingMacros.cmake) - sparta_test(StatisticExpression_test StatisticExpression_test_RUN) diff --git a/sparta/test/SubjectState/CMakeLists.txt b/sparta/test/SubjectState/CMakeLists.txt index b1875dc6b8..b1172e6d51 100644 --- a/sparta/test/SubjectState/CMakeLists.txt +++ b/sparta/test/SubjectState/CMakeLists.txt @@ -2,6 +2,4 @@ project(Subjectstate_test) sparta_add_test_executable(SubjectState_test SubjectState_main.cpp) -include(../TestingMacros.cmake) - sparta_test(SubjectState_test SubjectState_test_RUN) diff --git a/sparta/test/SyncPort/CMakeLists.txt b/sparta/test/SyncPort/CMakeLists.txt index cef10caba9..fcba5a80df 100644 --- a/sparta/test/SyncPort/CMakeLists.txt +++ b/sparta/test/SyncPort/CMakeLists.txt @@ -2,6 +2,4 @@ project(Syncport_test) sparta_add_test_executable(SyncPort_test SyncPort_test.cpp) -include(../TestingMacros.cmake) - sparta_test(SyncPort_test SyncPort_test_RUN) diff --git a/sparta/test/SystemC/CMakeLists.txt b/sparta/test/SystemC/CMakeLists.txt index 10a1e2211a..0a2048af21 100644 --- a/sparta/test/SystemC/CMakeLists.txt +++ b/sparta/test/SystemC/CMakeLists.txt @@ -3,7 +3,5 @@ project(Systemc_test) sparta_add_test_executable(SystemC_test SystemC_test.cpp) target_link_libraries (SystemC_test SystemC::systemc) -include(../TestingMacros.cmake) - sparta_test(SystemC_test SystemC_test_RUN) sparta_copy(SystemC_test scheduler.debug.EXPECTED) diff --git a/sparta/test/Tag/CMakeLists.txt b/sparta/test/Tag/CMakeLists.txt index 39612831ad..2c54f245ba 100644 --- a/sparta/test/Tag/CMakeLists.txt +++ b/sparta/test/Tag/CMakeLists.txt @@ -2,6 +2,4 @@ project(Tag_test) sparta_add_test_executable(Tag_test Tag_main.cpp) -include(../TestingMacros.cmake) - sparta_test(Tag_test Tag_test_RUN) diff --git a/sparta/test/TransactionDatabaseAPI/cpp_interface/CMakeLists.txt b/sparta/test/TransactionDatabaseAPI/cpp_interface/CMakeLists.txt index eec842e447..9e9584668a 100644 --- a/sparta/test/TransactionDatabaseAPI/cpp_interface/CMakeLists.txt +++ b/sparta/test/TransactionDatabaseAPI/cpp_interface/CMakeLists.txt @@ -2,6 +2,4 @@ project(Transactiondatabaseapi_cpp_test_cpp_interface) sparta_add_test_executable(TransactionDatabaseAPI_cpp_test TransactionDatabaseAPI_main.cpp) -include(../TestingMacros.cmake) - sparta_test(TransactionDatabaseAPI_cpp_test) diff --git a/sparta/test/TreeFilter/CMakeLists.txt b/sparta/test/TreeFilter/CMakeLists.txt index 831d70e93a..2f0fba4cda 100644 --- a/sparta/test/TreeFilter/CMakeLists.txt +++ b/sparta/test/TreeFilter/CMakeLists.txt @@ -2,6 +2,4 @@ project(Treefilter_test) sparta_add_test_executable(TreeFilter_test TreeFilter_main.cpp) -include(../TestingMacros.cmake) - sparta_test(TreeFilter_test TreeFilter_test_RUN) diff --git a/sparta/test/TreeNode/CMakeLists.txt b/sparta/test/TreeNode/CMakeLists.txt index 94c44ad831..e2b8a85351 100644 --- a/sparta/test/TreeNode/CMakeLists.txt +++ b/sparta/test/TreeNode/CMakeLists.txt @@ -2,7 +2,5 @@ project(Treenode_test) sparta_add_test_executable(TreeNode_test TreeNode_test.cpp) -include(../TestingMacros.cmake) - sparta_test(TreeNode_test TreeNode_test_RUN) sparta_copy(TreeNode_test *.json) diff --git a/sparta/test/TreeNodeDebug/CMakeLists.txt b/sparta/test/TreeNodeDebug/CMakeLists.txt index e543e1030a..9127ec2811 100644 --- a/sparta/test/TreeNodeDebug/CMakeLists.txt +++ b/sparta/test/TreeNodeDebug/CMakeLists.txt @@ -2,6 +2,4 @@ project(Treenodedebug_test) sparta_add_test_executable(TreeNodeDebug_test TreeNodeDebug_test.cpp) -include(../TestingMacros.cmake) - sparta_test(TreeNodeDebug_test TreeNodeDebug_test_RUN) diff --git a/sparta/test/TreeNodePrivacy/CMakeLists.txt b/sparta/test/TreeNodePrivacy/CMakeLists.txt index 8d01cb1e4c..0666daf8f4 100644 --- a/sparta/test/TreeNodePrivacy/CMakeLists.txt +++ b/sparta/test/TreeNodePrivacy/CMakeLists.txt @@ -2,6 +2,4 @@ project(TreeNodePrivacy_test) sparta_add_test_executable(TreeNodePrivacy_test TreeNodePrivacy_test.cpp) -include(../TestingMacros.cmake) - sparta_test(TreeNodePrivacy_test TreeNodePrivacy_test_RUN) diff --git a/sparta/test/TreeNodeScope/CMakeLists.txt b/sparta/test/TreeNodeScope/CMakeLists.txt index 8acc259112..ad05c6205c 100644 --- a/sparta/test/TreeNodeScope/CMakeLists.txt +++ b/sparta/test/TreeNodeScope/CMakeLists.txt @@ -2,6 +2,4 @@ project(TreeNodeScope_test) sparta_add_test_executable(TreeNodeScope_test TreeNodeScope_test.cpp) -include(../TestingMacros.cmake) - sparta_test(TreeNodeScope_test TreeNodeScope_test_RUN) diff --git a/sparta/test/Trigger/CMakeLists.txt b/sparta/test/Trigger/CMakeLists.txt index 733abbceda..f04be1f505 100644 --- a/sparta/test/Trigger/CMakeLists.txt +++ b/sparta/test/Trigger/CMakeLists.txt @@ -2,6 +2,4 @@ project(Trigger_test) sparta_add_test_executable(Trigger_test Trigger_test.cpp) -include(../TestingMacros.cmake) - sparta_test(Trigger_test Trigger_test_RUN) diff --git a/sparta/test/Utils/CMakeLists.txt b/sparta/test/Utils/CMakeLists.txt index 14a3daef4d..a788093704 100644 --- a/sparta/test/Utils/CMakeLists.txt +++ b/sparta/test/Utils/CMakeLists.txt @@ -2,6 +2,4 @@ project(Utils_test) sparta_add_test_executable(Utils_test Utils_test.cpp) -include(../TestingMacros.cmake) - sparta_test(Utils_test Utils_test_RUN) diff --git a/sparta/test/ValidValue/CMakeLists.txt b/sparta/test/ValidValue/CMakeLists.txt index 4c43d00248..ab8002e7aa 100644 --- a/sparta/test/ValidValue/CMakeLists.txt +++ b/sparta/test/ValidValue/CMakeLists.txt @@ -2,6 +2,4 @@ project(ValidValue_test) sparta_add_test_executable(ValidValue_test ValidValue_test.cpp) -include(../TestingMacros.cmake) - sparta_test(ValidValue_test ValidValue_test_RUN) diff --git a/sparta/test/VirtualParameterTree/CMakeLists.txt b/sparta/test/VirtualParameterTree/CMakeLists.txt index 8959ae4eb7..325c9f1b28 100644 --- a/sparta/test/VirtualParameterTree/CMakeLists.txt +++ b/sparta/test/VirtualParameterTree/CMakeLists.txt @@ -2,7 +2,6 @@ project(Vpt_test) sparta_add_test_executable(VPT_test VPT_test.cpp) -include(../TestingMacros.cmake) # We need to copy the tile to the build directory. sparta_copy(VPT_test input.yaml) diff --git a/sparta/test/cache/simple_cache/CMakeLists.txt b/sparta/test/cache/simple_cache/CMakeLists.txt index b87fdac12c..cdcae5727e 100644 --- a/sparta/test/cache/simple_cache/CMakeLists.txt +++ b/sparta/test/cache/simple_cache/CMakeLists.txt @@ -1,5 +1,4 @@ project(Simple_cache) -include(../../TestingMacros.cmake) sparta_add_test_executable(simple_cache main.cpp l1_line_state.cpp) From 39b914749c86d7854b3fbfbfe7501c9eba6b317b Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Fri, 10 Feb 2023 13:22:55 +0100 Subject: [PATCH 16/48] helios build now using FindSparta.cmake --- helios/CMakeLists.txt | 1 + helios/pipeViewer/CMakeLists.txt | 12 +++++++----- helios/pipeViewer/argos_dumper/CMakeLists.txt | 2 +- .../argos_dumper/DatabaseDump/CMakeLists.txt | 3 ++- helios/pipeViewer/transactiondb/CMakeLists.txt | 9 +-------- helios/pipeViewer/transactionsearch/CMakeLists.txt | 3 ++- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/helios/CMakeLists.txt b/helios/CMakeLists.txt index aa01ab524d..1b3f915a66 100644 --- a/helios/CMakeLists.txt +++ b/helios/CMakeLists.txt @@ -1,3 +1,4 @@ cmake_minimum_required (VERSION 3.15) add_subdirectory (pipeViewer) +#install(DIRECTORY pipeViewer/ DESTINATION pipeViewer PATTERN "__pycache__" EXCLUDE) diff --git a/helios/pipeViewer/CMakeLists.txt b/helios/pipeViewer/CMakeLists.txt index fcf2bfd93c..60f3347ff7 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -10,10 +10,16 @@ set (CMAKE_CXX_STANDARD 17) set (CMAKE_CXX_STANDARD_REQUIRED ON) if(NOT ${Python3_FOUND}) - message(WARNING "Cmake could not find PythonInterp, trying to fall back on system default python3") + message(WARNING "Cmake could not find python3, trying to fall back on system default python3") find_program(Python3_EXECUTABLE 'python3') endif() +# Point find_package to the right parts of the source and build tree +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/sparta/cmake ${CMAKE_MODULE_PATH}) +set(SPARTA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/sparta) +set(SPARTA_LIBRARY ${CMAKE_BINARY_DIR}/sparta) +find_package(Sparta REQUIRED) + set(SETUP_PY "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/setup.py") set(PY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/core.so.built") @@ -25,10 +31,6 @@ add_custom_command(OUTPUT "${PY_OUTPUT}" ) add_custom_target(pipe_view_py ALL DEPENDS "${PY_OUTPUT}") -include_directories(${SPARTA_BASE} ${SPARTA_BASE}/simdb/include ./) - -include(${SPARTA_BASE}/cmake/sparta-config.cmake) - add_subdirectory(transactiondb) add_subdirectory(transactionsearch) add_subdirectory(argos_dumper) diff --git a/helios/pipeViewer/argos_dumper/CMakeLists.txt b/helios/pipeViewer/argos_dumper/CMakeLists.txt index 87dcc4151b..c9dd465b09 100644 --- a/helios/pipeViewer/argos_dumper/CMakeLists.txt +++ b/helios/pipeViewer/argos_dumper/CMakeLists.txt @@ -6,6 +6,6 @@ enable_testing () add_executable(Argos_dumper ArgosCollection_test.cpp) add_test (NAME Argos_dumper_RUN COMMAND Argos_dumper) -target_link_libraries (Argos_dumper ${Sparta_LIBS}) +target_link_libraries (Argos_dumper SPARTA::sparta) add_subdirectory(DatabaseDump) diff --git a/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt b/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt index 243a723a66..3f149f2d1d 100644 --- a/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt +++ b/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt @@ -1,6 +1,7 @@ project(Argosdumper) add_executable(ArgosDumper Database_dumper.cpp) -target_link_libraries (ArgosDumper ${Sparta_LIBS}) +target_include_directories(ArgosDumper PRIVATE ${CMAKE_SOURCE_DIR}/helios/pipeViewer) +target_link_libraries (ArgosDumper SPARTA::sparta) add_test (NAME ArgosDumperSmokeTestingDB COMMAND ArgosDumper db_pipeout/pipeout) diff --git a/helios/pipeViewer/transactiondb/CMakeLists.txt b/helios/pipeViewer/transactiondb/CMakeLists.txt index 8c950f4954..2e9bcd52b8 100644 --- a/helios/pipeViewer/transactiondb/CMakeLists.txt +++ b/helios/pipeViewer/transactiondb/CMakeLists.txt @@ -1,16 +1,9 @@ cmake_minimum_required(VERSION 3.15) -# FIXME this should not depend on SPARTA_BASE but instead use: -# find_package(Sparta X.Y REQUIRED) -# BUT, that will require creating a cmake find module for Sparta first... -if (NOT DEFINED SPARTA_BASE) - message (FATAL_ERROR "SPARTA_BASE must be defined. cmake from the root of MAP repo") -endif() - project(transactiondb) set(TRANSACTIONDB_SRC_DIR ${PROJECT_SOURCE_DIR}/src) - +get_property(YAML_CPP_INCLUDE_DIR TARGET yaml-cpp PROPERTY INTERFACE_INCLUDE_DIRECTORIES) ################################################################## # Build the transactiondb.so ################################################################## diff --git a/helios/pipeViewer/transactionsearch/CMakeLists.txt b/helios/pipeViewer/transactionsearch/CMakeLists.txt index 8cfffbf1a3..9c052e8cf6 100644 --- a/helios/pipeViewer/transactionsearch/CMakeLists.txt +++ b/helios/pipeViewer/transactionsearch/CMakeLists.txt @@ -3,4 +3,5 @@ project(TransactionSearch) add_executable(transactionsearch src/transaction_search.cpp) add_dependencies(transactionsearch sparta simdb) -target_link_libraries(transactionsearch ${Sparta_LIBS}) +target_include_directories(transactionsearch PRIVATE ${CMAKE_SOURCE_DIR}/helios/pipeViewer) +target_link_libraries(transactionsearch SPARTA::sparta) From 88c595b1bed8b73586b489f454a4dcd4da23293e Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Fri, 10 Feb 2023 15:11:59 +0100 Subject: [PATCH 17/48] pipeviewer cannot use find_package(sparta), which only works once installed --- helios/pipeViewer/CMakeLists.txt | 5 ++--- helios/pipeViewer/argos_dumper/CMakeLists.txt | 2 +- helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt | 2 +- helios/pipeViewer/transactionsearch/CMakeLists.txt | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/helios/pipeViewer/CMakeLists.txt b/helios/pipeViewer/CMakeLists.txt index 60f3347ff7..b3188f5ddc 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -16,9 +16,8 @@ endif() # Point find_package to the right parts of the source and build tree set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/sparta/cmake ${CMAKE_MODULE_PATH}) -set(SPARTA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/sparta) -set(SPARTA_LIBRARY ${CMAKE_BINARY_DIR}/sparta) -find_package(Sparta REQUIRED) +include_directories(${SPARTA_BASE} ${SPARTA_BASE}/simdb/include ./) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/sparta-config.cmake) set(SETUP_PY "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/setup.py") diff --git a/helios/pipeViewer/argos_dumper/CMakeLists.txt b/helios/pipeViewer/argos_dumper/CMakeLists.txt index c9dd465b09..87dcc4151b 100644 --- a/helios/pipeViewer/argos_dumper/CMakeLists.txt +++ b/helios/pipeViewer/argos_dumper/CMakeLists.txt @@ -6,6 +6,6 @@ enable_testing () add_executable(Argos_dumper ArgosCollection_test.cpp) add_test (NAME Argos_dumper_RUN COMMAND Argos_dumper) -target_link_libraries (Argos_dumper SPARTA::sparta) +target_link_libraries (Argos_dumper ${Sparta_LIBS}) add_subdirectory(DatabaseDump) diff --git a/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt b/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt index 3f149f2d1d..3ded10c7ce 100644 --- a/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt +++ b/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt @@ -2,6 +2,6 @@ project(Argosdumper) add_executable(ArgosDumper Database_dumper.cpp) target_include_directories(ArgosDumper PRIVATE ${CMAKE_SOURCE_DIR}/helios/pipeViewer) -target_link_libraries (ArgosDumper SPARTA::sparta) +target_link_libraries (ArgosDumper ${Sparta_LIBS}) add_test (NAME ArgosDumperSmokeTestingDB COMMAND ArgosDumper db_pipeout/pipeout) diff --git a/helios/pipeViewer/transactionsearch/CMakeLists.txt b/helios/pipeViewer/transactionsearch/CMakeLists.txt index 9c052e8cf6..26f5760faa 100644 --- a/helios/pipeViewer/transactionsearch/CMakeLists.txt +++ b/helios/pipeViewer/transactionsearch/CMakeLists.txt @@ -1,7 +1,6 @@ project(TransactionSearch) add_executable(transactionsearch src/transaction_search.cpp) -add_dependencies(transactionsearch sparta simdb) target_include_directories(transactionsearch PRIVATE ${CMAKE_SOURCE_DIR}/helios/pipeViewer) -target_link_libraries(transactionsearch SPARTA::sparta) +target_link_libraries(transactionsearch ${Sparta_LIBS}) From 3edcc33520df196aaf12a9c7c40fcee25c07a81f Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Wed, 15 Feb 2023 10:37:49 +0100 Subject: [PATCH 18/48] installing all py files and libs but module paths don't work yet after install --- helios/CMakeLists.txt | 1 - helios/pipeViewer/CMakeLists.txt | 2 ++ helios/pipeViewer/transactiondb/CMakeLists.txt | 2 ++ helios/pipeViewer/transactionsearch/CMakeLists.txt | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/helios/CMakeLists.txt b/helios/CMakeLists.txt index 1b3f915a66..aa01ab524d 100644 --- a/helios/CMakeLists.txt +++ b/helios/CMakeLists.txt @@ -1,4 +1,3 @@ cmake_minimum_required (VERSION 3.15) add_subdirectory (pipeViewer) -#install(DIRECTORY pipeViewer/ DESTINATION pipeViewer PATTERN "__pycache__" EXCLUDE) diff --git a/helios/pipeViewer/CMakeLists.txt b/helios/pipeViewer/CMakeLists.txt index b3188f5ddc..697ef70e13 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -33,3 +33,5 @@ add_custom_target(pipe_view_py ALL DEPENDS "${PY_OUTPUT}") add_subdirectory(transactiondb) add_subdirectory(transactionsearch) add_subdirectory(argos_dumper) + +install(DIRECTORY pipe_view/ DESTINATION pipe_view PATTERN "__pycache__" EXCLUDE) diff --git a/helios/pipeViewer/transactiondb/CMakeLists.txt b/helios/pipeViewer/transactiondb/CMakeLists.txt index 2e9bcd52b8..143acac393 100644 --- a/helios/pipeViewer/transactiondb/CMakeLists.txt +++ b/helios/pipeViewer/transactiondb/CMakeLists.txt @@ -40,3 +40,5 @@ add_custom_target (transactiondb_driver ALL DEPENDS ${TRANSACTIONDB_SRC_DIR}/Reader.hpp ${TRANSACTIONDB_SRC_DIR}/TransactionDatabaseInterface.hpp) add_dependencies(transactiondb_driver sparta) + +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/ TYPE LIB) diff --git a/helios/pipeViewer/transactionsearch/CMakeLists.txt b/helios/pipeViewer/transactionsearch/CMakeLists.txt index 26f5760faa..fdb8aae677 100644 --- a/helios/pipeViewer/transactionsearch/CMakeLists.txt +++ b/helios/pipeViewer/transactionsearch/CMakeLists.txt @@ -4,3 +4,5 @@ add_executable(transactionsearch src/transaction_search.cpp) target_include_directories(transactionsearch PRIVATE ${CMAKE_SOURCE_DIR}/helios/pipeViewer) target_link_libraries(transactionsearch ${Sparta_LIBS}) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/transactionsearch TYPE BIN) From 05178f7ee1bc5c13f7789e56918e13cc03918d04 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Thu, 16 Feb 2023 14:40:35 +0100 Subject: [PATCH 19/48] simpler setup for cython build - working for transactiondb, rest todo --- helios/pipeViewer/CMakeLists.txt | 100 ++++++++++++++++++++++--------- helios/pipeViewer/setup.py | 42 +++++++++++++ 2 files changed, 115 insertions(+), 27 deletions(-) create mode 100644 helios/pipeViewer/setup.py diff --git a/helios/pipeViewer/CMakeLists.txt b/helios/pipeViewer/CMakeLists.txt index 697ef70e13..0cd6ad1e57 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -1,37 +1,83 @@ cmake_minimum_required(VERSION 3.15) project (PipeViewer) +include(${CMAKE_SOURCE_DIR}/sparta/cmake/sparta-config.cmake) + # If we are in virtualenv or conda, that takes prio over any system python there might be set(Python3_FIND_VIRTUALENV FIRST) +find_package(Python3 3.7 REQUIRED COMPONENTS Interpreter) -find_package (Python3 3.7 REQUIRED COMPONENTS Interpreter Development) +# Set up the include and link dirs for python's setuptools using setup.cfg file +# HDF5: need to extract dirs from paths to libs +foreach(lib IN LISTS HDF5_LIBRARIES) + get_filename_component(d ${lib} DIRECTORY) + list(APPEND _LIB_DIRS ${d}) +endforeach() +list(REMOVE_DUPLICATES _LIB_DIRS) +# And we add sparta and simdb location +list(APPEND _LIB_DIRS "$" "$") +# Write actual setup.cfg +file(GENERATE + OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/setup.cfg + CONTENT +" +[build_ext] +include_dirs=$,:> +library_dirs=$ +") -set (CMAKE_CXX_STANDARD 17) -set (CMAKE_CXX_STANDARD_REQUIRED ON) +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cython.stamp + COMMAND ${Python3_EXECUTABLE} setup.py build_ext + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/cython.stamp + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS + # ${CMAKE_CURRENT_SOURCE_DIR}/extras/python-bindings/setup.py + # ${CMAKE_CURRENT_SOURCE_DIR}/extras/python-bindings/setup.cfg + # ${CMAKE_CURRENT_SOURCE_DIR}/extras/python-bindings/src/foo/__init__.py + # ${CMAKE_CURRENT_SOURCE_DIR}/extras/python-bindings/src/foo/c_foo.pxd + # ${CMAKE_CURRENT_SOURCE_DIR}/extras/python-bindings/src/foo/foo_ext.pxd + # ${CMAKE_CURRENT_SOURCE_DIR}/extras/python-bindings/src/foo/foo_ext.pyx + sparta simdb + ${CMAKE_CURRENT_SOURCE_DIR}/setup.cfg + COMMENT "Building pipeViwer and its depenencies" +) +add_custom_target(pipeView ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/cython.stamp) -if(NOT ${Python3_FOUND}) - message(WARNING "Cmake could not find python3, trying to fall back on system default python3") - find_program(Python3_EXECUTABLE 'python3') -endif() +install(CODE + "execute_process( + COMMAND ${Python3_EXECUTABLE} setup.py install + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}" +) +#find_package (Python3 3.7 REQUIRED COMPONENTS Interpreter Development) +# +#set (CMAKE_CXX_STANDARD 17) +#set (CMAKE_CXX_STANDARD_REQUIRED ON) +# +#if(NOT ${Python3_FOUND}) +# message(WARNING "Cmake could not find python3, trying to fall back on system default python3") +# find_program(Python3_EXECUTABLE 'python3') +#endif() +# # Point find_package to the right parts of the source and build tree -set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/sparta/cmake ${CMAKE_MODULE_PATH}) -include_directories(${SPARTA_BASE} ${SPARTA_BASE}/simdb/include ./) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/sparta-config.cmake) - -set(SETUP_PY "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/setup.py") - -set(PY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/core.so.built") - -add_custom_command(OUTPUT "${PY_OUTPUT}" - COMMAND ${CMAKE_COMMAND} -E env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} LD=${CMAKE_LINKER} TARGETDIR=${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core -- ${Python3_EXECUTABLE} ${SETUP_PY} build_ext --inplace - COMMAND ${CMAKE_COMMAND} -E touch ${PY_OUTPUT} - DEPENDS ${SETUP_PY} "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/src/core.pyx" - ) -add_custom_target(pipe_view_py ALL DEPENDS "${PY_OUTPUT}") - -add_subdirectory(transactiondb) -add_subdirectory(transactionsearch) -add_subdirectory(argos_dumper) - -install(DIRECTORY pipe_view/ DESTINATION pipe_view PATTERN "__pycache__" EXCLUDE) +#set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/sparta/cmake ${CMAKE_MODULE_PATH}) +#include_directories(${SPARTA_BASE} ${SPARTA_BASE}/simdb/include ./) +#include(${CMAKE_SOURCE_DIR}/sparta/cmake/sparta-config.cmake) +# +#set(SETUP_PY "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/setup.py") +# +#set(PY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/core.so.built") +# +#add_custom_command(OUTPUT "${PY_OUTPUT}" +# COMMAND ${CMAKE_COMMAND} -E env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} LD=${CMAKE_LINKER} TARGETDIR=${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core -- ${Python3_EXECUTABLE} ${SETUP_PY} build_ext --inplace +# COMMAND ${CMAKE_COMMAND} -E touch ${PY_OUTPUT} +# DEPENDS ${SETUP_PY} "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/src/core.pyx" +# ) +#add_custom_target(pipe_view_py ALL DEPENDS "${PY_OUTPUT}") +## +#add_subdirectory(transactiondb) +#add_subdirectory(transactionsearch) +#add_subdirectory(argos_dumper) +# +#install(DIRECTORY pipe_view/ DESTINATION pipe_view PATTERN "__pycache__" EXCLUDE) diff --git a/helios/pipeViewer/setup.py b/helios/pipeViewer/setup.py new file mode 100644 index 0000000000..d88c41fe6f --- /dev/null +++ b/helios/pipeViewer/setup.py @@ -0,0 +1,42 @@ +import setuptools +from Cython.Build import cythonize +from Cython.Distutils import build_ext + + +compile_args = ['--std=c++17'] # Required for SPARTA +# override strict flags +compile_args += [ + '-Wno-cast-qual', + '-Wno-deprecated-declarations', + '-Wno-strict-aliasing', + '-Wall', + '-Wpedantic' +] + +# Wrappers for the parts written in Cython +# Transaction DB +transaction_db = setuptools.Extension( + 'pipe_view.transactiondb', + language='c++', + sources=['transactiondb/src/transactiondb.pyx'], + libraries=["sparta", "simdb", "hdf5", "sqlite3"], + pyrex_gdb = True, + extra_compile_args = compile_args, +) +ext_modules = [transaction_db] + + +setuptools.setup( + packages=['pipe_view'], + ext_modules = cythonize(ext_modules, language_level=3), + #package_dir={'': 'src'}, +# package_data={ +# 'foo': ['foo_ext.pxd', 'c_foo.pxd'] +# }, + include_package_data=True, + setup_requires=[ + 'cython' + ], + tests_require=['pytest'], + zip_safe=False, + ) From c6eb29e86aa0108516dbad95df00fd23a88dbcd4 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Thu, 16 Feb 2023 14:41:34 +0100 Subject: [PATCH 20/48] cleaner HDF5 libs config for sparta --- sparta/cmake/sparta-config.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sparta/cmake/sparta-config.cmake b/sparta/cmake/sparta-config.cmake index be9a8f7212..d4feb5bbf3 100644 --- a/sparta/cmake/sparta-config.cmake +++ b/sparta/cmake/sparta-config.cmake @@ -73,7 +73,7 @@ message (STATUS "Using HDF5 ${HDF5_VERSION}") # Populate the Sparta_LIBS variable with the required libraries for # basic Sparta linking -set (Sparta_LIBS sparta simdb ${HDF5_LIBRARIES} sqlite3 yaml-cpp ZLIB::ZLIB pthread +set (Sparta_LIBS sparta simdb HDF5::HDF5 sqlite3 yaml-cpp ZLIB::ZLIB pthread Boost::date_time Boost::iostreams Boost::serialization Boost::timer Boost::program_options) # On Linux we need to link against rt as well From 546ded4620543d5f56ff2d1ac17f99ffb99ccd1a Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Thu, 16 Feb 2023 12:33:15 -0600 Subject: [PATCH 21/48] Documentation cleanup --- README.md | 42 +++++++++++++++++++++++++++++++++++-- helios/pipeViewer/README.md | 20 +----------------- sparta/README.md | 7 +++++++ 3 files changed, 48 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 881878e600..78324e91d6 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,51 @@ MAP is broken into two parts: 1. **Sparta** -- A set of C++ classes (C++17) used to construct, bind, and run full simulation designs and produce performance analysis data in text form, database form, or HDF5. It's a modeling framework. 1. **Helios** -- A set of python tools used to visualize, analyze, and deep dive data generated for a Sparta-built simulator. It's a visualization toolset. -## Current build status +## Current Regression Status [![CircleCI](https://circleci.com/gh/sparcians/map.svg?style=svg)](https://circleci.com/gh/sparcians/map) [![MacOS Build Status](https://dev.azure.com/sparcians/map/_apis/build/status/sparcians.map?branchName=master&label=MacOS)](https://dev.azure.com/sparcians/map/_build/latest?definitionId=1&branchName=master) [![Documentation](https://github.com/sparcians/map/workflows/Documentation/badge.svg)](https://sparcians.github.io/map/) -## Updating Regression/Build Environments +## Building MAP + +Building MAP can be done in two ways: + +1. Here at the top level of the repository, which builds everything + * Argos, the transaction viewer in Helios + * Sparta, the modeling framework +1. Down in Sparta, which only builds Sparta + +The MAP repository has numerous dependencies, which are listed in a +[conda recipe](https://github.com/sparcians/map/blob/master/conda.recipe/meta.yaml), +and the versions of these libraries continuously change. + +However, with the use of the conda recipe, users can set up a conda +environment that will build and run the tools found in this repository. + +This guide assumes the user is not familiar with conda nor has it +installed and would like to build everything (not just sparta). + +1. If conda is not installed, install it + * Get miniconda and install: https://docs.conda.io/en/latest/miniconda.html + * You can install miniconda anywhere +1. Activate conda `conda activate` +1. Go to the root of MAP + * `cd map` +1. Install JSON and YAML parsers + * `conda install -c conda-forge jq` + * `conda install -c conda-forge yq` +1. Create a sparta conda development environment + * `./scripts/create_conda_env.sh sparta dev` +1. Activate the environment + * `conda activate sparta` +1. To build MAP and it's components + * `conda activate sparta` + * `cd map; mkdir release; cd release` + * `cmake -DCMAKE_BUILD_TYPE=Release ..` + * `make` + +## Updating Regression/Build Environments for CI CI files are generated when the command `conda smithy rerender` is run inside a MAP clone. That command uses the following files to control diff --git a/helios/pipeViewer/README.md b/helios/pipeViewer/README.md index f16e2d6004..e9c7af2509 100644 --- a/helios/pipeViewer/README.md +++ b/helios/pipeViewer/README.md @@ -2,25 +2,7 @@ ## Prerequisites -1. This project requires Cython and wxPython, which are available in the Conda environment -1. If conda is not installed, install it - * Get miniconda and install: https://docs.conda.io/en/latest/miniconda.html - * You can install miniconda anywhere -1. Go to the root of MAP - * `cd map` -1. Install JSON and Yaml parsers - * `conda install -c conda-forge jq` - * `conda install -c conda-forge yq` -1. Create a sparta conda development environment - * `./scripts/create_conda_env.sh sparta dev` -1. Activate the environment - * `conda activate sparta` -1. To build this tool and its dependent libraries, use cmake from the root of MAP using the created conda environment - * `conda activate sparta` - * `cd $(git rev-parse --show-toplevel); mkdir release; cd release` - * `cmake -DCMAKE_BUILD_TYPE=Release ..` - * If you're running newer versions of OS X and get compile errors, try using `CC=/usr/bin/clang CXX=/usr/bin/clang++ LD=/usr/bin/ld cmake -DCMAKE_BUILD_TYPE=Release ..` instead - * `make` +Follow the conda environment directions found in the top-level README.md of MAP. ## Example of Usage diff --git a/sparta/README.md b/sparta/README.md index c2c29a4cc1..de33ecd153 100644 --- a/sparta/README.md +++ b/sparta/README.md @@ -15,6 +15,10 @@ design. ## Quick Start for the Impatient, Yet Confident +Quick guide that illustrates how to build _just the framework_ and not +the visualization tools. Highly suggested to use a conda environment as +described in map/README.md. + ``` # Install the following @@ -88,6 +92,9 @@ Please also note that `conda` will solve the package requirements and may instal ## Getting Sparta to build on MacOS X +Highly suggested to use a conda environment as described in +map/README.md, but brew can work just as well. + ### Time to Brew Go to the [Brew main website](https://brew.sh) to learn more. From 3cc1cf088e3135229d536f3df23e185caac281f4 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Mon, 20 Feb 2023 13:54:53 +0100 Subject: [PATCH 22/48] Major rehaul of how argos ties into cmake - cmake pushes all config into setuptools via setup.cfg where possible (such that all found libs in cmake and sparta deps are automatically in sync with rest of the build) - python setup.py then manages the cythonized build *and* installation of all python files by doing python setup.py install - Cleaned up all python imports so they are relative imports (previously mixed absolute vs relative which breaks when you install the package) - relocated some of the cython files in the source tree for easier build and install --- helios/pipeViewer/CMakeLists.txt | 41 +++- helios/pipeViewer/pipe_view/__main__.py | 0 helios/pipeViewer/pipe_view/argos.py | 23 +- helios/pipeViewer/pipe_view/core/setup.py | 215 ------------------ helios/pipeViewer/pipe_view/gui/argos_menu.py | 8 +- .../pipe_view/gui/dialogs/element_propsdlg.py | 14 +- .../pipe_view/gui/dialogs/find_element_dlg.py | 4 +- .../gui/dialogs/layout_exit_dialog.py | 4 +- .../pipe_view/gui/dialogs/layout_varsdlg.py | 4 +- .../pipe_view/gui/dialogs/location_window.py | 10 +- .../pipe_view/gui/dialogs/search_dlg.py | 6 +- .../gui/dialogs/select_layout_dlg.py | 2 +- .../gui/dialogs/translate_elements_dlg.py | 4 +- .../gui/dialogs/view_settings_dlg.py | 4 +- .../pipe_view/gui/dialogs/watchlist_dialog.py | 4 +- .../pipeViewer/pipe_view/gui/hover_preview.py | 14 +- .../pipeViewer/pipe_view/gui/layout_canvas.py | 18 +- .../pipeViewer/pipe_view/gui/layout_frame.py | 10 +- .../pipe_view/gui/selection_manager.py | 12 +- .../pipe_view/gui/widgets/element_list.py | 6 +- .../gui/widgets/element_property_list.py | 16 +- .../gui/widgets/frame_playback_bar.py | 8 +- .../pipe_view/gui/widgets/location_entry.py | 2 +- .../pipe_view/gui/widgets/transaction_list.py | 6 +- .../{core => logsearch}/src/log_search.cpp | 0 .../{core => logsearch}/src/logsearch.pyx | 0 helios/pipeViewer/pipe_view/misc/version.py | 2 +- helios/pipeViewer/pipe_view/model/database.py | 29 +-- helios/pipeViewer/pipe_view/model/element.py | 6 +- helios/pipeViewer/pipe_view/model/group.py | 2 +- helios/pipeViewer/pipe_view/model/layout.py | 8 +- .../pipe_view/model/layout_context.py | 18 +- .../pipe_view/model/layout_delta.py | 4 +- .../pipeViewer/pipe_view/model/quad_tree.py | 2 +- .../pipeViewer/pipe_view/model/query_set.py | 10 +- .../pipe_view/model/search_handle.py | 6 +- helios/pipeViewer/pipe_view/model/settings.py | 4 +- .../pipeViewer/pipe_view/model/workspace.py | 14 +- .../transactiondb/src/.gitignore | 0 .../src/PipelineDataCallback.hpp | 0 .../transactiondb/src/Reader.hpp | 0 .../src/SimpleOutputInterface.hpp | 0 .../src/TransactionDatabaseInterface.hpp | 0 .../transactiondb/src/TransactionInterval.hpp | 0 .../transactiondb/src/common.pxd | 0 .../transactiondb/src/helpers.hpp | 0 .../transactiondb/src/transactiondb.pyx | 0 helios/pipeViewer/setup.py | 43 +++- .../pipeViewer/transactiondb/CMakeLists.txt | 44 ---- helios/pipeViewer/transactiondb/setup.py | 154 ------------- .../transactionsearch/CMakeLists.txt | 9 +- helios/pipeViewer/wxPythonInclude.py | 12 + 52 files changed, 222 insertions(+), 580 deletions(-) delete mode 100644 helios/pipeViewer/pipe_view/__main__.py delete mode 100755 helios/pipeViewer/pipe_view/core/setup.py rename helios/pipeViewer/pipe_view/{core => logsearch}/src/log_search.cpp (100%) rename helios/pipeViewer/pipe_view/{core => logsearch}/src/logsearch.pyx (100%) rename helios/pipeViewer/{ => pipe_view}/transactiondb/src/.gitignore (100%) rename helios/pipeViewer/{ => pipe_view}/transactiondb/src/PipelineDataCallback.hpp (100%) rename helios/pipeViewer/{ => pipe_view}/transactiondb/src/Reader.hpp (100%) rename helios/pipeViewer/{ => pipe_view}/transactiondb/src/SimpleOutputInterface.hpp (100%) rename helios/pipeViewer/{ => pipe_view}/transactiondb/src/TransactionDatabaseInterface.hpp (100%) rename helios/pipeViewer/{ => pipe_view}/transactiondb/src/TransactionInterval.hpp (100%) rename helios/pipeViewer/{ => pipe_view}/transactiondb/src/common.pxd (100%) rename helios/pipeViewer/{ => pipe_view}/transactiondb/src/helpers.hpp (100%) rename helios/pipeViewer/{ => pipe_view}/transactiondb/src/transactiondb.pyx (100%) delete mode 100644 helios/pipeViewer/transactiondb/CMakeLists.txt delete mode 100644 helios/pipeViewer/transactiondb/setup.py create mode 100644 helios/pipeViewer/wxPythonInclude.py diff --git a/helios/pipeViewer/CMakeLists.txt b/helios/pipeViewer/CMakeLists.txt index 0cd6ad1e57..db998e95c0 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -7,6 +7,26 @@ include(${CMAKE_SOURCE_DIR}/sparta/cmake/sparta-config.cmake) set(Python3_FIND_VIRTUALENV FIRST) find_package(Python3 3.7 REQUIRED COMPONENTS Interpreter) +# Look for wxWidgets +find_package(wxWidgets REQUIRED core base) +include(${wxWidgets_USE_FILE}) + +# Populate list of include dirs: +# Little helper script to find wxPython include path +execute_process( + COMMAND ${Python3_EXECUTABLE} wxPythonInclude.py + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE WX_PYTHON_INC + ERROR_VARIABLE WXCHECK_LOG + RESULT_VARIABLE WXCHECK_RESULT + OUTPUT_STRIP_TRAILING_WHITESPACE +) +if(NOT WXCHECK_RESULT EQUAL "0") + message(FATAL_ERROR "Could not find wxPython: ${WXCHECK_LOG}") +endif() +list(APPEND _INC_DIRS "$" ${WX_PYTHON_INC} ${wxWidgets_INCLUDE_DIRS}) + +# Populate list of library dirs: # Set up the include and link dirs for python's setuptools using setup.cfg file # HDF5: need to extract dirs from paths to libs foreach(lib IN LISTS HDF5_LIBRARIES) @@ -15,20 +35,29 @@ foreach(lib IN LISTS HDF5_LIBRARIES) endforeach() list(REMOVE_DUPLICATES _LIB_DIRS) # And we add sparta and simdb location -list(APPEND _LIB_DIRS "$" "$") -# Write actual setup.cfg +list(APPEND _LIB_DIRS "$" "$" ${wxWidgets_LIBRARY_DIRS}) + +# Those get pushed to setup.cfg file file(GENERATE OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/setup.cfg CONTENT " [build_ext] -include_dirs=$,:> +include_dirs=$ library_dirs=$ ") +# Wx specific arguments get passed via LDFLAGS and CXXFLAGS in the command +foreach(def IN LISTS wxWidgets_DEFINITIONS) + string(APPEND PYTHON_CFLAGS "-D${def} ") +endforeach() +message(WARNING " " ${wxWidgets_LIBRARIES}) +string(JOIN " " PYTHON_LDFLAGS ${wxWidgets_LIBRARIES}) +message(WARNING " " ${PYTHON_LDFLAGS}) + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cython.stamp - COMMAND ${Python3_EXECUTABLE} setup.py build_ext + COMMAND ${CMAKE_COMMAND} -E env CFLAGS=${PYTHON_CFLAGS} LDFLAGS=${PYTHON_LDFLAGS} ${Python3_EXECUTABLE} setup.py build_ext --inplace VERBATIM COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/cython.stamp WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS @@ -44,10 +73,12 @@ add_custom_command( ) add_custom_target(pipeView ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/cython.stamp) +add_subdirectory(transactionsearch) + install(CODE "execute_process( COMMAND ${Python3_EXECUTABLE} setup.py install - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})" ) #find_package (Python3 3.7 REQUIRED COMPONENTS Interpreter Development) diff --git a/helios/pipeViewer/pipe_view/__main__.py b/helios/pipeViewer/pipe_view/__main__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/helios/pipeViewer/pipe_view/argos.py b/helios/pipeViewer/pipe_view/argos.py index 5792895ff4..43a5c00241 100755 --- a/helios/pipeViewer/pipe_view/argos.py +++ b/helios/pipeViewer/pipe_view/argos.py @@ -36,19 +36,17 @@ # Argos imports need to go below this line (some depend on the path to core.so) -import gui.autocoloring # noqa: E402 -from gui.dialogs.select_db_dlg import SelectDatabaseDlg # noqa: E402 -from gui.dialogs.select_layout_dlg import SelectLayoutDlg # noqa: E402 -from model.database import Database # noqa: E402 -from model.settings import ArgosSettings # noqa: E402 -from model.utilities import LogFormatter # noqa: E402 -from model.workspace import Workspace # noqa: E402 +from pipe_view.gui import autocoloring # noqa: E402 +from pipe_view.gui.dialogs.select_db_dlg import SelectDatabaseDlg # noqa: E402 +from pipe_view.gui.dialogs.select_layout_dlg import SelectLayoutDlg # noqa: E402 +from pipe_view.model.database import Database # noqa: E402 +from pipe_view.model.settings import ArgosSettings # noqa: E402 +from pipe_view.model.utilities import LogFormatter # noqa: E402 +from pipe_view.model.workspace import Workspace # noqa: E402 # End Argos imports -if __name__ != '__main__': - raise ImportError('argos.py must be run as a script and not imported') -else: +def main(): rc = 0 logging.getLogger().setLevel(logging.INFO) @@ -234,7 +232,7 @@ def OnInit(self) -> bool: settings = ArgosSettings() # The user can specify default colorblindness and palette shuffle modes # with these environment variables - gui.autocoloring.BuildBrushes(settings.palette, settings.palette_shuffle) + autocoloring.BuildBrushes(settings.palette, settings.palette_shuffle) # Preconfigure the workspace with options # Must be after wx.App is instantiated @@ -463,3 +461,6 @@ def replace(match: re.Match[str]) -> str: ws.Cleanup() sys.exit(rc) + +if __name__ == '__main__': + main() diff --git a/helios/pipeViewer/pipe_view/core/setup.py b/helios/pipeViewer/pipe_view/core/setup.py deleted file mode 100755 index 43fc1c460b..0000000000 --- a/helios/pipeViewer/pipe_view/core/setup.py +++ /dev/null @@ -1,215 +0,0 @@ -#!/usr/bin/env python3 - -from __future__ import annotations -from distutils.sysconfig import get_config_vars # for static lib dir -from distutils.core import setup -import pkgutil -from _frozen_importlib_external import SourceFileLoader # type: ignore -import os -import os.path -import glob -from pathlib import Path -import shutil -import subprocess -import sys -from typing import List, Tuple, Union, cast - -# Force use of a different Cython -cython_dir = os.environ.get('CYTHON_DIR', None) -if cython_dir: - print(f'CYTHON_DIR overridden with "{cython_dir}"') - sys.path.insert(0, cython_dir) - -import Cython # noqa: E402 -print(f'Using CYTHON: {Cython.__path__} : {Cython.__version__}') - -from Cython.Distutils.extension import Extension # noqa: E402 -from Cython.Distutils import build_ext # noqa: E402 -from Cython.Build import cythonize # noqa: E402 - -wx_pkg = pkgutil.get_loader('wx') -if wx_pkg is None: - print("wx python library is not installed!") - sys.exit(1) - -assert isinstance(wx_pkg, SourceFileLoader) -inc_dirs = [os.path.join(os.path.dirname(wx_pkg.get_filename()), 'include')] - -# Environment Setup -if 'TARGETDIR' not in os.environ: - print("must set TARGETDIR in env, not currently set") - sys.exit(1) -destination_dir = os.environ["TARGETDIR"] -# Required from caller for choosing an extension to build -extension = os.environ.get("BUILD", '') - -system_include_dirs: List[str] = [] - -py_src_dir = Path(__file__).parent.resolve() / 'src' - -# Support for systems with GTK3 and GTK2 installed side-by-side - -# Check for user-specified wx-config -wx_config = os.environ.get('WX_CONFIG') - -# Get canonical path -if wx_config is not None: - wx_config = os.path.realpath(wx_config) - -# Try GTK3-specific utility next -if wx_config is None: - wx_config = shutil.which('wx-config-gtk3') - -# Try generic wx-config next -if wx_config is None: - wx_config = shutil.which('wx-config') - -# Couldn't find wx-config - cannot continue -assert wx_config is not None, \ - 'wx-config must be present in your PATH in order to build Argos' - - -def get_wx_flags(*args: str) -> List[str]: - assert wx_config is not None - return subprocess.check_output( - [wx_config] + list(args) - ).decode('utf-8').split() - - -flags = get_wx_flags('--cppflags') -wx_inc_dirs = [flg[2:] for flg in flags if flg.startswith('-I')] -wx_defines: List[Union[Tuple[str, ...], Tuple[str, None]]] -wx_defines = [tuple(flg[2:].split('=')) for flg in flags if flg[:2] == '-D'] - - -def ensure_2_tuple( - t: Union[Tuple[str, ...], Tuple[str, None]] -) -> Union[Tuple[str, str], Tuple[str, None]]: - if len(t) == 1: - return t[0], None - return cast(Tuple[str, str], t) - - -wx_defines = [ensure_2_tuple(a) for a in wx_defines] - -flags = get_wx_flags('--libs') -wx_link_args = flags - -compile_args = ['--std=c++17'] # Required for SPARTA - -# override strict flags -compile_args += [ - '-Wno-cast-qual', - '-Wno-deprecated-declarations', - '-Wno-strict-aliasing', - '-Wall', - '-Wpedantic' -] - -argos_version_def = [( - '_ARGOS_VERSION', - '"\'' + os.environ.get('ARGOS_VERSION', 'unknown') + '\'"' -)] -def_macros = wx_defines[:] + argos_version_def -inc_dirs += wx_inc_dirs[:] -link_args = wx_link_args[:] - - -dbg_build = os.environ.get("DBG_BUILD", 0) -debug = False -if dbg_build in (1, '1', 'true', 'True', 'TRUE'): - print('Building in DEBUG mode') - compile_args.extend(('-g3', '-O0')) - debug = True -else: - print('Building in Release mode') - def_macros.append(('NDEBUG',)) - compile_args.extend(('-g3', '-O3')) - -if "clang" in os.environ.get("CC", ""): - compile_args.extend(( - '-Wno-unused-command-line-argument', - '-Wno-ignored-optimization-argument' - )) - -for d in system_include_dirs: - compile_args.append('-isystem' + d) - -# Modules to build -PYTHON_STATIC_LIBS = get_config_vars()['LIBDIR'] -MODULES = { - 'logsearch': { - 'sources': ('logsearch.pyx', 'log_search.cpp',) - }, - 'core': { - 'sources': ('core.pyx',) - }, -} - - -if False: - # Select the module from the environment variable - if extension.strip(): - modules = MODULES - else: - if extension not in MODULES: - raise Exception( - f'Extension "{extension}" specified by env var BUILD was not ' - 'found in known MODULES available for building' - ) - modules = {extension: MODULES[extension]} -else: - modules = MODULES - -me = "pipe_view/core/setup.py: " -print(me, "def_macros: ", def_macros) -print(me, "inc_dirs: ", inc_dirs) -print(me, "link_args: ", link_args) - -# Build each module -for module_name, module_info in modules.items(): - - if isinstance(module_info, dict): - source_files = module_info['sources'] # Required - else: - source_files = module_info - - # Source Files - sources = [os.path.join(py_src_dir, src_file) for src_file in source_files] - - ext_def = Extension( - module_name, - sources, - include_dirs=inc_dirs, - define_macros=def_macros, - extra_compile_args=compile_args, - extra_link_args=link_args, - language='c++', - ) - - # Build - print((me, "CC orig: ", os.environ.get('CC', '""'))) - print((me, "CXX orig: ", os.environ.get('CXX', '""'))) - print((me, "CFLAGS: ", os.environ.get('CFLAGS', '""'))) - print((me, "CPPFLAGS: ", os.environ.get('CPPFLAGS', '""'))) - setup( - cmdclass={'build_ext': build_ext}, - ext_modules=cythonize( - [ext_def], - language_level=3, - gdb_debug=debug - ) - ) - - # Move built files - # FIXME instead of doing this, we should correctly move the python files - # into the build directory so that we're really doing an out-of-source - # build, but whatever. - print('') - out_file = glob.glob(f"{module_name}*.so")[0] - moduleName = f"{module_name}.so" - print(f'Moving built module "{out_file}" to directory "{destination_dir}" ' - f'as "{moduleName}"') - os.rename(out_file, os.path.join(destination_dir, moduleName)) - -print(f'Successfully built {len(modules)} python extension modules\n') diff --git a/helios/pipeViewer/pipe_view/gui/argos_menu.py b/helios/pipeViewer/pipe_view/gui/argos_menu.py index 4588bd1ae7..65838c3c94 100644 --- a/helios/pipeViewer/pipe_view/gui/argos_menu.py +++ b/helios/pipeViewer/pipe_view/gui/argos_menu.py @@ -5,9 +5,9 @@ import logging from typing import Optional, cast, Tuple, Union, TYPE_CHECKING -from misc.version import get_version -from model.layout import Layout -from model.schedule_element import ScheduleLineElement +from ..misc.version import get_version +from ..model.layout import Layout +from ..model.schedule_element import ScheduleLineElement from .hover_preview import HoverPreviewOptionsDialog from .dialogs.element_propsdlg import ElementTypeSelectionDialog from .dialogs.layout_varsdlg import LayoutVariablesDialog @@ -18,7 +18,7 @@ from .dialogs.view_settings_dlg import ViewSettingsDialog if TYPE_CHECKING: - from gui.layout_frame import Layout_Frame + from .layout_frame import Layout_Frame # Name each ID by ID_MENU_SUBMENU_etc... ID_FILE_NEW = wx.NewId() diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/element_propsdlg.py b/helios/pipeViewer/pipe_view/gui/dialogs/element_propsdlg.py index 91bad53a5e..96a6899ca1 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/element_propsdlg.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/element_propsdlg.py @@ -1,17 +1,17 @@ from __future__ import annotations import wx -import model.element_types as eltypes -from gui.widgets.element_property_list import ElementPropertyList -from gui.font_utils import ScaleFont +from ...model import element_types as eltypes +from ..widgets.element_property_list import ElementPropertyList +from ..font_utils import ScaleFont from typing import List, Optional, Tuple, Union, TYPE_CHECKING if TYPE_CHECKING: - from model.element import Element - from gui.layout_canvas import Layout_Canvas - from gui.layout_frame import Layout_Frame - from gui.selection_manager import Selection_Mgr + from ...model.element import Element + from ..layout_canvas import Layout_Canvas + from ..layout_frame import Layout_Frame + from ..selection_manager import Selection_Mgr # The GUI-side window for editing the properties of an Element diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/find_element_dlg.py b/helios/pipeViewer/pipe_view/gui/dialogs/find_element_dlg.py index 9933746ba9..1d11ebd960 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/find_element_dlg.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/find_element_dlg.py @@ -2,11 +2,11 @@ from __future__ import annotations import wx -from gui.widgets.element_list import ElementList +from ..widgets.element_list import ElementList from typing import Dict, List, Optional, Set, TYPE_CHECKING if TYPE_CHECKING: - from gui.layout_frame import Layout_Frame + from ..layout_frame import Layout_Frame # FindElementDialog is a window that enables the user to enter a string, diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/layout_exit_dialog.py b/helios/pipeViewer/pipe_view/gui/dialogs/layout_exit_dialog.py index eff2db8914..9e8b58beba 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/layout_exit_dialog.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/layout_exit_dialog.py @@ -4,10 +4,10 @@ import os import wx.lib.platebtn as platebtn -from gui.font_utils import ScaleFont +from ..font_utils import ScaleFont if TYPE_CHECKING: - from gui.layout_frame import Layout_Frame + from ..layout_frame import Layout_Frame # Prompts the user if there are unsaved changes when trying to close a layout diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/layout_varsdlg.py b/helios/pipeViewer/pipe_view/gui/dialogs/layout_varsdlg.py index d7cffbdd54..3c560d11fc 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/layout_varsdlg.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/layout_varsdlg.py @@ -3,10 +3,10 @@ from typing import Dict, List, Optional, Tuple, Union, TYPE_CHECKING import wx.lib.mixins.listctrl as listmix -from gui.font_utils import ScaleFont +from ..font_utils import ScaleFont if TYPE_CHECKING: - from model.layout_context import Layout_Context + from ...model.layout_context import Layout_Context # A helper class for building a list of variables and values in separate diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/location_window.py b/helios/pipeViewer/pipe_view/gui/dialogs/location_window.py index 33770b77d4..52c247ef5f 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/location_window.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/location_window.py @@ -1,17 +1,17 @@ from __future__ import annotations import fnmatch -from gui.dialogs.element_propsdlg import ElementTypeSelectionDialog +from ..dialogs.element_propsdlg import ElementTypeSelectionDialog import logging import wx import wx.lib.gizmos from typing import Optional, Tuple, cast, TYPE_CHECKING -from gui.font_utils import ScaleFont +from ..font_utils import ScaleFont if TYPE_CHECKING: - from gui.dialogs.element_propsdlg import Element_PropsDlg - from gui.layout_frame import Layout_Frame - from model.location_manager import LocationTree + from ..dialogs.element_propsdlg import Element_PropsDlg + from ..layout_frame import Layout_Frame + from ...model.location_manager import LocationTree class LocationWindow(wx.Frame): diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/search_dlg.py b/helios/pipeViewer/pipe_view/gui/dialogs/search_dlg.py index 1fd996619a..8fcc8cf687 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/search_dlg.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/search_dlg.py @@ -2,12 +2,12 @@ import sys import wx from functools import partial -from gui.widgets.transaction_list import TransactionList -from gui.widgets.location_entry import LocationEntry +from ..widgets.transaction_list import TransactionList +from ..widgets.location_entry import LocationEntry from typing import List, Optional, Tuple, TypedDict, TYPE_CHECKING if TYPE_CHECKING: - from gui.layout_frame import Layout_Frame + from ..layout_frame import Layout_Frame class SearchResult(TypedDict): diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/select_layout_dlg.py b/helios/pipeViewer/pipe_view/gui/dialogs/select_layout_dlg.py index e8fe83f71b..a3ba0f4186 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/select_layout_dlg.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/select_layout_dlg.py @@ -6,7 +6,7 @@ import wx from typing import Optional -from model.layout import Layout +from ...model.layout import Layout # Dialog for selecting an Argos layout file. diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/translate_elements_dlg.py b/helios/pipeViewer/pipe_view/gui/dialogs/translate_elements_dlg.py index 1f87e2a55b..f635d9880f 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/translate_elements_dlg.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/translate_elements_dlg.py @@ -1,10 +1,10 @@ from __future__ import annotations import wx -from gui.font_utils import GetMonospaceFont +from ..font_utils import GetMonospaceFont from typing import Optional, Tuple, Union, TYPE_CHECKING if TYPE_CHECKING: - from gui.layout_frame import Layout_Frame + from ..layout_frame import Layout_Frame # TranslateElementsDlg allows relative or absolute translation of a group of diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/view_settings_dlg.py b/helios/pipeViewer/pipe_view/gui/dialogs/view_settings_dlg.py index 6632bbf5ec..cef805020e 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/view_settings_dlg.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/view_settings_dlg.py @@ -3,9 +3,9 @@ from typing import Dict, Optional, Set, TypedDict, TYPE_CHECKING import wx -from model.settings import ArgosSettings +from ...model.settings import ArgosSettings if TYPE_CHECKING: - from gui.layout_frame import Layout_Frame + from ..layout_frame import Layout_Frame class ViewSettingsDialog(wx.Dialog): diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/watchlist_dialog.py b/helios/pipeViewer/pipe_view/gui/dialogs/watchlist_dialog.py index 4b72f52ab1..c48acd54cf 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/watchlist_dialog.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/watchlist_dialog.py @@ -1,12 +1,12 @@ from __future__ import annotations import wx -from gui.widgets.transaction_list import (TransactionList, +from ..widgets.transaction_list import (TransactionList, TransactionListBaseEntry) from functools import partial from typing import List, Tuple, cast, TYPE_CHECKING if TYPE_CHECKING: - from gui.layout_frame import Layout_Frame + from .layout_frame import Layout_Frame ID_WATCH_DELETE = wx.NewId() diff --git a/helios/pipeViewer/pipe_view/gui/hover_preview.py b/helios/pipeViewer/pipe_view/gui/hover_preview.py index cbe0433bc0..52d7099e00 100644 --- a/helios/pipeViewer/pipe_view/gui/hover_preview.py +++ b/helios/pipeViewer/pipe_view/gui/hover_preview.py @@ -5,17 +5,17 @@ import wx import wx.lib.newevent -from gui.dialogs.watchlist_dialog import WatchListDlg -from gui.font_utils import GetMonospaceFont +from .dialogs.watchlist_dialog import WatchListDlg +from .font_utils import GetMonospaceFont from typing import Any, List, Optional, Tuple, cast, TYPE_CHECKING if TYPE_CHECKING: - from model.element import Element - from model.element_value import Element_Value - from model.layout_context import Layout_Context - from gui.argos_menu import Argos_Menu - from gui.layout_canvas import Layout_Canvas + from ..element import Element + from ..element_value import Element_Value + from ..layout_context import Layout_Context + from .argos_menu import Argos_Menu + from .layout_canvas import Layout_Canvas # @brief This new event triggers the canvas to just redraw the mouse-over text. # No update of the underlying view is executed on this event. diff --git a/helios/pipeViewer/pipe_view/gui/layout_canvas.py b/helios/pipeViewer/pipe_view/gui/layout_canvas.py index 5850358861..912803df77 100644 --- a/helios/pipeViewer/pipe_view/gui/layout_canvas.py +++ b/helios/pipeViewer/pipe_view/gui/layout_canvas.py @@ -12,19 +12,19 @@ from .hover_preview import HoverPreview from functools import partial from . import autocoloring -import model.highlighting_utils as highlighting_utils -from gui.font_utils import GetMonospaceFont, GetDefaultFont +from ..model import highlighting_utils +from .font_utils import GetMonospaceFont, GetDefaultFont if TYPE_CHECKING: - from gui.dialogs.element_propsdlg import Element_PropsDlg - from gui.layout_frame import Layout_Frame - from model.element import Element - from model.element_value import Element_Value - from model.layout_context import Layout_Context - from model.settings import ArgosSettings + from .dialogs.element_propsdlg import Element_PropsDlg + from .layout_frame import Layout_Frame + from ..model.element import Element + from ..model.element_value import Element_Value + from ..model.layout_context import Layout_Context + from ..model.settings import ArgosSettings try: - import core + from .. import core except ImportError as e: print('Argos failed to import module: "core". Argos requires Make', file=sys.stderr) diff --git a/helios/pipeViewer/pipe_view/gui/layout_frame.py b/helios/pipeViewer/pipe_view/gui/layout_frame.py index 4a6db15e67..085b8f6598 100644 --- a/helios/pipeViewer/pipe_view/gui/layout_frame.py +++ b/helios/pipeViewer/pipe_view/gui/layout_frame.py @@ -15,7 +15,7 @@ TYPE_CHECKING) from .layout_canvas import Layout_Canvas -from model.layout import Layout +from ..model.layout import Layout from .argos_menu import Argos_Menu from .dialogs.search_dlg import SearchDialog from .dialogs.find_element_dlg import FindElementDialog @@ -25,10 +25,10 @@ from .widgets.frame_playback_bar import FramePlaybackBar if TYPE_CHECKING: - from gui.dialogs.watchlist_dialog import WatchListDlg - from model.layout_context import Layout_Context - from model.workspace import Workspace - from model.settings import ArgosSettings + from .dialogs.watchlist_dialog import WatchListDlg + from ..model.layout_context import Layout_Context + from ..model.workspace import Workspace + from ..model.settings import ArgosSettings DialogUnion = Union[wx.Frame, wx.Dialog] diff --git a/helios/pipeViewer/pipe_view/gui/selection_manager.py b/helios/pipeViewer/pipe_view/gui/selection_manager.py index 302009fb92..39ebe6bac9 100644 --- a/helios/pipeViewer/pipe_view/gui/selection_manager.py +++ b/helios/pipeViewer/pipe_view/gui/selection_manager.py @@ -17,14 +17,14 @@ import wx -from model.element import Element -from model.layout_delta import Checkpoint +from ..model.element import Element +from ..model.layout_delta import Checkpoint if TYPE_CHECKING: - from model.element_value import Element_Value - from model.layout import Layout - from gui.dialogs.element_propsdlg import Element_PropsDlg - from gui.layout_canvas import Layout_Canvas + from ..model.element_value import Element_Value + from ..model.layout import Layout + from .dialogs.element_propsdlg import Element_PropsDlg + from .layout_canvas import Layout_Canvas # This class is responsible for keeping track of which Elements have been diff --git a/helios/pipeViewer/pipe_view/gui/widgets/element_list.py b/helios/pipeViewer/pipe_view/gui/widgets/element_list.py index 6f84774bd7..a57d61e6c8 100644 --- a/helios/pipeViewer/pipe_view/gui/widgets/element_list.py +++ b/helios/pipeViewer/pipe_view/gui/widgets/element_list.py @@ -1,11 +1,11 @@ from __future__ import annotations from typing import Any, Dict, List, Optional, Tuple, TYPE_CHECKING import wx -from gui.font_utils import GetMonospaceFont +from ..font_utils import GetMonospaceFont if TYPE_CHECKING: - from gui.layout_canvas import Layout_Canvas - from model.element import Element + from ..layout_canvas import Layout_Canvas + from ...element import Element # This class is a GUI list control element that shows elements and allows diff --git a/helios/pipeViewer/pipe_view/gui/widgets/element_property_list.py b/helios/pipeViewer/pipe_view/gui/widgets/element_property_list.py index 6b180791f4..ec6d90b030 100644 --- a/helios/pipeViewer/pipe_view/gui/widgets/element_property_list.py +++ b/helios/pipeViewer/pipe_view/gui/widgets/element_property_list.py @@ -4,10 +4,10 @@ from wx.lib.colourchooser.pycolourchooser import (ColourChangedEvent, PyColourChooser, EVT_COLOUR_CHANGED) -import model.content_options as copts -from model.schedule_element import ScheduleLineElement -from model.element import Element, LocationallyKeyedElement -from model.rpc_element import RPCElement +from ...model import content_options as copts +from ...model.schedule_element import ScheduleLineElement +from ...model.element import Element, LocationallyKeyedElement +from ...model.rpc_element import RPCElement from ast import literal_eval from functools import cmp_to_key from typing import (Dict, @@ -20,10 +20,10 @@ TYPE_CHECKING) if TYPE_CHECKING: - from gui.dialogs.element_propsdlg import Element_PropsDlg - from gui.layout_frame import Layout_Frame - from gui.selection_manager import Selection_Mgr - from model.location_manager import LocationTree + from ..dialogs.element_propsdlg import Element_PropsDlg + from ..layout_frame import Layout_Frame + from ..selection_manager import Selection_Mgr + from ...model.location_manager import LocationTree MULTIPLE_VALS_STR = '' MULTIPLE_VALS_COLOR = wx.Colour(200, 200, 100) diff --git a/helios/pipeViewer/pipe_view/gui/widgets/frame_playback_bar.py b/helios/pipeViewer/pipe_view/gui/widgets/frame_playback_bar.py index baee92470b..bd30c13ac1 100644 --- a/helios/pipeViewer/pipe_view/gui/widgets/frame_playback_bar.py +++ b/helios/pipeViewer/pipe_view/gui/widgets/frame_playback_bar.py @@ -5,12 +5,12 @@ import time from typing import Any, Optional, Tuple, Union, TYPE_CHECKING -from model.clock_manager import ClockManager -from gui.font_utils import ScaleFont +from ...model.clock_manager import ClockManager +from ..font_utils import ScaleFont if TYPE_CHECKING: - from gui.layout_frame import Layout_Frame - from model.settings import ArgosSettings + from ..layout_frame import Layout_Frame + from ...model.settings import ArgosSettings # @package frame_playback_bar.py # @brief Contains FramePlaybackBar which holds all playback controls for a diff --git a/helios/pipeViewer/pipe_view/gui/widgets/location_entry.py b/helios/pipeViewer/pipe_view/gui/widgets/location_entry.py index c8f4d57e38..42db0655e3 100644 --- a/helios/pipeViewer/pipe_view/gui/widgets/location_entry.py +++ b/helios/pipeViewer/pipe_view/gui/widgets/location_entry.py @@ -3,7 +3,7 @@ import wx -from model.location_manager import LocationTree +from ...model.location_manager import LocationTree # An Auto-suggesting Box for Entry of Location Strings diff --git a/helios/pipeViewer/pipe_view/gui/widgets/transaction_list.py b/helios/pipeViewer/pipe_view/gui/widgets/transaction_list.py index 2d58d76ed5..4ae4826732 100644 --- a/helios/pipeViewer/pipe_view/gui/widgets/transaction_list.py +++ b/helios/pipeViewer/pipe_view/gui/widgets/transaction_list.py @@ -1,11 +1,11 @@ from __future__ import annotations from typing import Any, Dict, List, Tuple, Union, TYPE_CHECKING import wx -from gui.font_utils import GetMonospaceFont +from ..font_utils import GetMonospaceFont if TYPE_CHECKING: - from gui.layout_canvas import Layout_Canvas - from gui.dialogs.search_dlg import SearchResult + from ..layout_canvas import Layout_Canvas + from ..dialogs.search_dlg import SearchResult TransactionListBaseEntry = Dict[str, Any] TransactionListEntry = Union['SearchResult', TransactionListBaseEntry] diff --git a/helios/pipeViewer/pipe_view/core/src/log_search.cpp b/helios/pipeViewer/pipe_view/logsearch/src/log_search.cpp similarity index 100% rename from helios/pipeViewer/pipe_view/core/src/log_search.cpp rename to helios/pipeViewer/pipe_view/logsearch/src/log_search.cpp diff --git a/helios/pipeViewer/pipe_view/core/src/logsearch.pyx b/helios/pipeViewer/pipe_view/logsearch/src/logsearch.pyx similarity index 100% rename from helios/pipeViewer/pipe_view/core/src/logsearch.pyx rename to helios/pipeViewer/pipe_view/logsearch/src/logsearch.pyx diff --git a/helios/pipeViewer/pipe_view/misc/version.py b/helios/pipeViewer/pipe_view/misc/version.py index da45d57599..04fd7d3be1 100644 --- a/helios/pipeViewer/pipe_view/misc/version.py +++ b/helios/pipeViewer/pipe_view/misc/version.py @@ -2,7 +2,7 @@ # @brief Argos version finder from __future__ import annotations -import core # Argos core +from .. import core # Argos core # Attempts to determine the version of this argos by its .VERSION file diff --git a/helios/pipeViewer/pipe_view/model/database.py b/helios/pipeViewer/pipe_view/model/database.py index 0eae41773a..1ca684a796 100644 --- a/helios/pipeViewer/pipe_view/model/database.py +++ b/helios/pipeViewer/pipe_view/model/database.py @@ -12,36 +12,11 @@ from .location_manager import LocationManager from .clock_manager import ClockManager -# Import Argos transaction database module from SPARTA -__MODULE_ENV_VAR_NAME = 'TRANSACTIONDB_MODULE_DIR' -env_var = os.environ.get(__MODULE_ENV_VAR_NAME) -if env_var is None: - # Try to find the transaction module in the Helios release dir - added_path = os.path.dirname(__file__) + \ - "/../../../../release/helios/pipeViewer/transactiondb/lib" - added_path = os.path.abspath(added_path) - if not os.path.isdir(added_path): - error('Argos cannot find the transactiondb directory: %s', added_path) - sys.exit(1) -else: - added_path = os.environ.get(__MODULE_ENV_VAR_NAME, os.getcwd()) - -sys.path.insert(0, added_path) # Add temporary search path try: - import transactiondb - + from .. import transactiondb except ImportError as e: error('Argos failed to import module: "transactiondb"') - error(f'The search paths (sys.path) were: {", ".join(sys.path)}') - error('Please export the environment variable %s to contain the absolute ' - 'path of the directory wherein the SPARTA transactiondb module can ' - 'be found. Currently is "%s"', - __MODULE_ENV_VAR_NAME, - added_path) - error('Exception: %s', e) - sys.exit(1) -finally: - sys.path.remove(added_path) # Remove temporary path + raise e # Inform users which transactiondb interface they are getting info('Using transactiondb at "%s"', transactiondb.__file__) diff --git a/helios/pipeViewer/pipe_view/model/element.py b/helios/pipeViewer/pipe_view/model/element.py index 2fab15b8d1..5a3c5f9f2c 100644 --- a/helios/pipeViewer/pipe_view/model/element.py +++ b/helios/pipeViewer/pipe_view/model/element.py @@ -25,14 +25,14 @@ import wx # Another view-side import since elements here have rendering code embedded. -import gui.autocoloring +from ..gui import autocoloring -from logsearch import LogSearch # Argos module for searching logfiles +from ..logsearch import LogSearch # Argos module for searching logfiles if TYPE_CHECKING: from .layout import Layout from .element_value import Element_Value - from gui.layout_canvas import Layout_Canvas + from ..gui.layout_canvas import Layout_Canvas T = TypeVar('T') PropertyValue = Optional[Union[str, diff --git a/helios/pipeViewer/pipe_view/model/group.py b/helios/pipeViewer/pipe_view/model/group.py index 305159288c..2dd86402f7 100644 --- a/helios/pipeViewer/pipe_view/model/group.py +++ b/helios/pipeViewer/pipe_view/model/group.py @@ -3,7 +3,7 @@ from typing import List, Optional import weakref -from model.layout_context import Layout_Context +from .layout_context import Layout_Context class Group: diff --git a/helios/pipeViewer/pipe_view/model/layout.py b/helios/pipeViewer/pipe_view/model/layout.py index c1cd7d17e6..db04f3f10d 100644 --- a/helios/pipeViewer/pipe_view/model/layout.py +++ b/helios/pipeViewer/pipe_view/model/layout.py @@ -8,12 +8,12 @@ import pickle from typing import Any, Dict, List, Optional, TextIO, cast, TYPE_CHECKING -import model.element_types as etypes +from .import element_types as etypes if TYPE_CHECKING: - from model.element import Element, MultiElement, PropertyDict - from model.layout_context import Layout_Context - from model.workspace import Workspace + from .element import Element, MultiElement, PropertyDict + from .layout_context import Layout_Context + from .workspace import Workspace # The reason this application exists, Layouts allow users to group together diff --git a/helios/pipeViewer/pipe_view/model/layout_context.py b/helios/pipeViewer/pipe_view/model/layout_context.py index 636abf970c..1003c52ca4 100644 --- a/helios/pipeViewer/pipe_view/model/layout_context.py +++ b/helios/pipeViewer/pipe_view/model/layout_context.py @@ -20,18 +20,18 @@ from .search_handle import SearchHandle from .element import Element, FakeElement from .extension_manager import ExtensionManager -from model.location_manager import LocationManager, LocationType -import model.content_options as content -import model.highlighting_utils as highlighting_utils +from .location_manager import LocationManager, LocationType +from . import content_options as content +from . import highlighting_utils as highlighting_utils if TYPE_CHECKING: - from gui.layout_frame import Layout_Frame - from gui.dialogs.search_dlg import SearchResult - from model.database import Database, TransactionDatabase - from model.element_value import Element_Value - from model.group import Group - from model.schedule_element import ScheduleLineElement, ScheduleElement + from ..gui.layout_frame import Layout_Frame + from ..gui.dialogs.search_dlg import SearchResult + from .database import Database, TransactionDatabase + from .element_value import Element_Value + from .group import Group + from .schedule_element import ScheduleLineElement, ScheduleElement class Layout_Context: diff --git a/helios/pipeViewer/pipe_view/model/layout_delta.py b/helios/pipeViewer/pipe_view/model/layout_delta.py index 1f9ccc0415..c47fd4b7ba 100644 --- a/helios/pipeViewer/pipe_view/model/layout_delta.py +++ b/helios/pipeViewer/pipe_view/model/layout_delta.py @@ -4,10 +4,10 @@ import sys from typing import List, Tuple, cast, TYPE_CHECKING -from model.element import Element, MultiElement +from .element import Element, MultiElement if TYPE_CHECKING: - from model.layout import Layout + from .layout import Layout # Represents a checkpoint between two layouts. diff --git a/helios/pipeViewer/pipe_view/model/quad_tree.py b/helios/pipeViewer/pipe_view/model/quad_tree.py index 5b398a75b2..d3430df591 100644 --- a/helios/pipeViewer/pipe_view/model/quad_tree.py +++ b/helios/pipeViewer/pipe_view/model/quad_tree.py @@ -1,7 +1,7 @@ from __future__ import annotations from typing import Dict, List, Optional, Set, Tuple -from model.element_value import Element_Value +from .element_value import Element_Value class QuadNode: diff --git a/helios/pipeViewer/pipe_view/model/query_set.py b/helios/pipeViewer/pipe_view/model/query_set.py index 0b0f2b6650..d374e9fd57 100644 --- a/helios/pipeViewer/pipe_view/model/query_set.py +++ b/helios/pipeViewer/pipe_view/model/query_set.py @@ -6,13 +6,13 @@ from typing import Dict, List, Optional, Tuple, cast, TYPE_CHECKING from . import content_options as content -from model.schedule_element import ScheduleLineElement +from .schedule_element import ScheduleLineElement if TYPE_CHECKING: - from model.element_value import Element_Value - from model.database import TransactionDatabase - from model.layout_context import Layout_Context - from model.location_manager import LocationType + from .element_value import Element_Value + from .database import TransactionDatabase + from .layout_context import Layout_Context + from .location_manager import LocationType TOffDict = Dict[int, Dict[int, List[Element_Value]]] diff --git a/helios/pipeViewer/pipe_view/model/search_handle.py b/helios/pipeViewer/pipe_view/model/search_handle.py index 8155d05600..b14ba8249b 100644 --- a/helios/pipeViewer/pipe_view/model/search_handle.py +++ b/helios/pipeViewer/pipe_view/model/search_handle.py @@ -5,13 +5,15 @@ import subprocess from logging import error from typing import Callable, List, Optional, Tuple, TYPE_CHECKING +import shutil if TYPE_CHECKING: - from model.layout_context import Layout_Context + from .layout_context import Layout_Context __SEARCH_PROGRAM_ENV_VAR_NAME = 'TRANSACTIONSEARCH_PROGRAM' TRANSACTION_SEARCH_PROGRAM = os.environ.get(__SEARCH_PROGRAM_ENV_VAR_NAME, - os.getcwd()) + shutil.which("transactionsearch")) +print("INFO: looking for ", TRANSACTION_SEARCH_PROGRAM) can_search = False if os.path.isfile(TRANSACTION_SEARCH_PROGRAM): diff --git a/helios/pipeViewer/pipe_view/model/settings.py b/helios/pipeViewer/pipe_view/model/settings.py index 182eae9c29..bc26b7ee5a 100644 --- a/helios/pipeViewer/pipe_view/model/settings.py +++ b/helios/pipeViewer/pipe_view/model/settings.py @@ -3,8 +3,8 @@ import os import sys from typing import Any, Dict -from gui.autocoloring import BrushRepository -from gui.font_utils import GetDefaultFontSize, GetDefaultControlFontSize +from ..gui.autocoloring import BrushRepository +from ..gui.font_utils import GetDefaultFontSize, GetDefaultControlFontSize # Stores settings in a JSON file in the user's config directory so that they diff --git a/helios/pipeViewer/pipe_view/model/workspace.py b/helios/pipeViewer/pipe_view/model/workspace.py index f13802cf39..ed2e7be7d9 100644 --- a/helios/pipeViewer/pipe_view/model/workspace.py +++ b/helios/pipeViewer/pipe_view/model/workspace.py @@ -11,13 +11,13 @@ from . import group from .layout import Layout -from model.layout_context import Layout_Context -from gui.layout_frame import Layout_Frame -import gui.autocoloring +from .layout_context import Layout_Context +from ..gui.layout_frame import Layout_Frame +from ..gui import autocoloring if TYPE_CHECKING: - from model.database import Database - from model.settings import ArgosSettings + from .database import Database + from .settings import ArgosSettings # Responsible for managing Databases, LayoutContexts & and @@ -123,7 +123,7 @@ def SetPalette(self, palette: str) -> None: self.__settings.palette = palette # The autocoloring module is global, so we can set the mode once and # then update all of the canvas brushes - gui.autocoloring.SetPalettes(palette) + autocoloring.SetPalettes(palette) for f in self.__frames: frame = f() if frame is not None: @@ -134,7 +134,7 @@ def SetColorShuffleState(self, state: str) -> None: self.__settings.palette_shuffle = state # The autocoloring module is global, so we can set the mode once and # then update all of the canvas brushes - gui.autocoloring.SetShuffleModes(state) + autocoloring.SetShuffleModes(state) for f in self.__frames: frame = f() if frame is not None: diff --git a/helios/pipeViewer/transactiondb/src/.gitignore b/helios/pipeViewer/pipe_view/transactiondb/src/.gitignore similarity index 100% rename from helios/pipeViewer/transactiondb/src/.gitignore rename to helios/pipeViewer/pipe_view/transactiondb/src/.gitignore diff --git a/helios/pipeViewer/transactiondb/src/PipelineDataCallback.hpp b/helios/pipeViewer/pipe_view/transactiondb/src/PipelineDataCallback.hpp similarity index 100% rename from helios/pipeViewer/transactiondb/src/PipelineDataCallback.hpp rename to helios/pipeViewer/pipe_view/transactiondb/src/PipelineDataCallback.hpp diff --git a/helios/pipeViewer/transactiondb/src/Reader.hpp b/helios/pipeViewer/pipe_view/transactiondb/src/Reader.hpp similarity index 100% rename from helios/pipeViewer/transactiondb/src/Reader.hpp rename to helios/pipeViewer/pipe_view/transactiondb/src/Reader.hpp diff --git a/helios/pipeViewer/transactiondb/src/SimpleOutputInterface.hpp b/helios/pipeViewer/pipe_view/transactiondb/src/SimpleOutputInterface.hpp similarity index 100% rename from helios/pipeViewer/transactiondb/src/SimpleOutputInterface.hpp rename to helios/pipeViewer/pipe_view/transactiondb/src/SimpleOutputInterface.hpp diff --git a/helios/pipeViewer/transactiondb/src/TransactionDatabaseInterface.hpp b/helios/pipeViewer/pipe_view/transactiondb/src/TransactionDatabaseInterface.hpp similarity index 100% rename from helios/pipeViewer/transactiondb/src/TransactionDatabaseInterface.hpp rename to helios/pipeViewer/pipe_view/transactiondb/src/TransactionDatabaseInterface.hpp diff --git a/helios/pipeViewer/transactiondb/src/TransactionInterval.hpp b/helios/pipeViewer/pipe_view/transactiondb/src/TransactionInterval.hpp similarity index 100% rename from helios/pipeViewer/transactiondb/src/TransactionInterval.hpp rename to helios/pipeViewer/pipe_view/transactiondb/src/TransactionInterval.hpp diff --git a/helios/pipeViewer/transactiondb/src/common.pxd b/helios/pipeViewer/pipe_view/transactiondb/src/common.pxd similarity index 100% rename from helios/pipeViewer/transactiondb/src/common.pxd rename to helios/pipeViewer/pipe_view/transactiondb/src/common.pxd diff --git a/helios/pipeViewer/transactiondb/src/helpers.hpp b/helios/pipeViewer/pipe_view/transactiondb/src/helpers.hpp similarity index 100% rename from helios/pipeViewer/transactiondb/src/helpers.hpp rename to helios/pipeViewer/pipe_view/transactiondb/src/helpers.hpp diff --git a/helios/pipeViewer/transactiondb/src/transactiondb.pyx b/helios/pipeViewer/pipe_view/transactiondb/src/transactiondb.pyx similarity index 100% rename from helios/pipeViewer/transactiondb/src/transactiondb.pyx rename to helios/pipeViewer/pipe_view/transactiondb/src/transactiondb.pyx diff --git a/helios/pipeViewer/setup.py b/helios/pipeViewer/setup.py index d88c41fe6f..8e85030e27 100644 --- a/helios/pipeViewer/setup.py +++ b/helios/pipeViewer/setup.py @@ -1,8 +1,8 @@ import setuptools +from setuptools import find_packages from Cython.Build import cythonize from Cython.Distutils import build_ext - compile_args = ['--std=c++17'] # Required for SPARTA # override strict flags compile_args += [ @@ -18,24 +18,55 @@ transaction_db = setuptools.Extension( 'pipe_view.transactiondb', language='c++', - sources=['transactiondb/src/transactiondb.pyx'], + sources=['pipe_view/transactiondb/src/transactiondb.pyx'], libraries=["sparta", "simdb", "hdf5", "sqlite3"], pyrex_gdb = True, extra_compile_args = compile_args, ) -ext_modules = [transaction_db] +core = setuptools.Extension( + 'pipe_view.core', + language='c++', + sources=['pipe_view/core/src/core.pyx'], + libraries=["sparta", "simdb", "hdf5", "sqlite3"], + pyrex_gdb = True, + extra_compile_args = compile_args, +) +logsearch = setuptools.Extension( + 'pipe_view.logsearch', + language='c++', + sources=['pipe_view/logsearch/src/logsearch.pyx', 'pipe_view/logsearch/src/log_search.cpp'], + libraries=["sparta", "simdb", "hdf5", "sqlite3"], + pyrex_gdb = True, + extra_compile_args = compile_args, +) +ext_modules = [transaction_db, core, logsearch] + +py_packages = ["pipe_view", "pipe_view.misc", "pipe_view.gui", + "pipe_view.gui.dialogs", "pipe_view.gui.widgets", + "pipe_view.model", ] +cy_packages = ['pipe_view.core', 'pipe_view.transactiondb', 'pipe_view.logsearch', ] setuptools.setup( - packages=['pipe_view'], - ext_modules = cythonize(ext_modules, language_level=3), + packages=py_packages, + ext_modules = cythonize(ext_modules, language_level=3, + include_path=['pipe_view/core/src'], # to find common.pxd + ), + entry_points = { + 'console_scripts': ['argos=pipe_view.argos:main'], + }, + package_data={'pipe_view': ['core/src/common.pxd', 'transactiondb/src/common.pxd', 'resources/*.png', 'stubs/*.pyi']}, #package_dir={'': 'src'}, # package_data={ # 'foo': ['foo_ext.pxd', 'c_foo.pxd'] # }, include_package_data=True, setup_requires=[ - 'cython' + 'cython', + 'wxPython', + ], + install_requires=[ + 'wxPython', ], tests_require=['pytest'], zip_safe=False, diff --git a/helios/pipeViewer/transactiondb/CMakeLists.txt b/helios/pipeViewer/transactiondb/CMakeLists.txt deleted file mode 100644 index 143acac393..0000000000 --- a/helios/pipeViewer/transactiondb/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -cmake_minimum_required(VERSION 3.15) - -project(transactiondb) - -set(TRANSACTIONDB_SRC_DIR ${PROJECT_SOURCE_DIR}/src) -get_property(YAML_CPP_INCLUDE_DIR TARGET yaml-cpp PROPERTY INTERFACE_INCLUDE_DIRECTORIES) -################################################################## -# Build the transactiondb.so -################################################################## -# FIXME use consistent cmake recipe for python extensions here and in .. -add_custom_command(OUTPUT transactiondb.sh - COMMAND printf 'SYSINCDIRS="${YAML_CPP_INCLUDE_DIR}" - PY_SRC_DIR="${CMAKE_CURRENT_SOURCE_DIR}/src" - SPARTA_BASE="${SPARTA_BASE}" - TARGETDIR="lib" - BUILD_MODULES="transactiondb" - REQUIRED_SPARTA_LIBS="sparta simdb hdf5 sqlite3" - HDF5_LIBS="${HDF5_LIBRARIES}" - LIB_SPARTA_BUILT_PATH="${MAP_BINARY_DIR}/sparta ${MAP_BINARY_DIR}/sparta/simdb" - CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" - CC="${CMAKE_C_COMPILER}" - CXX="${CMAKE_CXX_COMPILER}" - LD="${CMAKE_LINKER}" - ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py build_ext --inplace;' > transactiondb.sh && chmod +x transactiondb.sh - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/setup.py) - -add_custom_target (transactiondb_sh_driver ALL DEPENDS transactiondb.sh) -add_dependencies(transactiondb_sh_driver sparta) - -add_custom_command(OUTPUT lib/transactiondb.so - COMMAND ./transactiondb.sh - DEPENDS - transactiondb.sh) - -add_custom_target (transactiondb_driver ALL DEPENDS - lib/transactiondb.so - ${TRANSACTIONDB_SRC_DIR}/common.pxd - ${TRANSACTIONDB_SRC_DIR}/transactiondb.pyx - ${CMAKE_CURRENT_SOURCE_DIR}/setup.py - ${TRANSACTIONDB_SRC_DIR}/Reader.hpp - ${TRANSACTIONDB_SRC_DIR}/TransactionDatabaseInterface.hpp) -add_dependencies(transactiondb_driver sparta) - -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/ TYPE LIB) diff --git a/helios/pipeViewer/transactiondb/setup.py b/helios/pipeViewer/transactiondb/setup.py deleted file mode 100644 index fa5671f17d..0000000000 --- a/helios/pipeViewer/transactiondb/setup.py +++ /dev/null @@ -1,154 +0,0 @@ -#!/bin/env python3 - -# # @package Setup file for transactiondb Python modules -# @note This must support being run in parallel with itself given a different -# build target. - -import subprocess -import sys -import os -import glob -import time -from os.path import dirname, join - -# Force use of a different Cython -cython_dir = os.environ.get('CYTHON_DIR', None) -if cython_dir: - print('CYTHON_DIR overridden with "{0}"'.format(cython_dir)) - sys.path.insert(0, cython_dir) - -import Cython -from Cython.Build import cythonize -print('Using CYTHON: {0} : {1}'.format(Cython.__path__, Cython.__version__)) - -from distutils import sysconfig, spawn -from distutils.sysconfig import get_config_vars # for static lib dir -from distutils.core import setup -from Cython.Distutils.extension import Extension -from Cython.Distutils import build_ext - -# Environment Setup -plat_flags = os.environ.get('SIM_PLATFLAGS', "-m64") -if 'TARGETDIR' not in os.environ: - print("must set TARGETDIR in env, not currently set") - sys.exit(1) -destination_dir = os.environ["TARGETDIR"] -system_include_dirs = [a.strip('\\') for a in os.environ.get("SYSINCDIRS", None).split()] - -sparta_base_dir = os.environ["SPARTA_BASE"] -required_sparta_libs = os.environ['REQUIRED_SPARTA_LIBS'].split() -required_sparta_libs = [x.lstrip('-l').strip('\\') for x in required_sparta_libs] -sparta_inc_dir = sparta_base_dir -selected_modules = os.environ.get("BUILD_MODULES", "").split() -py_src_dir = os.environ["PY_SRC_DIR"] - -print('\n\nDEST DIR "{}"'.format(destination_dir)) - -sparta_lib_path = os.environ['LIB_SPARTA_BUILT_PATH'].split() -sparta_lib_path = [x.lstrip('-L').strip('\\') for x in sparta_lib_path] -print(sparta_lib_path, required_sparta_libs) - -hdf5_lib_dirs = os.environ['HDF5_LIBS'].split() -hdf5_lib_dirs = list(set([os.path.dirname(x) for x in hdf5_lib_dirs])) -print(hdf5_lib_dirs) - -compile_args = ['-std=c++17'] # Required for sparta C++ code -if plat_flags != '': - compile_args.extend(plat_flags.split()) -def_macros = [] -link_args = ['-g3'] - -build_type = os.environ.get("CMAKE_BUILD_TYPE", "Release") -if(build_type == 'Debug'): - print('Building in DEBUG mode') - compile_args.extend(('-g3', '-O0')) -else: - print('Building in Release mode') - def_macros.append(('NDEBUG', None)) - compile_args.extend(('-g3', '-Ofast')) - -# conda python sysconfig data contains '-Wl,export_dynamic' which the linker isn't using -# causes a warning that gets treated like an error, let's not care about unused linker args -# for right now -#compile_args.extend(('-Wno-unused-command-line-argument',)) - -if os.environ.get('VERBOSE'): - compile_args.extend(['-v']) - link_args.extend([ '-v' ]) - -# All Modules which can be built -PYTHON_STATIC_LIBS = get_config_vars()['LIBDIR'] -MODULES = {'transactiondb' : ('transactiondb.pyx',), - 'argosdboutputter' : ('argosdboutputter.pyx',), - } - -# Select a subset of the modules to build based on command-line options -if selected_modules: - modules = {} - for k in MODULES: - if k in selected_modules: - modules[k] = MODULES[k] - if not modules: - print('BUILD_MODULES was specified, but none of them were modules that ' \ - 'this script knows how to build: {0}'.format(selected_modules), file = sys.stderr) - sys.exit(1) -else: - modules = MODULES - -if not os.path.exists(destination_dir): - try: - print('Making directory "{0}"'.format(destination_dir)) - os.makedirs(destination_dir) - except FileExistsError: - # if building in parallel then this is a race condition - # just ignore it, they're all trying to do the same thing - pass - -# Build each module -for module_name, source_files in modules.items(): - - out_file = module_name + '.so' - - # Source Files - sources = [os.path.join(py_src_dir, source_file) for source_file in source_files] - - ext_def = Extension(module_name, - sources = sources, - include_dirs = [sparta_inc_dir ] + system_include_dirs, - libraries = required_sparta_libs, - library_dirs = sparta_lib_path + hdf5_lib_dirs, - define_macros = def_macros, - extra_compile_args = compile_args, - extra_link_args = link_args, - #cython_directives = {'language_level': 3}, - language = "c++", - pyrex_gdb = True, # Build in - ) - - # Build - sysconfig.get_config_vars()['CC'] = 'clang' - sysconfig.get_config_vars()['CC'] = 'clang++' - setup( - cmdclass = {'build_ext': build_ext}, - ext_modules = cythonize([ext_def], - compiler_directives = {"language_level" : "3"}) - ) - - # Move built files - # TODO seems to be a race condition where this file is sometimes not there - for _ in range(25): - time.sleep(1) - out_file = glob.glob(f"{module_name}.*.so") - if out_file: - print(f"Breaking: found {out_file}") - break - if out_file: - out_file = out_file[0] - else: - print(f"Could not find {module_name} to copy, exiting") - sys.exit(-1) - moduleName = f"{module_name}.so" - print(f'Moving built module "{out_file}" to directory "{destination_dir}"') - os.rename(out_file, os.path.join(destination_dir, out_file)) - -print(f'Successfully built {len(modules)} python extension modules') diff --git a/helios/pipeViewer/transactionsearch/CMakeLists.txt b/helios/pipeViewer/transactionsearch/CMakeLists.txt index fdb8aae677..2d46a7eeb1 100644 --- a/helios/pipeViewer/transactionsearch/CMakeLists.txt +++ b/helios/pipeViewer/transactionsearch/CMakeLists.txt @@ -1,8 +1,11 @@ -project(TransactionSearch) +project(TransactionSearch CXX) + +set (CMAKE_CXX_STANDARD 17) +set (CMAKE_CXX_STANDARD_REQUIRED ON) add_executable(transactionsearch src/transaction_search.cpp) -target_include_directories(transactionsearch PRIVATE ${CMAKE_SOURCE_DIR}/helios/pipeViewer) +target_include_directories(transactionsearch PRIVATE ${CMAKE_SOURCE_DIR}/helios/pipeViewer/pipe_view) target_link_libraries(transactionsearch ${Sparta_LIBS}) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/transactionsearch TYPE BIN) +install(TARGETS transactionsearch RUNTIME) diff --git a/helios/pipeViewer/wxPythonInclude.py b/helios/pipeViewer/wxPythonInclude.py new file mode 100644 index 0000000000..97203052fb --- /dev/null +++ b/helios/pipeViewer/wxPythonInclude.py @@ -0,0 +1,12 @@ +# Small util to print the include path for wxPython + +import pkgutil +import os.path +from _frozen_importlib_external import SourceFileLoader + +wx_pkg = pkgutil.get_loader('wx') +if wx_pkg is None: + raise RuntimeError("wx python library is not installed!") +assert isinstance(wx_pkg, SourceFileLoader) + +print(os.path.join(os.path.dirname(wx_pkg.get_filename()), 'include')) From 645d82e0563de8428a3327a41b87068b29d9029b Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Mon, 20 Feb 2023 18:05:27 -0600 Subject: [PATCH 23/48] Fixed static method calls w/o object --- helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py b/helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py index 81179e4ba4..d380ff1366 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py @@ -16,7 +16,7 @@ def is_mac_os() -> bool: return os in [wx.OS_MAC_OS, wx.OS_MAC_OSX_DARWIN, wx.OS_MAC] __SHIFT_KEY = 'Shift' - __CTRL_KEY = 'Command' if is_mac_os() else 'CTRL' + __CTRL_KEY = 'Command' if is_mac_os.__get__(object) else 'CTRL' ShortcutHelpDict = Dict[str, Tuple[ShortcutHelpEntry, ...]] __SHORTCUT_ITEMS: ShortcutHelpDict = { @@ -100,7 +100,7 @@ def __gen_message(shortcut_items: ShortcutHelpDict) -> str: msg += '' return msg - __MESSAGE = __gen_message(__SHORTCUT_ITEMS) + __MESSAGE = __gen_message.__func__(__SHORTCUT_ITEMS) def __init__(self, parent: wx.Window, id: int) -> None: wx.Frame.__init__( From 6e706ace8119698fb9c038d8f71efdad7e31c863 Mon Sep 17 00:00:00 2001 From: Brett Dutro Date: Mon, 20 Feb 2023 18:25:57 -0600 Subject: [PATCH 24/48] Move __is_mac_os and __gen_message outside of the ShortcutHelp class --- .../pipe_view/gui/dialogs/shortcut_help.py | 70 ++++++++++--------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py b/helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py index d380ff1366..c215bffe13 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py @@ -9,16 +9,44 @@ class ShortcutHelpEntry(TypedDict, total=False): desc: str -class ShortcutHelp(wx.Frame): - @staticmethod - def is_mac_os() -> bool: - os = wx.GetOsVersion()[0] - return os in [wx.OS_MAC_OS, wx.OS_MAC_OSX_DARWIN, wx.OS_MAC] +ShortcutHelpDict = Dict[str, Tuple[ShortcutHelpEntry, ...]] + + +def __is_mac_os() -> bool: + os = wx.GetOsVersion()[0] + return os in [wx.OS_MAC_OS, wx.OS_MAC_OSX_DARWIN, wx.OS_MAC] + + +def __gen_message(shortcut_items: ShortcutHelpDict) -> str: + msg = '\n\n

Argos Keyboard Shortcuts

\n' + + for k, v in shortcut_items.items(): + msg += f'

{k}

\n
    \n' + for item in v: + keys = item['keys'] + desc = item['desc'] + mod = item.get('mod') + + if mod is not None: + if isinstance(keys, tuple): + keys = tuple(f'{mod}+{k}' for k in keys) + else: + keys = f'{mod}+{keys}' + + if isinstance(keys, tuple): + keys = ' or '.join(keys) + + msg += f'
  • {keys}: {desc}
  • \n' + msg += '
\n' + msg += '' + return msg + + +class ShortcutHelp(wx.Frame): __SHIFT_KEY = 'Shift' - __CTRL_KEY = 'Command' if is_mac_os.__get__(object) else 'CTRL' + __CTRL_KEY = 'Command' if __is_mac_os() else 'CTRL' - ShortcutHelpDict = Dict[str, Tuple[ShortcutHelpEntry, ...]] __SHORTCUT_ITEMS: ShortcutHelpDict = { 'Global': ( {'mod': __CTRL_KEY, @@ -74,33 +102,7 @@ def is_mac_os() -> bool: ) } - @staticmethod - def __gen_message(shortcut_items: ShortcutHelpDict) -> str: - msg = '\n\n

Argos Keyboard Shortcuts

\n' - - for k, v in shortcut_items.items(): - msg += f'

{k}

\n
    \n' - for item in v: - keys = item['keys'] - desc = item['desc'] - mod = item.get('mod') - - if mod is not None: - if isinstance(keys, tuple): - keys = tuple(f'{mod}+{k}' for k in keys) - else: - keys = f'{mod}+{keys}' - - if isinstance(keys, tuple): - keys = ' or '.join(keys) - - msg += f'
  • {keys}: {desc}
  • \n' - msg += '
\n' - - msg += '' - return msg - - __MESSAGE = __gen_message.__func__(__SHORTCUT_ITEMS) + __MESSAGE = __gen_message(__SHORTCUT_ITEMS) def __init__(self, parent: wx.Window, id: int) -> None: wx.Frame.__init__( From 81b1b99397ed94e090f838903daf11d70cba2639 Mon Sep 17 00:00:00 2001 From: Brett Dutro Date: Mon, 20 Feb 2023 18:29:54 -0600 Subject: [PATCH 25/48] Clean up flake8 errors --- helios/pipeViewer/pipe_view/argos.py | 4 +++- .../pipeViewer/pipe_view/gui/dialogs/watchlist_dialog.py | 2 +- helios/pipeViewer/pipe_view/model/database.py | 2 -- helios/pipeViewer/pipe_view/model/element.py | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/helios/pipeViewer/pipe_view/argos.py b/helios/pipeViewer/pipe_view/argos.py index 43a5c00241..a44fb14122 100755 --- a/helios/pipeViewer/pipe_view/argos.py +++ b/helios/pipeViewer/pipe_view/argos.py @@ -38,7 +38,7 @@ from pipe_view.gui import autocoloring # noqa: E402 from pipe_view.gui.dialogs.select_db_dlg import SelectDatabaseDlg # noqa: E402 -from pipe_view.gui.dialogs.select_layout_dlg import SelectLayoutDlg # noqa: E402 +from pipe_view.gui.dialogs.select_layout_dlg import SelectLayoutDlg # noqa: E402, E501 from pipe_view.model.database import Database # noqa: E402 from pipe_view.model.settings import ArgosSettings # noqa: E402 from pipe_view.model.utilities import LogFormatter # noqa: E402 @@ -46,6 +46,7 @@ # End Argos imports + def main(): rc = 0 @@ -462,5 +463,6 @@ def replace(match: re.Match[str]) -> str: ws.Cleanup() sys.exit(rc) + if __name__ == '__main__': main() diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/watchlist_dialog.py b/helios/pipeViewer/pipe_view/gui/dialogs/watchlist_dialog.py index c48acd54cf..21c6a786f0 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/watchlist_dialog.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/watchlist_dialog.py @@ -1,7 +1,7 @@ from __future__ import annotations import wx from ..widgets.transaction_list import (TransactionList, - TransactionListBaseEntry) + TransactionListBaseEntry) from functools import partial from typing import List, Tuple, cast, TYPE_CHECKING diff --git a/helios/pipeViewer/pipe_view/model/database.py b/helios/pipeViewer/pipe_view/model/database.py index 1ca684a796..b7ab5bf2fc 100644 --- a/helios/pipeViewer/pipe_view/model/database.py +++ b/helios/pipeViewer/pipe_view/model/database.py @@ -2,8 +2,6 @@ # @brief Consumes argos database files based on prefix from __future__ import annotations -import os -import sys import logging from logging import info, error from types import ModuleType diff --git a/helios/pipeViewer/pipe_view/model/element.py b/helios/pipeViewer/pipe_view/model/element.py index 5a3c5f9f2c..58f3e83e67 100644 --- a/helios/pipeViewer/pipe_view/model/element.py +++ b/helios/pipeViewer/pipe_view/model/element.py @@ -1022,14 +1022,14 @@ def DrawRoutine(self, color = self.__def_background_color else: try: - idx = int(col_str) % len(gui.autocoloring.BACKGROUND_BRUSHES) # noqa: E501 + idx = int(col_str) % len(autocoloring.BACKGROUND_BRUSHES) # noqa: E501 except ValueError: try: - idx = int(col_str, 16) % len(gui.autocoloring.BACKGROUND_BRUSHES) # noqa: E501 + idx = int(col_str, 16) % len(autocoloring.BACKGROUND_BRUSHES) # noqa: E501 except ValueError: - idx = hash(col_str) % len(gui.autocoloring.BACKGROUND_BRUSHES) # noqa: E501 + idx = hash(col_str) % len(autocoloring.BACKGROUND_BRUSHES) # noqa: E501 - color = gui.autocoloring.BACKGROUND_BRUSHES[idx].GetColour() # noqa: E501 + color = autocoloring.BACKGROUND_BRUSHES[idx].GetColour() # noqa: E501 # Determine Content if sub_pat_str == '': # Do no replacement From fa74476bbc5de3c5e18773cc2cf7437cfe65e6bb Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Tue, 21 Feb 2023 08:09:53 +0100 Subject: [PATCH 26/48] make sure setuptools and cython use the right C/CXX/LD --- helios/pipeViewer/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helios/pipeViewer/CMakeLists.txt b/helios/pipeViewer/CMakeLists.txt index db998e95c0..9c5e09e044 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -57,7 +57,7 @@ message(WARNING " " ${PYTHON_LDFLAGS}) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cython.stamp - COMMAND ${CMAKE_COMMAND} -E env CFLAGS=${PYTHON_CFLAGS} LDFLAGS=${PYTHON_LDFLAGS} ${Python3_EXECUTABLE} setup.py build_ext --inplace VERBATIM + COMMAND ${CMAKE_COMMAND} -E env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} LD=${CMAKE_LINKER} CFLAGS=${PYTHON_CFLAGS} LDFLAGS=${PYTHON_LDFLAGS} ${Python3_EXECUTABLE} setup.py build_ext --inplace VERBATIM COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/cython.stamp WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS From 133686c0bd51a28e3e49455d5da91b9634471cbb Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Tue, 21 Feb 2023 08:27:40 +0100 Subject: [PATCH 27/48] proper dependencies for setup.py --- helios/pipeViewer/CMakeLists.txt | 54 ++++++++++---------------------- helios/pipeViewer/setup.py | 6 ---- 2 files changed, 17 insertions(+), 43 deletions(-) diff --git a/helios/pipeViewer/CMakeLists.txt b/helios/pipeViewer/CMakeLists.txt index 9c5e09e044..f7b9de18a1 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -61,13 +61,22 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/cython.stamp WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS - # ${CMAKE_CURRENT_SOURCE_DIR}/extras/python-bindings/setup.py - # ${CMAKE_CURRENT_SOURCE_DIR}/extras/python-bindings/setup.cfg - # ${CMAKE_CURRENT_SOURCE_DIR}/extras/python-bindings/src/foo/__init__.py - # ${CMAKE_CURRENT_SOURCE_DIR}/extras/python-bindings/src/foo/c_foo.pxd - # ${CMAKE_CURRENT_SOURCE_DIR}/extras/python-bindings/src/foo/foo_ext.pxd - # ${CMAKE_CURRENT_SOURCE_DIR}/extras/python-bindings/src/foo/foo_ext.pyx - sparta simdb + ${CMAKE_CURRENT_SOURCE_DIR}/setup.py + ${CMAKE_CURRENT_SOURCE_DIR}/setup.cfg + ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/src/common.pxd + ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/src/core.pyx + ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/src/helpers.h + ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/logsearch/src/log_search.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/logsearch/src/logsearch.pyx + ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/transactiondb/src/PipelineDataCallback.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/transactiondb/src/Reader.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/transactiondb/src/SimpleOutputInterface.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/transactiondb/src/TransactionDatabaseInterface.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/transactiondb/src/TransactionInterval.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/transactiondb/src/helpers.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/transactiondb/src/common.pxd + ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/transactiondb/src/transactiondb.pyx + sparta simdb ${CMAKE_CURRENT_SOURCE_DIR}/setup.cfg COMMENT "Building pipeViwer and its depenencies" ) @@ -81,34 +90,5 @@ install(CODE WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})" ) -#find_package (Python3 3.7 REQUIRED COMPONENTS Interpreter Development) -# -#set (CMAKE_CXX_STANDARD 17) -#set (CMAKE_CXX_STANDARD_REQUIRED ON) -# -#if(NOT ${Python3_FOUND}) -# message(WARNING "Cmake could not find python3, trying to fall back on system default python3") -# find_program(Python3_EXECUTABLE 'python3') -#endif() -# -# Point find_package to the right parts of the source and build tree -#set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/sparta/cmake ${CMAKE_MODULE_PATH}) -#include_directories(${SPARTA_BASE} ${SPARTA_BASE}/simdb/include ./) -#include(${CMAKE_SOURCE_DIR}/sparta/cmake/sparta-config.cmake) -# -#set(SETUP_PY "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/setup.py") -# -#set(PY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/core.so.built") -# -#add_custom_command(OUTPUT "${PY_OUTPUT}" -# COMMAND ${CMAKE_COMMAND} -E env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} LD=${CMAKE_LINKER} TARGETDIR=${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core -- ${Python3_EXECUTABLE} ${SETUP_PY} build_ext --inplace -# COMMAND ${CMAKE_COMMAND} -E touch ${PY_OUTPUT} -# DEPENDS ${SETUP_PY} "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/src/core.pyx" -# ) -#add_custom_target(pipe_view_py ALL DEPENDS "${PY_OUTPUT}") -## -#add_subdirectory(transactiondb) -#add_subdirectory(transactionsearch) +# TODO: do we need to build argos_dumper? #add_subdirectory(argos_dumper) -# -#install(DIRECTORY pipe_view/ DESTINATION pipe_view PATTERN "__pycache__" EXCLUDE) diff --git a/helios/pipeViewer/setup.py b/helios/pipeViewer/setup.py index 8e85030e27..e2dffa4636 100644 --- a/helios/pipeViewer/setup.py +++ b/helios/pipeViewer/setup.py @@ -14,7 +14,6 @@ ] # Wrappers for the parts written in Cython -# Transaction DB transaction_db = setuptools.Extension( 'pipe_view.transactiondb', language='c++', @@ -45,7 +44,6 @@ py_packages = ["pipe_view", "pipe_view.misc", "pipe_view.gui", "pipe_view.gui.dialogs", "pipe_view.gui.widgets", "pipe_view.model", ] -cy_packages = ['pipe_view.core', 'pipe_view.transactiondb', 'pipe_view.logsearch', ] setuptools.setup( packages=py_packages, @@ -56,10 +54,6 @@ 'console_scripts': ['argos=pipe_view.argos:main'], }, package_data={'pipe_view': ['core/src/common.pxd', 'transactiondb/src/common.pxd', 'resources/*.png', 'stubs/*.pyi']}, - #package_dir={'': 'src'}, -# package_data={ -# 'foo': ['foo_ext.pxd', 'c_foo.pxd'] -# }, include_package_data=True, setup_requires=[ 'cython', From 98eff34be59c1af777d4da6e80d2c9e6d1ddb720 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Tue, 21 Feb 2023 09:56:45 +0100 Subject: [PATCH 28/48] gui script vs console script: should properly call pythonw --- helios/pipeViewer/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helios/pipeViewer/setup.py b/helios/pipeViewer/setup.py index e2dffa4636..92081e184e 100644 --- a/helios/pipeViewer/setup.py +++ b/helios/pipeViewer/setup.py @@ -51,7 +51,7 @@ include_path=['pipe_view/core/src'], # to find common.pxd ), entry_points = { - 'console_scripts': ['argos=pipe_view.argos:main'], + 'gui_scripts': ['argos=pipe_view.argos:main'], }, package_data={'pipe_view': ['core/src/common.pxd', 'transactiondb/src/common.pxd', 'resources/*.png', 'stubs/*.pyi']}, include_package_data=True, From 7d94d80c22920441340d0dcc51f06eb795d48529 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Tue, 21 Feb 2023 10:18:42 +0100 Subject: [PATCH 29/48] build argos_dumper again --- helios/pipeViewer/CMakeLists.txt | 5 +---- helios/pipeViewer/argos_dumper/CMakeLists.txt | 4 ++++ helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt | 6 +++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/helios/pipeViewer/CMakeLists.txt b/helios/pipeViewer/CMakeLists.txt index f7b9de18a1..a5d0c1cce3 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -51,9 +51,7 @@ library_dirs=$ foreach(def IN LISTS wxWidgets_DEFINITIONS) string(APPEND PYTHON_CFLAGS "-D${def} ") endforeach() -message(WARNING " " ${wxWidgets_LIBRARIES}) string(JOIN " " PYTHON_LDFLAGS ${wxWidgets_LIBRARIES}) -message(WARNING " " ${PYTHON_LDFLAGS}) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cython.stamp @@ -90,5 +88,4 @@ install(CODE WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})" ) -# TODO: do we need to build argos_dumper? -#add_subdirectory(argos_dumper) +add_subdirectory(argos_dumper) diff --git a/helios/pipeViewer/argos_dumper/CMakeLists.txt b/helios/pipeViewer/argos_dumper/CMakeLists.txt index 87dcc4151b..e92bf107ff 100644 --- a/helios/pipeViewer/argos_dumper/CMakeLists.txt +++ b/helios/pipeViewer/argos_dumper/CMakeLists.txt @@ -1,11 +1,15 @@ project(Argos_dumper) +set (CMAKE_CXX_STANDARD 17) +set (CMAKE_CXX_STANDARD_REQUIRED ON) + # Enable testing enable_testing () add_executable(Argos_dumper ArgosCollection_test.cpp) add_test (NAME Argos_dumper_RUN COMMAND Argos_dumper) +target_include_directories(Argos_dumper PRIVATE ${CMAKE_SOURCE_DIR}/helios/pipeViewer/pipe_view) target_link_libraries (Argos_dumper ${Sparta_LIBS}) add_subdirectory(DatabaseDump) diff --git a/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt b/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt index 3ded10c7ce..213bd3df69 100644 --- a/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt +++ b/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt @@ -1,7 +1,11 @@ project(Argosdumper) + +set (CMAKE_CXX_STANDARD 17) +set (CMAKE_CXX_STANDARD_REQUIRED ON) + add_executable(ArgosDumper Database_dumper.cpp) -target_include_directories(ArgosDumper PRIVATE ${CMAKE_SOURCE_DIR}/helios/pipeViewer) +target_include_directories(ArgosDumper PRIVATE ${CMAKE_SOURCE_DIR}/helios/pipeViewer/pipe_view) target_link_libraries (ArgosDumper ${Sparta_LIBS}) add_test (NAME ArgosDumperSmokeTestingDB COMMAND ArgosDumper db_pipeout/pipeout) From 0230f8665112eda3457964a3726c1db723d9ea7e Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Tue, 21 Feb 2023 10:46:09 +0100 Subject: [PATCH 30/48] _ vs __ otherwise cannot find the free helper functions in the class --- helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py b/helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py index c215bffe13..d6fecf691a 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py @@ -12,12 +12,12 @@ class ShortcutHelpEntry(TypedDict, total=False): ShortcutHelpDict = Dict[str, Tuple[ShortcutHelpEntry, ...]] -def __is_mac_os() -> bool: +def _is_mac_os() -> bool: os = wx.GetOsVersion()[0] return os in [wx.OS_MAC_OS, wx.OS_MAC_OSX_DARWIN, wx.OS_MAC] -def __gen_message(shortcut_items: ShortcutHelpDict) -> str: +def _gen_message(shortcut_items: ShortcutHelpDict) -> str: msg = '\n\n

Argos Keyboard Shortcuts

\n' for k, v in shortcut_items.items(): @@ -45,7 +45,7 @@ def __gen_message(shortcut_items: ShortcutHelpDict) -> str: class ShortcutHelp(wx.Frame): __SHIFT_KEY = 'Shift' - __CTRL_KEY = 'Command' if __is_mac_os() else 'CTRL' + __CTRL_KEY = 'Command' if _is_mac_os() else 'CTRL' __SHORTCUT_ITEMS: ShortcutHelpDict = { 'Global': ( @@ -102,7 +102,7 @@ class ShortcutHelp(wx.Frame): ) } - __MESSAGE = __gen_message(__SHORTCUT_ITEMS) + __MESSAGE = _gen_message(__SHORTCUT_ITEMS) def __init__(self, parent: wx.Window, id: int) -> None: wx.Frame.__init__( From 4af184f6ce2f8812959c7bfe3aa92b06d36d8f39 Mon Sep 17 00:00:00 2001 From: Brett Dutro Date: Tue, 21 Feb 2023 11:13:25 -0600 Subject: [PATCH 31/48] Move sparta library target towards the end of sparta/CMakeLists.txt so it picks up all of the compile/link flags Bump required Boost version down to 1.74 so we can build on default Ubuntu environment --- sparta/CMakeLists.txt | 12 ++++++------ sparta/cmake/sparta-config.cmake | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sparta/CMakeLists.txt b/sparta/CMakeLists.txt index de77d9dff2..6bcff49cea 100644 --- a/sparta/CMakeLists.txt +++ b/sparta/CMakeLists.txt @@ -88,12 +88,6 @@ if (COMPILE_WITH_PYTHON) python/sparta_support/Completer.cpp) endif () -add_library (sparta ${SourceCppFiles}) - -# Add local includes -target_include_directories (sparta PUBLIC "./") -target_include_directories (sparta PUBLIC "simdb/include") - execute_process (COMMAND bash "-c" "git describe --tags --always" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE GIT_REPO_VERSION RESULT_VARIABLE rc @@ -207,6 +201,12 @@ set (CPPCHECK_EXCLUDES ) find_package (Cppcheck) +add_library (sparta ${SourceCppFiles}) + +# Add local includes +target_include_directories (sparta PUBLIC "./") +target_include_directories (sparta PUBLIC "simdb/include") + set (SPARTA_STATIC_LIBS ${PROJECT_BINARY_DIR}/libsparta.a) # Build the SimDB library diff --git a/sparta/cmake/sparta-config.cmake b/sparta/cmake/sparta-config.cmake index d4feb5bbf3..5ebd23ba92 100644 --- a/sparta/cmake/sparta-config.cmake +++ b/sparta/cmake/sparta-config.cmake @@ -40,7 +40,7 @@ endif () # Find Boost set (Boost_USE_STATIC_LIBS OFF) -find_package (Boost 1.76.0 REQUIRED COMPONENTS ${_BOOST_COMPONENTS}) +find_package (Boost 1.74.0 REQUIRED COMPONENTS ${_BOOST_COMPONENTS}) include_directories (SYSTEM ${Boost_INCLUDE_DIRS}) message (STATUS "Using BOOST ${Boost_VERSION_STRING}") From fd4490df4ac2b957f5827631997c0e69e17fa074 Mon Sep 17 00:00:00 2001 From: Brett Dutro Date: Tue, 21 Feb 2023 11:37:52 -0600 Subject: [PATCH 32/48] Pass CMAKE_INSTALL_PREFIX to setup.py install - Enables installing package to a non-default directory --- helios/pipeViewer/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helios/pipeViewer/CMakeLists.txt b/helios/pipeViewer/CMakeLists.txt index a5d0c1cce3..a4828564fe 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -27,7 +27,7 @@ endif() list(APPEND _INC_DIRS "$" ${WX_PYTHON_INC} ${wxWidgets_INCLUDE_DIRS}) # Populate list of library dirs: -# Set up the include and link dirs for python's setuptools using setup.cfg file +# Set up the include and link dirs for python's setuptools using setup.cfg file # HDF5: need to extract dirs from paths to libs foreach(lib IN LISTS HDF5_LIBRARIES) get_filename_component(d ${lib} DIRECTORY) @@ -76,7 +76,7 @@ add_custom_command( ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/transactiondb/src/transactiondb.pyx sparta simdb ${CMAKE_CURRENT_SOURCE_DIR}/setup.cfg - COMMENT "Building pipeViwer and its depenencies" + COMMENT "Building pipeViwer and its dependencies" ) add_custom_target(pipeView ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/cython.stamp) @@ -84,7 +84,7 @@ add_subdirectory(transactionsearch) install(CODE "execute_process( - COMMAND ${Python3_EXECUTABLE} setup.py install + COMMAND ${Python3_EXECUTABLE} setup.py install --prefix ${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})" ) From e86ec7c80c252eede29051ebaa106519af5854dd Mon Sep 17 00:00:00 2001 From: Brett Dutro Date: Tue, 21 Feb 2023 15:17:54 -0600 Subject: [PATCH 33/48] Add Github workflow to run linters on Argos Reorganize mypy stubs and .ini locations to work with relative imports in Argos Use pip instead of (deprecated) setup.py install to install Argos - Also properly handle non-default install prefix --- .github/workflows/argos_lint.yml | 45 +++++++++++++++++++ helios/pipeViewer/.gitignore | 4 ++ helios/pipeViewer/CMakeLists.txt | 2 +- helios/pipeViewer/{pipe_view => }/mypy.ini | 0 helios/pipeViewer/pipe_view/.gitignore | 1 + helios/pipeViewer/pipe_view/argos.py | 2 +- helios/pipeViewer/pipe_view/core/.gitignore | 4 -- .../{stubs/core.pyi => core/__init__.pyi} | 6 +-- .../pipe_view/gui/dialogs/console_dialog.py | 2 +- .../pipe_view/gui/dialogs/watchlist_dialog.py | 2 +- .../pipeViewer/pipe_view/gui/hover_preview.py | 6 +-- .../pipeViewer/pipe_view/gui/input_decoder.py | 10 ++--- .../pipe_view/gui/widgets/element_list.py | 2 +- .../pipeViewer/pipe_view/logsearch/.gitignore | 1 + .../logsearch.pyi => logsearch/__init__.pyi} | 0 .../pipe_view/model/content_options.py | 6 +-- .../pipeViewer/pipe_view/model/element_set.py | 6 +-- .../pipeViewer/pipe_view/model/rpc_element.py | 2 +- .../pipe_view/model/schedule_element.py | 2 +- .../pipe_view/model/search_handle.py | 5 ++- .../pipe_view/model/speedo_element.py | 8 ++-- .../pipe_view/model/widget_element.py | 6 +-- .../pipe_view/transactiondb/.gitignore | 1 + .../__init__.pyi} | 0 .../pipe_view/transactiondb/src/.gitignore | 2 - helios/pipeViewer/setup.py | 1 + .../{pipe_view => }/stubs/wx/__init__.pyi | 0 .../{pipe_view => }/stubs/wx/html.pyi | 0 28 files changed, 88 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/argos_lint.yml create mode 100644 helios/pipeViewer/.gitignore rename helios/pipeViewer/{pipe_view => }/mypy.ini (100%) rename helios/pipeViewer/pipe_view/{stubs/core.pyi => core/__init__.pyi} (92%) create mode 100644 helios/pipeViewer/pipe_view/logsearch/.gitignore rename helios/pipeViewer/pipe_view/{stubs/logsearch.pyi => logsearch/__init__.pyi} (100%) create mode 100644 helios/pipeViewer/pipe_view/transactiondb/.gitignore rename helios/pipeViewer/pipe_view/{stubs/transactiondb.pyi => transactiondb/__init__.pyi} (100%) delete mode 100644 helios/pipeViewer/pipe_view/transactiondb/src/.gitignore rename helios/pipeViewer/{pipe_view => }/stubs/wx/__init__.pyi (100%) rename helios/pipeViewer/{pipe_view => }/stubs/wx/html.pyi (100%) diff --git a/.github/workflows/argos_lint.yml b/.github/workflows/argos_lint.yml new file mode 100644 index 0000000000..76db1440b9 --- /dev/null +++ b/.github/workflows/argos_lint.yml @@ -0,0 +1,45 @@ +name: Argos Linters + +on: + # Trigger the workflow on push or pull request, + # but only for the main branch + push: + branches: + - master + pull_request: + branches: + - master + +defaults: + run: + working-directory: helios/pipeViewer + +jobs: + build: + name: pylint + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11"] + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install mypy numpy flake8 + + - name: Running mypy + run: | + mypy --install-types --non-interactive pipe_view/argos.py + + - name: Running flake8 + run: | + flake8 $(git ls-files 'pipe_view/*.py') diff --git a/helios/pipeViewer/.gitignore b/helios/pipeViewer/.gitignore new file mode 100644 index 0000000000..76578b146d --- /dev/null +++ b/helios/pipeViewer/.gitignore @@ -0,0 +1,4 @@ +build/ +dist/ +pipe_view.egg-info/ +setup.cfg diff --git a/helios/pipeViewer/CMakeLists.txt b/helios/pipeViewer/CMakeLists.txt index a4828564fe..773f006cc3 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -84,7 +84,7 @@ add_subdirectory(transactionsearch) install(CODE "execute_process( - COMMAND ${Python3_EXECUTABLE} setup.py install --prefix ${CMAKE_INSTALL_PREFIX} + COMMAND ${CMAKE_COMMAND} -E env PYTHONUSERBASE=${CMAKE_INSTALL_PREFIX} ${Python3_EXECUTABLE} -m pip install . WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})" ) diff --git a/helios/pipeViewer/pipe_view/mypy.ini b/helios/pipeViewer/mypy.ini similarity index 100% rename from helios/pipeViewer/pipe_view/mypy.ini rename to helios/pipeViewer/mypy.ini diff --git a/helios/pipeViewer/pipe_view/.gitignore b/helios/pipeViewer/pipe_view/.gitignore index 8e695ec83a..d66f281012 100644 --- a/helios/pipeViewer/pipe_view/.gitignore +++ b/helios/pipeViewer/pipe_view/.gitignore @@ -1 +1,2 @@ doc +*.so diff --git a/helios/pipeViewer/pipe_view/argos.py b/helios/pipeViewer/pipe_view/argos.py index a44fb14122..9cfedddf83 100755 --- a/helios/pipeViewer/pipe_view/argos.py +++ b/helios/pipeViewer/pipe_view/argos.py @@ -47,7 +47,7 @@ # End Argos imports -def main(): +def main() -> None: rc = 0 logging.getLogger().setLevel(logging.INFO) diff --git a/helios/pipeViewer/pipe_view/core/.gitignore b/helios/pipeViewer/pipe_view/core/.gitignore index bfa56e6e32..2a15923b50 100644 --- a/helios/pipeViewer/pipe_view/core/.gitignore +++ b/helios/pipeViewer/pipe_view/core/.gitignore @@ -1,5 +1 @@ -bld-Linux_x86_64-gcc6.3 -bld-Linux_x86_64-gcc4.7 -/src/logsearch.cpp /src/core.cpp -/*.so diff --git a/helios/pipeViewer/pipe_view/stubs/core.pyi b/helios/pipeViewer/pipe_view/core/__init__.pyi similarity index 92% rename from helios/pipeViewer/pipe_view/stubs/core.pyi rename to helios/pipeViewer/pipe_view/core/__init__.pyi index f53867ba74..1fe1792182 100644 --- a/helios/pipeViewer/pipe_view/stubs/core.pyi +++ b/helios/pipeViewer/pipe_view/core/__init__.pyi @@ -4,9 +4,9 @@ from typing import Dict, Optional, Tuple, Union import wx -from gui.layout_canvas import Layout_Canvas -from model.element import Element -from model.extension_manager import ExtensionManager +from ..gui.layout_canvas import Layout_Canvas +from ..model.element import Element +from ..model.extension_manager import ExtensionManager EXPR_NAMESPACE: dict debug: function diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/console_dialog.py b/helios/pipeViewer/pipe_view/gui/dialogs/console_dialog.py index f5a709d11d..0cf8579fce 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/console_dialog.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/console_dialog.py @@ -5,7 +5,7 @@ from wx.py.shell import Shell if TYPE_CHECKING: - from gui.layout_frame import Layout_Frame + from ..layout_frame import Layout_Frame # This class displays a python console diff --git a/helios/pipeViewer/pipe_view/gui/dialogs/watchlist_dialog.py b/helios/pipeViewer/pipe_view/gui/dialogs/watchlist_dialog.py index 21c6a786f0..6bb483b068 100644 --- a/helios/pipeViewer/pipe_view/gui/dialogs/watchlist_dialog.py +++ b/helios/pipeViewer/pipe_view/gui/dialogs/watchlist_dialog.py @@ -6,7 +6,7 @@ from typing import List, Tuple, cast, TYPE_CHECKING if TYPE_CHECKING: - from .layout_frame import Layout_Frame + from ..layout_frame import Layout_Frame ID_WATCH_DELETE = wx.NewId() diff --git a/helios/pipeViewer/pipe_view/gui/hover_preview.py b/helios/pipeViewer/pipe_view/gui/hover_preview.py index ec1e4ccb15..9244e58a1d 100644 --- a/helios/pipeViewer/pipe_view/gui/hover_preview.py +++ b/helios/pipeViewer/pipe_view/gui/hover_preview.py @@ -11,9 +11,9 @@ from typing import Any, List, Optional, Tuple, cast, TYPE_CHECKING if TYPE_CHECKING: - from ..element import Element - from ..element_value import Element_Value - from ..layout_context import Layout_Context + from ..model.element import Element + from ..model.element_value import Element_Value + from ..model.layout_context import Layout_Context from .argos_menu import Argos_Menu from .layout_canvas import Layout_Canvas diff --git a/helios/pipeViewer/pipe_view/gui/input_decoder.py b/helios/pipeViewer/pipe_view/gui/input_decoder.py index 699779ee74..3203da36c7 100644 --- a/helios/pipeViewer/pipe_view/gui/input_decoder.py +++ b/helios/pipeViewer/pipe_view/gui/input_decoder.py @@ -6,11 +6,11 @@ if TYPE_CHECKING: from wx.lib.dragscroller import DragScroller - from gui.dialogs.element_propsdlg import Element_PropsDlg - from gui.hover_preview import HoverPreview - from gui.layout_canvas import Layout_Canvas - from gui.selection_manager import Selection_Mgr - from model.layout_context import Layout_Context + from .dialogs.element_propsdlg import Element_PropsDlg + from .hover_preview import HoverPreview + from .layout_canvas import Layout_Canvas + from .selection_manager import Selection_Mgr + from ..model.layout_context import Layout_Context # This class provides a central hub of intelligence for responding to diff --git a/helios/pipeViewer/pipe_view/gui/widgets/element_list.py b/helios/pipeViewer/pipe_view/gui/widgets/element_list.py index a57d61e6c8..3ab6e4c022 100644 --- a/helios/pipeViewer/pipe_view/gui/widgets/element_list.py +++ b/helios/pipeViewer/pipe_view/gui/widgets/element_list.py @@ -5,7 +5,7 @@ if TYPE_CHECKING: from ..layout_canvas import Layout_Canvas - from ...element import Element + from ...model.element import Element # This class is a GUI list control element that shows elements and allows diff --git a/helios/pipeViewer/pipe_view/logsearch/.gitignore b/helios/pipeViewer/pipe_view/logsearch/.gitignore new file mode 100644 index 0000000000..b798b4762a --- /dev/null +++ b/helios/pipeViewer/pipe_view/logsearch/.gitignore @@ -0,0 +1 @@ +/src/logsearch.cpp diff --git a/helios/pipeViewer/pipe_view/stubs/logsearch.pyi b/helios/pipeViewer/pipe_view/logsearch/__init__.pyi similarity index 100% rename from helios/pipeViewer/pipe_view/stubs/logsearch.pyi rename to helios/pipeViewer/pipe_view/logsearch/__init__.pyi diff --git a/helios/pipeViewer/pipe_view/model/content_options.py b/helios/pipeViewer/pipe_view/model/content_options.py index 88b2d32e0b..bd33540990 100644 --- a/helios/pipeViewer/pipe_view/model/content_options.py +++ b/helios/pipeViewer/pipe_view/model/content_options.py @@ -15,9 +15,9 @@ TYPE_CHECKING) if TYPE_CHECKING: - from model.database import Transaction - from model.database_handle import DatabaseHandle - from model.element import Element + from .database import Transaction + from .database_handle import DatabaseHandle + from .element import Element TRANSACTION_TYPES = ['Annotation', 'Instruction', 'MemoryOp'] diff --git a/helios/pipeViewer/pipe_view/model/element_set.py b/helios/pipeViewer/pipe_view/model/element_set.py index 87291079b3..93b73cd26c 100644 --- a/helios/pipeViewer/pipe_view/model/element_set.py +++ b/helios/pipeViewer/pipe_view/model/element_set.py @@ -6,9 +6,9 @@ from typing import Callable, Dict, List, Optional, Tuple, cast, TYPE_CHECKING if TYPE_CHECKING: - from model.element import Element - from model.extension_manager import ExtensionManager - from model.layout_context import Layout_Context + from .element import Element + from .extension_manager import ExtensionManager + from .layout_context import Layout_Context # ElementSet stores all elements in a LayoutContext and bins them by time diff --git a/helios/pipeViewer/pipe_view/model/rpc_element.py b/helios/pipeViewer/pipe_view/model/rpc_element.py index 8df941002a..9f34a14efa 100644 --- a/helios/pipeViewer/pipe_view/model/rpc_element.py +++ b/helios/pipeViewer/pipe_view/model/rpc_element.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: from .element_value import Element_Value from .extension_manager import ExtensionManager - from gui.layout_canvas import Layout_Canvas + from ..gui.layout_canvas import Layout_Canvas from .element import PropertyValue, ValidatedPropertyDict diff --git a/helios/pipeViewer/pipe_view/model/schedule_element.py b/helios/pipeViewer/pipe_view/model/schedule_element.py index e431e5b110..f71b218775 100644 --- a/helios/pipeViewer/pipe_view/model/schedule_element.py +++ b/helios/pipeViewer/pipe_view/model/schedule_element.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: from .clock_manager import ClockManager - from gui.layout_canvas import Layout_Canvas + from ..gui.layout_canvas import Layout_Canvas # Global module members for commonly used brushes/pens so that they only need # to be created once diff --git a/helios/pipeViewer/pipe_view/model/search_handle.py b/helios/pipeViewer/pipe_view/model/search_handle.py index b14ba8249b..5336465ee7 100644 --- a/helios/pipeViewer/pipe_view/model/search_handle.py +++ b/helios/pipeViewer/pipe_view/model/search_handle.py @@ -16,7 +16,7 @@ print("INFO: looking for ", TRANSACTION_SEARCH_PROGRAM) can_search = False -if os.path.isfile(TRANSACTION_SEARCH_PROGRAM): +if TRANSACTION_SEARCH_PROGRAM and os.path.isfile(TRANSACTION_SEARCH_PROGRAM): can_search = True else: # keep looking if not explicitly stated @@ -88,6 +88,9 @@ def Search(self, 'You cannot search.' ) results: List[Tuple[int, int, int, str]] = [] + + assert TRANSACTION_SEARCH_PROGRAM is not None + arglist = [TRANSACTION_SEARCH_PROGRAM, self.__db.filename, query_type, diff --git a/helios/pipeViewer/pipe_view/model/speedo_element.py b/helios/pipeViewer/pipe_view/model/speedo_element.py index 5ae3a2b626..53c243362d 100644 --- a/helios/pipeViewer/pipe_view/model/speedo_element.py +++ b/helios/pipeViewer/pipe_view/model/speedo_element.py @@ -17,10 +17,10 @@ cast) if TYPE_CHECKING: - from model.element import (PropertyValue, - ValidatedPropertyDict) - from model.element_value import Element_Value - from gui.layout_canvas import Layout_Canvas + from .element import (PropertyValue, + ValidatedPropertyDict) + from .element_value import Element_Value + from ..gui.layout_canvas import Layout_Canvas class SpeedoWidget(wx.Control): diff --git a/helios/pipeViewer/pipe_view/model/widget_element.py b/helios/pipeViewer/pipe_view/model/widget_element.py index e707c0d750..549d1681a7 100644 --- a/helios/pipeViewer/pipe_view/model/widget_element.py +++ b/helios/pipeViewer/pipe_view/model/widget_element.py @@ -6,9 +6,9 @@ from typing import Any, Callable, Optional, Tuple, Union, cast, TYPE_CHECKING if TYPE_CHECKING: - from model.element_value import Element_Value - from model.element import PropertyValue - from gui.layout_canvas import Layout_Canvas + from .element_value import Element_Value + from .element import PropertyValue + from ..gui.layout_canvas import Layout_Canvas class WidgetElement(LocationallyKeyedElement): diff --git a/helios/pipeViewer/pipe_view/transactiondb/.gitignore b/helios/pipeViewer/pipe_view/transactiondb/.gitignore new file mode 100644 index 0000000000..2f7d835b9a --- /dev/null +++ b/helios/pipeViewer/pipe_view/transactiondb/.gitignore @@ -0,0 +1 @@ +/src/transactiondb.cpp diff --git a/helios/pipeViewer/pipe_view/stubs/transactiondb.pyi b/helios/pipeViewer/pipe_view/transactiondb/__init__.pyi similarity index 100% rename from helios/pipeViewer/pipe_view/stubs/transactiondb.pyi rename to helios/pipeViewer/pipe_view/transactiondb/__init__.pyi diff --git a/helios/pipeViewer/pipe_view/transactiondb/src/.gitignore b/helios/pipeViewer/pipe_view/transactiondb/src/.gitignore deleted file mode 100644 index 559b543d7a..0000000000 --- a/helios/pipeViewer/pipe_view/transactiondb/src/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# cython generated file -/transactiondb.cpp diff --git a/helios/pipeViewer/setup.py b/helios/pipeViewer/setup.py index 92081e184e..cd01234327 100644 --- a/helios/pipeViewer/setup.py +++ b/helios/pipeViewer/setup.py @@ -46,6 +46,7 @@ "pipe_view.model", ] setuptools.setup( + name='pipe_view', packages=py_packages, ext_modules = cythonize(ext_modules, language_level=3, include_path=['pipe_view/core/src'], # to find common.pxd diff --git a/helios/pipeViewer/pipe_view/stubs/wx/__init__.pyi b/helios/pipeViewer/stubs/wx/__init__.pyi similarity index 100% rename from helios/pipeViewer/pipe_view/stubs/wx/__init__.pyi rename to helios/pipeViewer/stubs/wx/__init__.pyi diff --git a/helios/pipeViewer/pipe_view/stubs/wx/html.pyi b/helios/pipeViewer/stubs/wx/html.pyi similarity index 100% rename from helios/pipeViewer/pipe_view/stubs/wx/html.pyi rename to helios/pipeViewer/stubs/wx/html.pyi From 373f7f9e5375127656ef6dec7830089b5d0926e1 Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Fri, 24 Feb 2023 14:37:05 -0600 Subject: [PATCH 34/48] Set a a CMAKE_MACRO file path for the testers; allows sparta build anywhere --- sparta/CMakeLists.txt | 1 + sparta/simdb/test/CoreDatabase/CMakeLists.txt | 2 +- sparta/simdb/test/HDF5Database/CMakeLists.txt | 2 +- sparta/simdb/test/SQLiteDatabase/CMakeLists.txt | 2 +- sparta/simdb/test/SharedDB/CMakeLists.txt | 2 +- sparta/simdb/test/Thread/CMakeLists.txt | 2 +- sparta/simdb/test/Thread/StandaloneCpp1/CMakeLists.txt | 2 +- sparta/simdb/test/Utils/CMakeLists.txt | 2 +- sparta/test/Array/CMakeLists.txt | 2 +- sparta/test/Audience/CMakeLists.txt | 2 +- sparta/test/BasicHistogram/CMakeLists.txt | 2 +- sparta/test/BitArray/CMakeLists.txt | 2 +- sparta/test/BoundedValue/CMakeLists.txt | 2 +- sparta/test/Buffer/CMakeLists.txt | 2 +- sparta/test/Bus/CMakeLists.txt | 2 +- sparta/test/CMakeLists.txt | 2 +- sparta/test/CircularBuffer/CMakeLists.txt | 2 +- sparta/test/Clock/CMakeLists.txt | 2 +- sparta/test/Collection/CMakeLists.txt | 2 +- sparta/test/Color/CMakeLists.txt | 2 +- sparta/test/CommandLineSimulator/CMakeLists.txt | 2 +- sparta/test/ContextCounter/CMakeLists.txt | 2 +- sparta/test/Counter/CMakeLists.txt | 2 +- sparta/test/CycleHistogram/CMakeLists.txt | 2 +- sparta/test/DAG/CMakeLists.txt | 2 +- 25 files changed, 25 insertions(+), 24 deletions(-) diff --git a/sparta/CMakeLists.txt b/sparta/CMakeLists.txt index 6bcff49cea..8eff179d3e 100644 --- a/sparta/CMakeLists.txt +++ b/sparta/CMakeLists.txt @@ -208,6 +208,7 @@ target_include_directories (sparta PUBLIC "./") target_include_directories (sparta PUBLIC "simdb/include") set (SPARTA_STATIC_LIBS ${PROJECT_BINARY_DIR}/libsparta.a) +set (SPARTA_CMAKE_MACRO_PATH ${SPARTA_BASE}/cmake) # Build the SimDB library add_subdirectory (simdb) diff --git a/sparta/simdb/test/CoreDatabase/CMakeLists.txt b/sparta/simdb/test/CoreDatabase/CMakeLists.txt index 8647ac500b..11aac6180a 100644 --- a/sparta/simdb/test/CoreDatabase/CMakeLists.txt +++ b/sparta/simdb/test/CoreDatabase/CMakeLists.txt @@ -1,7 +1,7 @@ project(SIMDB_CoreDatabase_test) add_executable(SIMDB_CoreDatabase_test CoreDatabase_test.cpp) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SimdbTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SimdbTestingMacros.cmake) simdb_recursive_copy(SIMDB_CoreDatabase_test test_dbs) diff --git a/sparta/simdb/test/HDF5Database/CMakeLists.txt b/sparta/simdb/test/HDF5Database/CMakeLists.txt index 871242e82d..d50885c88e 100644 --- a/sparta/simdb/test/HDF5Database/CMakeLists.txt +++ b/sparta/simdb/test/HDF5Database/CMakeLists.txt @@ -2,7 +2,7 @@ project(SIMDB_HDF5Database_test) add_executable(SIMDB_HDF5Database_test HDF5Database_test.cpp) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SimdbTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SimdbTestingMacros.cmake) simdb_recursive_copy(SIMDB_HDF5Database_test test_dbs) diff --git a/sparta/simdb/test/SQLiteDatabase/CMakeLists.txt b/sparta/simdb/test/SQLiteDatabase/CMakeLists.txt index 4c21ede1f4..f0783e999d 100644 --- a/sparta/simdb/test/SQLiteDatabase/CMakeLists.txt +++ b/sparta/simdb/test/SQLiteDatabase/CMakeLists.txt @@ -2,7 +2,7 @@ project(SIMDB_SQLiteDatabase_test) add_executable(SIMDB_SQLiteDatabase_test SQLiteDatabase_test.cpp) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SimdbTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SimdbTestingMacros.cmake) simdb_recursive_copy(SIMDB_SQLiteDatabase_test test_dbs) diff --git a/sparta/simdb/test/SharedDB/CMakeLists.txt b/sparta/simdb/test/SharedDB/CMakeLists.txt index 923c5bf7c7..78b615ae5e 100644 --- a/sparta/simdb/test/SharedDB/CMakeLists.txt +++ b/sparta/simdb/test/SharedDB/CMakeLists.txt @@ -2,7 +2,7 @@ project(SIMDB_SharedDB_test) add_executable(SIMDB_SharedDB_test SharedDB_test.cpp) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SimdbTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SimdbTestingMacros.cmake) simdb_recursive_copy(SIMDB_SharedDB_test test_dbs) diff --git a/sparta/simdb/test/Thread/CMakeLists.txt b/sparta/simdb/test/Thread/CMakeLists.txt index dc7eec9171..36c5353821 100644 --- a/sparta/simdb/test/Thread/CMakeLists.txt +++ b/sparta/simdb/test/Thread/CMakeLists.txt @@ -2,7 +2,7 @@ project(SIMDB_Thread_test) add_executable(SIMDB_Thread_test Thread_test.cpp) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SimdbTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SimdbTestingMacros.cmake) simdb_test(SIMDB_Thread_test SIMDB_Thread_test_RUN) diff --git a/sparta/simdb/test/Thread/StandaloneCpp1/CMakeLists.txt b/sparta/simdb/test/Thread/StandaloneCpp1/CMakeLists.txt index 13ca6f7b83..1bf00eb3cc 100644 --- a/sparta/simdb/test/Thread/StandaloneCpp1/CMakeLists.txt +++ b/sparta/simdb/test/Thread/StandaloneCpp1/CMakeLists.txt @@ -2,6 +2,6 @@ project(SIMDB_StandaloneThread_test) add_executable(SIMDB_StandaloneThread_test1 StandaloneThread_test1.cpp) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SimdbTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SimdbTestingMacros.cmake) simdb_test(SIMDB_StandaloneThread_test1 SIMDB_StandaloneThread_test1_RUN) diff --git a/sparta/simdb/test/Utils/CMakeLists.txt b/sparta/simdb/test/Utils/CMakeLists.txt index 749e91dfb5..ceccdeabba 100644 --- a/sparta/simdb/test/Utils/CMakeLists.txt +++ b/sparta/simdb/test/Utils/CMakeLists.txt @@ -2,6 +2,6 @@ project(SIMDB_Utils_test) add_executable(SIMDB_Utils_test Utils_test.cpp) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SimdbTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SimdbTestingMacros.cmake) simdb_test(SIMDB_Utils_test SIMDB_Utils_test_RUN) diff --git a/sparta/test/Array/CMakeLists.txt b/sparta/test/Array/CMakeLists.txt index c7b27c8de3..c0629e8948 100644 --- a/sparta/test/Array/CMakeLists.txt +++ b/sparta/test/Array/CMakeLists.txt @@ -1,5 +1,5 @@ project(Array_test) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_add_test_executable(Array_test Array_test.cpp) sparta_test(Array_test Array_test_RUN) diff --git a/sparta/test/Audience/CMakeLists.txt b/sparta/test/Audience/CMakeLists.txt index 0b733d10a8..2473c9f426 100644 --- a/sparta/test/Audience/CMakeLists.txt +++ b/sparta/test/Audience/CMakeLists.txt @@ -2,6 +2,6 @@ project(Audience_test) sparta_add_test_executable(Audience_test Audience_main.cpp) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_test(Audience_test Audience_test_RUN) diff --git a/sparta/test/BasicHistogram/CMakeLists.txt b/sparta/test/BasicHistogram/CMakeLists.txt index 3bbd49a532..f8b1548408 100644 --- a/sparta/test/BasicHistogram/CMakeLists.txt +++ b/sparta/test/BasicHistogram/CMakeLists.txt @@ -2,7 +2,7 @@ project(BasicHistogram_test) sparta_add_test_executable(BasicHistogram_test BasicHistogram_test.cpp) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_test(BasicHistogram_test BasicHistogram_test_RUN) diff --git a/sparta/test/BitArray/CMakeLists.txt b/sparta/test/BitArray/CMakeLists.txt index 9a33003ebb..09f322d648 100644 --- a/sparta/test/BitArray/CMakeLists.txt +++ b/sparta/test/BitArray/CMakeLists.txt @@ -1,4 +1,4 @@ project(BitArray_test) sparta_add_test_executable(BitArray_test BitArray_test.cpp) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_test(BitArray_test BitArray_test_RUN) diff --git a/sparta/test/BoundedValue/CMakeLists.txt b/sparta/test/BoundedValue/CMakeLists.txt index 8974a7e634..fc91e97387 100644 --- a/sparta/test/BoundedValue/CMakeLists.txt +++ b/sparta/test/BoundedValue/CMakeLists.txt @@ -2,7 +2,7 @@ project(BoundedValue_test) sparta_add_test_executable(BoundedValue_test BoundedValue_test.cpp) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_test(BoundedValue_test BoundedValue_test_RUN) diff --git a/sparta/test/Buffer/CMakeLists.txt b/sparta/test/Buffer/CMakeLists.txt index be86c7f832..bf15410b49 100644 --- a/sparta/test/Buffer/CMakeLists.txt +++ b/sparta/test/Buffer/CMakeLists.txt @@ -2,6 +2,6 @@ project(Buffer_test) sparta_add_test_executable(Buffer_test Buffer_test.cpp) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_test(Buffer_test Buffer_test_RUN) diff --git a/sparta/test/Bus/CMakeLists.txt b/sparta/test/Bus/CMakeLists.txt index 35be6a5ca4..0e332d7fc8 100644 --- a/sparta/test/Bus/CMakeLists.txt +++ b/sparta/test/Bus/CMakeLists.txt @@ -2,6 +2,6 @@ project(Bus_test) sparta_add_test_executable(Bus_test Bus_main.cpp) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_test(Bus_test Bus_test_RUN) diff --git a/sparta/test/CMakeLists.txt b/sparta/test/CMakeLists.txt index ac62373a08..edf507a825 100644 --- a/sparta/test/CMakeLists.txt +++ b/sparta/test/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (SPARTA_TESTS) include (CTest) # Convenience macros and functions for tests -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) # Setup options for valgrind testing. find_program (VALGRIND_TOOL valgrind) diff --git a/sparta/test/CircularBuffer/CMakeLists.txt b/sparta/test/CircularBuffer/CMakeLists.txt index 14e12a1116..cd45d4bcb7 100644 --- a/sparta/test/CircularBuffer/CMakeLists.txt +++ b/sparta/test/CircularBuffer/CMakeLists.txt @@ -2,6 +2,6 @@ project(CircularBuffer_test) sparta_add_test_executable(CircularBuffer_test CircularBuffer_test.cpp) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_test(CircularBuffer_test CircularBuffer_test_RUN) diff --git a/sparta/test/Clock/CMakeLists.txt b/sparta/test/Clock/CMakeLists.txt index 84a824e5f4..2b20cc8f6b 100644 --- a/sparta/test/Clock/CMakeLists.txt +++ b/sparta/test/Clock/CMakeLists.txt @@ -1,6 +1,6 @@ project(Clock_test) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_add_test_executable(Clock_test Clock_test.cpp) diff --git a/sparta/test/Collection/CMakeLists.txt b/sparta/test/Collection/CMakeLists.txt index 36a5724024..283ef4fcd2 100644 --- a/sparta/test/Collection/CMakeLists.txt +++ b/sparta/test/Collection/CMakeLists.txt @@ -1,6 +1,6 @@ project(Collection_test) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_add_test_executable(Collection_test Collection_test.cpp) diff --git a/sparta/test/Color/CMakeLists.txt b/sparta/test/Color/CMakeLists.txt index c4432c8905..89f6c6062d 100644 --- a/sparta/test/Color/CMakeLists.txt +++ b/sparta/test/Color/CMakeLists.txt @@ -1,6 +1,6 @@ project(Color_test) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_add_test_executable(Color_test Color_test.cpp) diff --git a/sparta/test/CommandLineSimulator/CMakeLists.txt b/sparta/test/CommandLineSimulator/CMakeLists.txt index 334c5ae72e..9fad252078 100644 --- a/sparta/test/CommandLineSimulator/CMakeLists.txt +++ b/sparta/test/CommandLineSimulator/CMakeLists.txt @@ -1,6 +1,6 @@ project(CommandLineSimulator_test) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_add_test_executable(CommandLineSimulator_test CommandLineSimulator_test.cpp) diff --git a/sparta/test/ContextCounter/CMakeLists.txt b/sparta/test/ContextCounter/CMakeLists.txt index 4002bae9aa..ef5b77f337 100644 --- a/sparta/test/ContextCounter/CMakeLists.txt +++ b/sparta/test/ContextCounter/CMakeLists.txt @@ -1,6 +1,6 @@ project(ContextCounter_test) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_add_test_executable(ContextCounter_test ContextCounter_test.cpp) diff --git a/sparta/test/Counter/CMakeLists.txt b/sparta/test/Counter/CMakeLists.txt index 7033aad013..f5b7711542 100644 --- a/sparta/test/Counter/CMakeLists.txt +++ b/sparta/test/Counter/CMakeLists.txt @@ -1,6 +1,6 @@ project(Counter_test) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_add_test_executable(Counter_test Counter_test.cpp) diff --git a/sparta/test/CycleHistogram/CMakeLists.txt b/sparta/test/CycleHistogram/CMakeLists.txt index f95bfc29db..7cab868a53 100644 --- a/sparta/test/CycleHistogram/CMakeLists.txt +++ b/sparta/test/CycleHistogram/CMakeLists.txt @@ -1,6 +1,6 @@ project(CycleHistogram_test) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_add_test_executable(CycleHistogram_test CycleHistogram_test.cpp) sparta_test(CycleHistogram_test CycleHistogram_test_RUN) diff --git a/sparta/test/DAG/CMakeLists.txt b/sparta/test/DAG/CMakeLists.txt index 7f10fc4143..6029717877 100644 --- a/sparta/test/DAG/CMakeLists.txt +++ b/sparta/test/DAG/CMakeLists.txt @@ -1,6 +1,6 @@ project(Dag_test) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/SpartaTestingMacros.cmake) +include(${SPARTA_CMAKE_MACRO_PATH}/SpartaTestingMacros.cmake) sparta_add_test_executable(DAG_test DAG_main.cpp) From 28b9b06c22e4409daed48758a6ad8a8818d5afba Mon Sep 17 00:00:00 2001 From: Benoy Alexander <59582564+benoy-sifive@users.noreply.github.com> Date: Sat, 25 Feb 2023 22:42:42 -0600 Subject: [PATCH 35/48] Update README.md for Conda on MacOS --- sparta/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sparta/README.md b/sparta/README.md index c2c29a4cc1..4c5d0eccc1 100644 --- a/sparta/README.md +++ b/sparta/README.md @@ -74,9 +74,13 @@ To build your own copy, after cloning the repo, ensure Doxygen and dot (part of The tested dependencies are maintained in the `conda.recipe/` directory at the toplevel of the repository. To install packages using that same tested recipe: 1. If you already have `conda` or `mamba` installed and in your `PATH`, skip to step 3. -1. Download and install the latest [miniforge installer](https://github.com/conda-forge/miniforge#miniforge3). For example, on linux running on x86_64 `wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh && bash ./Miniforge3-Linux-x86_64.sh`. Make sure to `activate` or start a new shell as directed by the installer. +1. Download and install the latest [miniforge installer](https://github.com/conda-forge/miniforge#miniforge3) + * Linux running on x86_64 `wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh && bash ./Miniforge3-Linux-x86_64.sh` + * Macos running on x86_64 `wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh && bash ./Miniforge3-MacOSX-x86_64.sh` + * Macos running on arm64 `wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh && bash ./Miniforge3-MacOSX-arm64.sh` + * Make sure to `activate` or start a new shell as directed by the installer 1. `conda install yq` it is not a dependency of Sparta unless you are using the script to create an environment. The script will tell you to install it if you don't have it in your path. -1. `./scripts/create_conda_env.sh dev` using whatever name you would like in place of ``to create a named [conda environment](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/environments.html) containing all of the dependencies needed to **dev**elop Sparta. Be patient, this takes a few minutes. +1. From withing the `map` top level directory, run `./scripts/create_conda_env.sh dev` using whatever name you would like in place of ``to create a named [conda environment](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/environments.html) containing all of the dependencies needed to **dev**elop Sparta. Be patient, this takes a few minutes. 1. `conda activate ` using the `` you created above. 1. Follow the normal cmake-based build steps in the [Quick Start](#quick-start-for-the-impatient-yet-confident). After running cmake for a build, you should notice that `USING_CONDA` has been set because the version string reported by the conda-forge compiler contains the string "conda". From b6592862d50316a8a43ce0afdf52bd0ddb03a5d9 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Tue, 28 Feb 2023 09:03:24 +0100 Subject: [PATCH 36/48] seperated build for sparta and helios folder --- CMakeLists.txt | 18 ----------- README.md | 32 +++++++++++++++---- helios/CMakeLists.txt | 2 ++ helios/pipeViewer/CMakeLists.txt | 25 ++++++++++++--- helios/pipeViewer/argos_dumper/CMakeLists.txt | 4 +-- .../argos_dumper/DatabaseDump/CMakeLists.txt | 4 +-- .../transactionsearch/CMakeLists.txt | 4 +-- sparta/cmake/FindSparta.cmake | 8 ++--- 8 files changed, 57 insertions(+), 40 deletions(-) delete mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 95e394c0d0..0000000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -cmake_minimum_required (VERSION 3.15) - -project(MAP) - -set (MAP_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) - -set (SPARTA_BASE ${CMAKE_CURRENT_SOURCE_DIR}/sparta) - -OPTION(ENABLE_SPARTA "Enable sparta component" ON) -OPTION(ENABLE_HELIOS "Enable helios" ON) - -if (ENABLE_SPARTA) -add_subdirectory (sparta) -endif () - -if (ENABLE_HELIOS) -add_subdirectory (helios) -endif () diff --git a/README.md b/README.md index 78324e91d6..3bdece436d 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,10 @@ MAP is broken into two parts: ## Building MAP -Building MAP can be done in two ways: +Building MAP is done in two parts -1. Here at the top level of the repository, which builds everything - * Argos, the transaction viewer in Helios - * Sparta, the modeling framework -1. Down in Sparta, which only builds Sparta +1. Sparta, the modeling framework: build sparta only in the sparta folder +2. Argos, the transaction viewer in Helios in the helios folder. Note that to build and use helios, you will need sparta built and installed somwehere on your system. The MAP repository has numerous dependencies, which are listed in a [conda recipe](https://github.com/sparcians/map/blob/master/conda.recipe/meta.yaml), @@ -55,9 +53,29 @@ installed and would like to build everything (not just sparta). * `conda activate sparta` 1. To build MAP and it's components * `conda activate sparta` - * `cd map; mkdir release; cd release` + * `cd map/sparta; mkdir release; cd release` * `cmake -DCMAKE_BUILD_TYPE=Release ..` * `make` + * `make install` (optionally) +1. To build Helios/Argos transaction viewer: + * `conda activate sparta` + * `cd map/helios; mkdir release; cd release` + * `cmake -DCMAKE_BUILD_TYPE=Release -DSPARTA_SEARCH_DIR= ..` + * `make` + * `make install` (optionally) + +A few interesting cmake options to help resolve dependencies are: + +For both Sparta and Helios: + +* `-DBOOST_ROOT=`: Custom Boost location +* `-DCMAKE_INSTALL_PREFIX=`: Install prefix, defaults to a system wide location normally so you can use this for a local install in a home folder for example. + +Helios only: + +* `-DSPARTA_SEARCH_DIR=`: Use this to ensure helios finds Sparta, when you installed it in a non-default location Not providing this will try and find sparta in the map source tree, but this might fail, if you did not build in a folder named `release` +* `-DPython3_ROOT_DIR=`: Not often needed but useful to point to the right python if you are not in a conda env) + ## Updating Regression/Build Environments for CI @@ -72,4 +90,4 @@ the generation of the CI-specific control files: To update versions of OSes, edit the following file: https://github.com/sparcians/map/blob/master/conda.recipe/conda_build_config.yaml and then run `conda smithy rerender`. (Ensure `conda install -conda-smithy` into your conda installation for that command to exist). \ No newline at end of file +conda-smithy` into your conda installation for that command to exist). diff --git a/helios/CMakeLists.txt b/helios/CMakeLists.txt index aa01ab524d..54a8dfc24d 100644 --- a/helios/CMakeLists.txt +++ b/helios/CMakeLists.txt @@ -1,3 +1,5 @@ cmake_minimum_required (VERSION 3.15) +project(helios) + add_subdirectory (pipeViewer) diff --git a/helios/pipeViewer/CMakeLists.txt b/helios/pipeViewer/CMakeLists.txt index 773f006cc3..3f636df10e 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -1,7 +1,22 @@ cmake_minimum_required(VERSION 3.15) project (PipeViewer) -include(${CMAKE_SOURCE_DIR}/sparta/cmake/sparta-config.cmake) +# Set up Sparta +if(IS_DIRECTORY ${SPARTA_SEARCH_DIR}) + set(CMAKE_MODULE_PATH "${SPARTA_SEARCH_DIR}/lib/cmake/sparta" ${CMAKE_MODULE_PATH}) + find_package(Sparta REQUIRED) +else() + set(SPARTA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../sparta) + message (STATUS "Looking for a built version of sparta in the source tree at ${SPARTA_DIR}") + set(CMAKE_MODULE_PATH "${SPARTA_DIR}/cmake" ${CMAKE_MODULE_PATH}) + set(SPARTA_INCLUDE_DIR ${SPARTA_DIR} ${SPARTA_DIR}/simdb) + set(SPARTA_LIBRARY ${SPARTA_DIR}/release ${SPARTA_DIR}/release/simdb) + include(${SPARTA_DIR}/cmake/FindSparta.cmake) +endif() + +if(NOT SPARTA_FOUND) + message (FATAL_ERROR "Could not find Sparta. (${SPARTA_FOUND}) If needed, please provide the location where sparta is installed: -DSPARTA_SEARCH_DIR=") +endif() # If we are in virtualenv or conda, that takes prio over any system python there might be set(Python3_FIND_VIRTUALENV FIRST) @@ -24,7 +39,7 @@ execute_process( if(NOT WXCHECK_RESULT EQUAL "0") message(FATAL_ERROR "Could not find wxPython: ${WXCHECK_LOG}") endif() -list(APPEND _INC_DIRS "$" ${WX_PYTHON_INC} ${wxWidgets_INCLUDE_DIRS}) +list(APPEND _INC_DIRS "$" ${WX_PYTHON_INC} ${wxWidgets_INCLUDE_DIRS}) # Populate list of library dirs: # Set up the include and link dirs for python's setuptools using setup.cfg file @@ -35,7 +50,10 @@ foreach(lib IN LISTS HDF5_LIBRARIES) endforeach() list(REMOVE_DUPLICATES _LIB_DIRS) # And we add sparta and simdb location -list(APPEND _LIB_DIRS "$" "$" ${wxWidgets_LIBRARY_DIRS}) +# they are in the same folder so we look at libsparta only to find the right location +get_property(_SPARTA_LIB TARGET SPARTA::libsparta PROPERTY IMPORTED_LOCATION) +get_filename_component(SPARTA_LIBDIR ${_SPARTA_LIB} DIRECTORY) +list(APPEND _LIB_DIRS ${SPARTA_LIBDIR} ${wxWidgets_LIBRARY_DIRS}) # Those get pushed to setup.cfg file file(GENERATE @@ -74,7 +92,6 @@ add_custom_command( ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/transactiondb/src/helpers.hpp ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/transactiondb/src/common.pxd ${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/transactiondb/src/transactiondb.pyx - sparta simdb ${CMAKE_CURRENT_SOURCE_DIR}/setup.cfg COMMENT "Building pipeViwer and its dependencies" ) diff --git a/helios/pipeViewer/argos_dumper/CMakeLists.txt b/helios/pipeViewer/argos_dumper/CMakeLists.txt index e92bf107ff..3fad07fd27 100644 --- a/helios/pipeViewer/argos_dumper/CMakeLists.txt +++ b/helios/pipeViewer/argos_dumper/CMakeLists.txt @@ -9,7 +9,7 @@ enable_testing () add_executable(Argos_dumper ArgosCollection_test.cpp) add_test (NAME Argos_dumper_RUN COMMAND Argos_dumper) -target_include_directories(Argos_dumper PRIVATE ${CMAKE_SOURCE_DIR}/helios/pipeViewer/pipe_view) -target_link_libraries (Argos_dumper ${Sparta_LIBS}) +target_include_directories(Argos_dumper PRIVATE ${CMAKE_SOURCE_DIR}/pipeViewer/pipe_view) +target_link_libraries (Argos_dumper SPARTA::sparta) add_subdirectory(DatabaseDump) diff --git a/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt b/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt index 213bd3df69..2fefa7d904 100644 --- a/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt +++ b/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt @@ -5,7 +5,7 @@ set (CMAKE_CXX_STANDARD_REQUIRED ON) add_executable(ArgosDumper Database_dumper.cpp) -target_include_directories(ArgosDumper PRIVATE ${CMAKE_SOURCE_DIR}/helios/pipeViewer/pipe_view) -target_link_libraries (ArgosDumper ${Sparta_LIBS}) +target_include_directories(ArgosDumper PRIVATE ${CMAKE_SOURCE_DIR}/pipeViewer/pipe_view) +target_link_libraries (ArgosDumper SPARTA::sparta) add_test (NAME ArgosDumperSmokeTestingDB COMMAND ArgosDumper db_pipeout/pipeout) diff --git a/helios/pipeViewer/transactionsearch/CMakeLists.txt b/helios/pipeViewer/transactionsearch/CMakeLists.txt index 2d46a7eeb1..6373d7ecee 100644 --- a/helios/pipeViewer/transactionsearch/CMakeLists.txt +++ b/helios/pipeViewer/transactionsearch/CMakeLists.txt @@ -5,7 +5,7 @@ set (CMAKE_CXX_STANDARD_REQUIRED ON) add_executable(transactionsearch src/transaction_search.cpp) -target_include_directories(transactionsearch PRIVATE ${CMAKE_SOURCE_DIR}/helios/pipeViewer/pipe_view) -target_link_libraries(transactionsearch ${Sparta_LIBS}) +target_include_directories(transactionsearch PRIVATE ${CMAKE_SOURCE_DIR}/pipeViewer/pipe_view) +target_link_libraries(transactionsearch SPARTA::sparta) install(TARGETS transactionsearch RUNTIME) diff --git a/sparta/cmake/FindSparta.cmake b/sparta/cmake/FindSparta.cmake index cf7bbc0c3f..68601dc8b5 100644 --- a/sparta/cmake/FindSparta.cmake +++ b/sparta/cmake/FindSparta.cmake @@ -9,8 +9,6 @@ if(NOT SPARTA_FOUND) find_package(RapidJSON REQUIRED) find_package(Threads REQUIRED) - #set(CMAKE_FIND_DEBUG_MODE TRUE) - find_path(SPARTA_INCLUDE_DIRS sparta/sparta.hpp HINTS ${SPARTA_INCLUDE_DIR} ${SPARTA_SEARCH_DIR} HINTS ENV CPATH @@ -71,11 +69,11 @@ if(NOT SPARTA_FOUND) ZLIB::ZLIB yaml-cpp Threads::Threads) set_property(TARGET SPARTA::sparta PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_17) + include(${CMAKE_CURRENT_LIST_DIR}/SpartaTestingMacros.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/SimdbTestingMacros.cmake) + set(SPARTA_FOUND TRUE) endif() - include(${CMAKE_CURRENT_LIST_DIR}/SpartaTestingMacros.cmake) - include(${CMAKE_CURRENT_LIST_DIR}/SimdbTestingMacros.cmake) mark_as_advanced(SPARTA_INCLUDE_DIRS SPARTA_LIBRARIES) - #set(CMAKE_FIND_DEBUG_MODE FALSE) endif() From 6c3865a0b9a3bb346ee303b7b7025b8c7a33c939 Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Tue, 28 Feb 2023 19:44:09 -0600 Subject: [PATCH 37/48] Updated README and build rules for new layout --- .circleci/fast_finish_ci_pr_build.sh | 2 +- .scripts/build_steps.sh | 4 ++-- .scripts/create_conda_build_artifacts.sh | 8 ++++---- .scripts/run_osx_build.sh | 4 ++-- README.md | 9 +++++++-- conda.recipe/build.sh | 20 ++++++++++++++++++-- 6 files changed, 34 insertions(+), 13 deletions(-) diff --git a/.circleci/fast_finish_ci_pr_build.sh b/.circleci/fast_finish_ci_pr_build.sh index 4c0b56085b..756fd8eb1c 100755 --- a/.circleci/fast_finish_ci_pr_build.sh +++ b/.circleci/fast_finish_ci_pr_build.sh @@ -1,4 +1,4 @@ #!/bin/bash -curl https://raw.githubusercontent.com/conda-forge/conda-forge-ci-setup-feedstock/master/recipe/conda_forge_ci_setup/ff_ci_pr_build.py | \ +curl https://raw.githubusercontent.com/conda-forge/conda-forge-ci-setup-feedstock/main/recipe/conda_forge_ci_setup/ff_ci_pr_build.py | \ python - -v --ci "circle" "${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" "${CIRCLE_BUILD_NUM}" "${CIRCLE_PR_NUMBER}" diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index be0907ed8c..e21030ca10 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -33,9 +33,9 @@ CONDARC mamba install --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" + conda-build pip boa conda-forge-ci-setup=3 mamba update --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" + conda-build pip boa conda-forge-ci-setup=3 # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" diff --git a/.scripts/create_conda_build_artifacts.sh b/.scripts/create_conda_build_artifacts.sh index cba0faeea9..17ec0868c5 100755 --- a/.scripts/create_conda_build_artifacts.sh +++ b/.scripts/create_conda_build_artifacts.sh @@ -79,8 +79,8 @@ if [[ ! -z "$BLD_ARTIFACT_PREFIX" ]]; then echo "##vso[task.setVariable variable=BLD_ARTIFACT_NAME]$BLD_ARTIFACT_NAME" echo "##vso[task.setVariable variable=BLD_ARTIFACT_PATH]$BLD_ARTIFACT_PATH" elif [[ "$CI" == "github_actions" ]]; then - echo "::set-output name=BLD_ARTIFACT_NAME::$BLD_ARTIFACT_NAME" - echo "::set-output name=BLD_ARTIFACT_PATH::$BLD_ARTIFACT_PATH" + echo "BLD_ARTIFACT_NAME=$BLD_ARTIFACT_NAME" >> $GITHUB_OUTPUT + echo "BLD_ARTIFACT_PATH=$BLD_ARTIFACT_PATH" >> $GITHUB_OUTPUT fi fi @@ -107,7 +107,7 @@ if [[ ! -z "$ENV_ARTIFACT_PREFIX" ]]; then echo "##vso[task.setVariable variable=ENV_ARTIFACT_NAME]$ENV_ARTIFACT_NAME" echo "##vso[task.setVariable variable=ENV_ARTIFACT_PATH]$ENV_ARTIFACT_PATH" elif [[ "$CI" == "github_actions" ]]; then - echo "::set-output name=ENV_ARTIFACT_NAME::$ENV_ARTIFACT_NAME" - echo "::set-output name=ENV_ARTIFACT_PATH::$ENV_ARTIFACT_PATH" + echo "ENV_ARTIFACT_NAME=$ENV_ARTIFACT_NAME" >> $GITHUB_OUTPUT + echo "ENV_ARTIFACT_PATH=$ENV_ARTIFACT_PATH" >> $GITHUB_OUTPUT fi fi \ No newline at end of file diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index 6b8d444f4f..fc0a720338 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -24,9 +24,9 @@ source ${MINIFORGE_HOME}/etc/profile.d/conda.sh conda activate base mamba install --update-specs --quiet --yes --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" + conda-build pip boa conda-forge-ci-setup=3 mamba update --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" + conda-build pip boa conda-forge-ci-setup=3 diff --git a/README.md b/README.md index 3bdece436d..cf5dee9241 100644 --- a/README.md +++ b/README.md @@ -89,5 +89,10 @@ the generation of the CI-specific control files: To update versions of OSes, edit the following file: https://github.com/sparcians/map/blob/master/conda.recipe/conda_build_config.yaml -and then run `conda smithy rerender`. (Ensure `conda install -conda-smithy` into your conda installation for that command to exist). +and then run `conda smithy rerender`. + +Install `conda smithy` instructions: +``` +conda install -n root -c conda-forge conda-smithy +conda install -n root -c conda-forge conda-package-handling +``` \ No newline at end of file diff --git a/conda.recipe/build.sh b/conda.recipe/build.sh index 18ef2ec6df..d2cfeeed92 100644 --- a/conda.recipe/build.sh +++ b/conda.recipe/build.sh @@ -41,12 +41,13 @@ env | sort ################################################################################ # -# BUILD & TEST MAP +# BUILD & TEST MAP/SPARTA # ################################################################################ df -h / +pushd sparta mkdir -p release pushd release cmake -DCMAKE_BUILD_TYPE=Release \ @@ -74,9 +75,24 @@ df -h / # and we might want to create separate install targets for the headers and the libs and the doc cmake --build . --target install df -h / - +popd popd +################################################################################ +# +# BUILD MAP/HELIOS +# +################################################################################ +pushd helios +mkdir -p release +pushd release +cmake -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX:PATH="$PREFIX" \ + "${CMAKE_PLATFORM_FLAGS[@]}" \ + .. +cmake --build . -j "$CPU_COUNT" || cmake --build . -v +popd +popd ################################################################################ # From a84e91e1f08b557e570118f353d1e54c50e3a3da Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Tue, 28 Feb 2023 20:45:17 -0600 Subject: [PATCH 38/48] Fixed bad dir path in regression --- conda.recipe/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda.recipe/build.sh b/conda.recipe/build.sh index d2cfeeed92..1d480ae065 100644 --- a/conda.recipe/build.sh +++ b/conda.recipe/build.sh @@ -68,7 +68,7 @@ df -h / # by cd'ing into the example subdir and running ctest # because not all of the subdirs of example create their # own _regress target like the core example. -(cd sparta/example && CTEST_OUTPUT_ON_FAILURE=1 ctest -j "$CPU_COUNT" --test-action test) +(cd example && CTEST_OUTPUT_ON_FAILURE=1 ctest -j "$CPU_COUNT" --test-action test) df -h / # if we want to create individual packages this should move into a separate install script for only SPARTA From 0168889b3c9a2356aa6cd8b52df05f673042d3eb Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Tue, 28 Feb 2023 21:19:26 -0600 Subject: [PATCH 39/48] Renamed DatabaseDump tool --- helios/pipeViewer/argos_dumper/CMakeLists.txt | 2 +- .../pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt | 8 ++++---- helios/pipeViewer/setup.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/helios/pipeViewer/argos_dumper/CMakeLists.txt b/helios/pipeViewer/argos_dumper/CMakeLists.txt index 3fad07fd27..3639f246da 100644 --- a/helios/pipeViewer/argos_dumper/CMakeLists.txt +++ b/helios/pipeViewer/argos_dumper/CMakeLists.txt @@ -10,6 +10,6 @@ add_executable(Argos_dumper ArgosCollection_test.cpp) add_test (NAME Argos_dumper_RUN COMMAND Argos_dumper) target_include_directories(Argos_dumper PRIVATE ${CMAKE_SOURCE_DIR}/pipeViewer/pipe_view) -target_link_libraries (Argos_dumper SPARTA::sparta) +target_link_libraries (Argos_dumper SPARTA::sparta rt) add_subdirectory(DatabaseDump) diff --git a/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt b/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt index 2fefa7d904..10dfe0207f 100644 --- a/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt +++ b/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt @@ -3,9 +3,9 @@ project(Argosdumper) set (CMAKE_CXX_STANDARD 17) set (CMAKE_CXX_STANDARD_REQUIRED ON) -add_executable(ArgosDumper Database_dumper.cpp) +add_executable(DBDumper Database_dumper.cpp) -target_include_directories(ArgosDumper PRIVATE ${CMAKE_SOURCE_DIR}/pipeViewer/pipe_view) -target_link_libraries (ArgosDumper SPARTA::sparta) +target_include_directories(DBDumper PRIVATE ${CMAKE_SOURCE_DIR}/pipeViewer/pipe_view) +target_link_libraries (DBDumper SPARTA::sparta rt) -add_test (NAME ArgosDumperSmokeTestingDB COMMAND ArgosDumper db_pipeout/pipeout) +add_test (NAME DBDumperSmokeTestingDB COMMAND DBDumper db_pipeout/pipeout) diff --git a/helios/pipeViewer/setup.py b/helios/pipeViewer/setup.py index cd01234327..ab49047e12 100644 --- a/helios/pipeViewer/setup.py +++ b/helios/pipeViewer/setup.py @@ -18,7 +18,7 @@ 'pipe_view.transactiondb', language='c++', sources=['pipe_view/transactiondb/src/transactiondb.pyx'], - libraries=["sparta", "simdb", "hdf5", "sqlite3"], + libraries=["sparta", "simdb", "hdf5", "sqlite3", "rt"], pyrex_gdb = True, extra_compile_args = compile_args, ) From cd34a5dac47f72b98de8e92e6192acb74251a9bc Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Thu, 2 Mar 2023 09:58:59 -0600 Subject: [PATCH 40/48] Added missing rt library for Linux builds --- helios/pipeViewer/CMakeLists.txt | 4 +-- helios/pipeViewer/argos_dumper/CMakeLists.txt | 2 +- .../argos_dumper/DatabaseDump/CMakeLists.txt | 2 +- sparta/cmake/FindSparta.cmake | 26 +++++++++++++------ 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/helios/pipeViewer/CMakeLists.txt b/helios/pipeViewer/CMakeLists.txt index 3f636df10e..b14d2f18b2 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.15) project (PipeViewer) # Set up Sparta -if(IS_DIRECTORY ${SPARTA_SEARCH_DIR}) +if(IS_DIRECTORY ${SPARTA_SEARCH_DIR}) set(CMAKE_MODULE_PATH "${SPARTA_SEARCH_DIR}/lib/cmake/sparta" ${CMAKE_MODULE_PATH}) find_package(Sparta REQUIRED) else() @@ -51,7 +51,7 @@ endforeach() list(REMOVE_DUPLICATES _LIB_DIRS) # And we add sparta and simdb location # they are in the same folder so we look at libsparta only to find the right location -get_property(_SPARTA_LIB TARGET SPARTA::libsparta PROPERTY IMPORTED_LOCATION) +get_property(_SPARTA_LIB TARGET SPARTA::libsparta PROPERTY IMPORTED_LOCATION) get_filename_component(SPARTA_LIBDIR ${_SPARTA_LIB} DIRECTORY) list(APPEND _LIB_DIRS ${SPARTA_LIBDIR} ${wxWidgets_LIBRARY_DIRS}) diff --git a/helios/pipeViewer/argos_dumper/CMakeLists.txt b/helios/pipeViewer/argos_dumper/CMakeLists.txt index 3639f246da..3fad07fd27 100644 --- a/helios/pipeViewer/argos_dumper/CMakeLists.txt +++ b/helios/pipeViewer/argos_dumper/CMakeLists.txt @@ -10,6 +10,6 @@ add_executable(Argos_dumper ArgosCollection_test.cpp) add_test (NAME Argos_dumper_RUN COMMAND Argos_dumper) target_include_directories(Argos_dumper PRIVATE ${CMAKE_SOURCE_DIR}/pipeViewer/pipe_view) -target_link_libraries (Argos_dumper SPARTA::sparta rt) +target_link_libraries (Argos_dumper SPARTA::sparta) add_subdirectory(DatabaseDump) diff --git a/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt b/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt index 10dfe0207f..ce1aaedfbb 100644 --- a/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt +++ b/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt @@ -6,6 +6,6 @@ set (CMAKE_CXX_STANDARD_REQUIRED ON) add_executable(DBDumper Database_dumper.cpp) target_include_directories(DBDumper PRIVATE ${CMAKE_SOURCE_DIR}/pipeViewer/pipe_view) -target_link_libraries (DBDumper SPARTA::sparta rt) +target_link_libraries (DBDumper SPARTA::sparta) add_test (NAME DBDumperSmokeTestingDB COMMAND DBDumper db_pipeout/pipeout) diff --git a/sparta/cmake/FindSparta.cmake b/sparta/cmake/FindSparta.cmake index 68601dc8b5..5351191f27 100644 --- a/sparta/cmake/FindSparta.cmake +++ b/sparta/cmake/FindSparta.cmake @@ -9,6 +9,11 @@ if(NOT SPARTA_FOUND) find_package(RapidJSON REQUIRED) find_package(Threads REQUIRED) + # On Linux we need to link against rt as well + if (NOT APPLE) + find_library(LIBRT rt) + endif() + find_path(SPARTA_INCLUDE_DIRS sparta/sparta.hpp HINTS ${SPARTA_INCLUDE_DIR} ${SPARTA_SEARCH_DIR} HINTS ENV CPATH @@ -62,16 +67,21 @@ if(NOT SPARTA_FOUND) add_library(SPARTA::sparta INTERFACE IMPORTED) set_property(TARGET SPARTA::sparta - PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${SPARTA_INCLUDE_DIRS} ${RAPIDJSON_INCLUDE_DIR} ${RapidJSON_INCLUDE_DIR}) + PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${SPARTA_INCLUDE_DIRS} ${RAPIDJSON_INCLUDE_DIR} ${RapidJSON_INCLUDE_DIR}) set_property(TARGET SPARTA::sparta - PROPERTY INTERFACE_LINK_LIBRARIES SPARTA::libsparta SPARTA::libsimdb hdf5::hdf5 SQLite::SQLite3 - Boost::filesystem Boost::serialization Boost::timer Boost::program_options - ZLIB::ZLIB yaml-cpp Threads::Threads) + PROPERTY INTERFACE_LINK_LIBRARIES SPARTA::libsparta SPARTA::libsimdb hdf5::hdf5 SQLite::SQLite3 + Boost::filesystem Boost::serialization Boost::timer Boost::program_options + ZLIB::ZLIB yaml-cpp Threads::Threads) + + if(LIBRT) + set_property(TARGET SPARTA::sparta APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${LIBRT}) + endif () + set_property(TARGET SPARTA::sparta - PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_17) - include(${CMAKE_CURRENT_LIST_DIR}/SpartaTestingMacros.cmake) - include(${CMAKE_CURRENT_LIST_DIR}/SimdbTestingMacros.cmake) - set(SPARTA_FOUND TRUE) + PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_17) + include(${CMAKE_CURRENT_LIST_DIR}/SpartaTestingMacros.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/SimdbTestingMacros.cmake) + set(SPARTA_FOUND TRUE) endif() mark_as_advanced(SPARTA_INCLUDE_DIRS SPARTA_LIBRARIES) From 348290462099dc0afe547fd2dfb841bb4ce3e62f Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Thu, 2 Mar 2023 11:12:00 -0600 Subject: [PATCH 41/48] Put in check for CPP check module --- sparta/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sparta/CMakeLists.txt b/sparta/CMakeLists.txt index 8eff179d3e..8d4f4cad53 100644 --- a/sparta/CMakeLists.txt +++ b/sparta/CMakeLists.txt @@ -194,6 +194,8 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") endif () # CppCheck Support +# Add a custom CMake Modules directory +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") set (CPPCHECK_XML_OUTPUT "${PROJECT_BINARY_DIR}/analysis/cppcheck/cppcheck_analysis.xml") set (CPPCHECK_EXCLUDES ${MAP_BINARY_DIR} From 3b7680092a2e24eb1b61967f88f57ca9feea1762 Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Thu, 2 Mar 2023 11:12:16 -0600 Subject: [PATCH 42/48] Fixed new compilation issue with HDF test --- sparta/simdb/test/HDF5Database/HDF5Database_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sparta/simdb/test/HDF5Database/HDF5Database_test.cpp b/sparta/simdb/test/HDF5Database/HDF5Database_test.cpp index 25115f507e..ea42a68283 100644 --- a/sparta/simdb/test/HDF5Database/HDF5Database_test.cpp +++ b/sparta/simdb/test/HDF5Database/HDF5Database_test.cpp @@ -91,9 +91,9 @@ struct CompoundPOD { CompoundPOD createRandomCompoundPOD() { CompoundPOD comp; - comp.ch = chooseRand(); - comp.i1 = chooseRand(); - comp.ui1 = chooseRand(); + comp.ch = (char) chooseRand(); + comp.i1 = (int8_t) chooseRand(); + comp.ui1 = (uint8_t)chooseRand(); comp.i2 = chooseRand(); comp.ui2 = chooseRand(); comp.i4 = chooseRand(); From 29992e5db523d5282c216e34bf37fa4d272f4f6e Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Thu, 2 Mar 2023 12:50:57 -0600 Subject: [PATCH 43/48] ANOTHER HDF5 test fix --- sparta/simdb/test/HDF5Database/HDF5Database_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sparta/simdb/test/HDF5Database/HDF5Database_test.cpp b/sparta/simdb/test/HDF5Database/HDF5Database_test.cpp index ea42a68283..85f6372af8 100644 --- a/sparta/simdb/test/HDF5Database/HDF5Database_test.cpp +++ b/sparta/simdb/test/HDF5Database/HDF5Database_test.cpp @@ -210,9 +210,9 @@ struct CompoundWithMatrixPOD CompoundWithMatrixPOD createRandomCompoundWithMatrixPOD() { CompoundWithMatrixPOD comp; - comp.ch = chooseRand(); - comp.i1 = chooseRand(); - comp.ui1 = chooseRand(); + comp.ch = (char) chooseRand(); + comp.i1 = (int8_t) chooseRand(); + comp.ui1 = (uint8_t)chooseRand(); comp.i2 = chooseRand(); comp.ui2 = chooseRand(); comp.i4 = chooseRand(); From 2ebd5402b483ddeacf7047f3aa6426f65b9809c0 Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Thu, 2 Mar 2023 14:23:30 -0600 Subject: [PATCH 44/48] Forced HDF5 test to be C++ testing --- sparta/cmake/sparta-config.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sparta/cmake/sparta-config.cmake b/sparta/cmake/sparta-config.cmake index 5ebd23ba92..c66f5ae1b5 100644 --- a/sparta/cmake/sparta-config.cmake +++ b/sparta/cmake/sparta-config.cmake @@ -65,9 +65,8 @@ find_package(ZLIB REQUIRED) include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS}) message (STATUS "Using zlib ${ZLIB_VERSION_STRING}") -# Find HDF5. Need to enable C language for HDF5 testing -enable_language (C) -find_package (HDF5 1.10 REQUIRED) +# Find HDF5. +find_package (HDF5 1.10 REQUIRED COMPONENTS CXX) include_directories (SYSTEM ${HDF5_INCLUDE_DIRS}) message (STATUS "Using HDF5 ${HDF5_VERSION}") From 39cc0ede1d172c5888795ac012ee1f460d2d056d Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Thu, 2 Mar 2023 15:55:48 -0600 Subject: [PATCH 45/48] Removed rt library link --- helios/pipeViewer/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helios/pipeViewer/setup.py b/helios/pipeViewer/setup.py index ab49047e12..cd01234327 100644 --- a/helios/pipeViewer/setup.py +++ b/helios/pipeViewer/setup.py @@ -18,7 +18,7 @@ 'pipe_view.transactiondb', language='c++', sources=['pipe_view/transactiondb/src/transactiondb.pyx'], - libraries=["sparta", "simdb", "hdf5", "sqlite3", "rt"], + libraries=["sparta", "simdb", "hdf5", "sqlite3"], pyrex_gdb = True, extra_compile_args = compile_args, ) From 8a4c272e3e3471d5c765e7844283223d589ece1f Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Fri, 3 Mar 2023 16:03:04 -0600 Subject: [PATCH 46/48] ONE more tweak: use CXX version of HDF5 --- sparta/cmake/FindSparta.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sparta/cmake/FindSparta.cmake b/sparta/cmake/FindSparta.cmake index 5351191f27..d73991704f 100644 --- a/sparta/cmake/FindSparta.cmake +++ b/sparta/cmake/FindSparta.cmake @@ -2,7 +2,7 @@ include(FindPackageHandleStandardArgs) if(NOT SPARTA_FOUND) find_package(Boost REQUIRED COMPONENTS timer filesystem serialization program_options) - find_package(HDF5 REQUIRED) + find_package(HDF5 REQUIRED COMPONENTS CXX) find_package(SQLite3 REQUIRED) find_package(ZLIB REQUIRED) find_package(yaml-cpp REQUIRED) @@ -61,15 +61,15 @@ if(NOT SPARTA_FOUND) if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND SPARTA_FOUND) add_library(SPARTA::libsparta STATIC IMPORTED) - set_property(TARGET SPARTA::libsparta PROPERTY IMPORTED_LOCATION "${SPARTA_sparta_LIBRARY}") + set_property(TARGET SPARTA::libsparta PROPERTY IMPORTED_LOCATION "${SPARTA_sparta_LIBRARY}") add_library(SPARTA::libsimdb STATIC IMPORTED) - set_property(TARGET SPARTA::libsimdb PROPERTY IMPORTED_LOCATION "${SPARTA_simdb_LIBRARY}") + set_property(TARGET SPARTA::libsimdb PROPERTY IMPORTED_LOCATION "${SPARTA_simdb_LIBRARY}") add_library(SPARTA::sparta INTERFACE IMPORTED) set_property(TARGET SPARTA::sparta PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${SPARTA_INCLUDE_DIRS} ${RAPIDJSON_INCLUDE_DIR} ${RapidJSON_INCLUDE_DIR}) set_property(TARGET SPARTA::sparta - PROPERTY INTERFACE_LINK_LIBRARIES SPARTA::libsparta SPARTA::libsimdb hdf5::hdf5 SQLite::SQLite3 + PROPERTY INTERFACE_LINK_LIBRARIES SPARTA::libsparta SPARTA::libsimdb HDF5::HDF5 SQLite::SQLite3 Boost::filesystem Boost::serialization Boost::timer Boost::program_options ZLIB::ZLIB yaml-cpp Threads::Threads) @@ -77,8 +77,8 @@ if(NOT SPARTA_FOUND) set_property(TARGET SPARTA::sparta APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${LIBRT}) endif () - set_property(TARGET SPARTA::sparta - PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_17) + set_property(TARGET SPARTA::sparta + PROPERTY INTERFACE_COMPILE_FEATURES cxx_std_17) include(${CMAKE_CURRENT_LIST_DIR}/SpartaTestingMacros.cmake) include(${CMAKE_CURRENT_LIST_DIR}/SimdbTestingMacros.cmake) set(SPARTA_FOUND TRUE) From 895c7b1d67c0872ef56133b8a06d6b939420dc41 Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Sun, 5 Mar 2023 19:32:01 -0600 Subject: [PATCH 47/48] Fixed formatting --- sparta/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sparta/README.md b/sparta/README.md index 24567df6f9..f2e389399f 100644 --- a/sparta/README.md +++ b/sparta/README.md @@ -79,10 +79,10 @@ To build your own copy, after cloning the repo, ensure Doxygen and dot (part of The tested dependencies are maintained in the `conda.recipe/` directory at the toplevel of the repository. To install packages using that same tested recipe: 1. If you already have `conda` or `mamba` installed and in your `PATH`, skip to step 3. 1. Download and install the latest [miniforge installer](https://github.com/conda-forge/miniforge#miniforge3) - * Linux running on x86_64 `wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh && bash ./Miniforge3-Linux-x86_64.sh` - * Macos running on x86_64 `wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh && bash ./Miniforge3-MacOSX-x86_64.sh` - * Macos running on arm64 `wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh && bash ./Miniforge3-MacOSX-arm64.sh` - * Make sure to `activate` or start a new shell as directed by the installer + * Linux running on x86_64 `wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh && bash ./Miniforge3-Linux-x86_64.sh` + * Macos running on x86_64 `wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh && bash ./Miniforge3-MacOSX-x86_64.sh` + * Macos running on arm64 `wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh && bash ./Miniforge3-MacOSX-arm64.sh` + * Make sure to `activate` or start a new shell as directed by the installer 1. `conda install yq` it is not a dependency of Sparta unless you are using the script to create an environment. The script will tell you to install it if you don't have it in your path. 1. From withing the `map` top level directory, run `./scripts/create_conda_env.sh dev` using whatever name you would like in place of ``to create a named [conda environment](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/environments.html) containing all of the dependencies needed to **dev**elop Sparta. Be patient, this takes a few minutes. 1. `conda activate ` using the `` you created above. From 22dcecc5ed0da7bb1589ad8198521b30cf99bc59 Mon Sep 17 00:00:00 2001 From: Knute Lingaard Date: Wed, 8 Mar 2023 14:16:42 -0600 Subject: [PATCH 48/48] Updated README with install directions --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cf5dee9241..8b87c4ac2b 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,13 @@ installed and would like to build everything (not just sparta). * `cd map/sparta; mkdir release; cd release` * `cmake -DCMAKE_BUILD_TYPE=Release ..` * `make` - * `make install` (optionally) + * `cmake --install . --prefix $CONDA_PREFIX` 1. To build Helios/Argos transaction viewer: * `conda activate sparta` * `cd map/helios; mkdir release; cd release` * `cmake -DCMAKE_BUILD_TYPE=Release -DSPARTA_SEARCH_DIR= ..` * `make` - * `make install` (optionally) + * `cmake --install . --prefix $CONDA_PREFIX` A few interesting cmake options to help resolve dependencies are: