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/.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/.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/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 881878e600..8b87c4ac2b 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,69 @@ 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 is done in two parts + +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), +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/sparta; mkdir release; cd release` + * `cmake -DCMAKE_BUILD_TYPE=Release ..` + * `make` + * `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` + * `cmake --install . --prefix $CONDA_PREFIX` + +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 CI files are generated when the command `conda smithy rerender` is run inside a MAP clone. That command uses the following files to control @@ -33,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). \ No newline at end of file +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..1d480ae065 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 \ @@ -67,16 +68,31 @@ 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 # 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 ################################################################################ # 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/.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 9e7637323d..b14d2f18b2 100644 --- a/helios/pipeViewer/CMakeLists.txt +++ b/helios/pipeViewer/CMakeLists.txt @@ -1,31 +1,108 @@ cmake_minimum_required(VERSION 3.15) project (PipeViewer) -find_package(PythonInterp 3.7 REQUIRED) -find_package(PythonLibs 3.7 REQUIRED) - -set (CMAKE_CXX_STANDARD 17) -set (CMAKE_CXX_STANDARD_REQUIRED ON) +# 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 ${PYTHON}) - find_program(PYTHON 'python3') +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() -set(SETUP_PY "${CMAKE_CURRENT_SOURCE_DIR}/pipe_view/core/setup.py") +# 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) -set(PY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/core.so.built") +# 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}) -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 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}") +# 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) + get_filename_component(d ${lib} DIRECTORY) + list(APPEND _LIB_DIRS ${d}) +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_filename_component(SPARTA_LIBDIR ${_SPARTA_LIB} DIRECTORY) +list(APPEND _LIB_DIRS ${SPARTA_LIBDIR} ${wxWidgets_LIBRARY_DIRS}) -include_directories(${SPARTA_BASE} ${SPARTA_BASE}/simdb/include ./) +# Those get pushed to setup.cfg file +file(GENERATE + OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/setup.cfg + CONTENT +" +[build_ext] +include_dirs=$ +library_dirs=$ +") -include(${SPARTA_BASE}/cmake/sparta-config.cmake) +# 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() +string(JOIN " " PYTHON_LDFLAGS ${wxWidgets_LIBRARIES}) + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cython.stamp + 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 + ${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 + ${CMAKE_CURRENT_SOURCE_DIR}/setup.cfg + COMMENT "Building pipeViwer and its dependencies" +) +add_custom_target(pipeView ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/cython.stamp) -add_subdirectory(transactiondb) add_subdirectory(transactionsearch) + +install(CODE + "execute_process( + COMMAND ${CMAKE_COMMAND} -E env PYTHONUSERBASE=${CMAKE_INSTALL_PREFIX} ${Python3_EXECUTABLE} -m pip install . + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})" +) + add_subdirectory(argos_dumper) 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/helios/pipeViewer/argos_dumper/CMakeLists.txt b/helios/pipeViewer/argos_dumper/CMakeLists.txt index 87dcc4151b..3fad07fd27 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_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 243a723a66..ce1aaedfbb 100644 --- a/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt +++ b/helios/pipeViewer/argos_dumper/DatabaseDump/CMakeLists.txt @@ -1,6 +1,11 @@ project(Argosdumper) -add_executable(ArgosDumper Database_dumper.cpp) -target_link_libraries (ArgosDumper ${Sparta_LIBS}) +set (CMAKE_CXX_STANDARD 17) +set (CMAKE_CXX_STANDARD_REQUIRED ON) -add_test (NAME ArgosDumperSmokeTestingDB COMMAND ArgosDumper db_pipeout/pipeout) +add_executable(DBDumper Database_dumper.cpp) + +target_include_directories(DBDumper PRIVATE ${CMAKE_SOURCE_DIR}/pipeViewer/pipe_view) +target_link_libraries (DBDumper SPARTA::sparta) + +add_test (NAME DBDumperSmokeTestingDB COMMAND DBDumper db_pipeout/pipeout) 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/__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..9cfedddf83 100755 --- a/helios/pipeViewer/pipe_view/argos.py +++ b/helios/pipeViewer/pipe_view/argos.py @@ -36,19 +36,18 @@ # 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, 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 +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() -> None: rc = 0 logging.getLogger().setLevel(logging.INFO) @@ -234,7 +233,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 +462,7 @@ def replace(match: re.Match[str]) -> str: ws.Cleanup() sys.exit(rc) + + +if __name__ == '__main__': + main() 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/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 d82a6e642c..fb09911190 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 @@ -19,7 +19,7 @@ from .dialogs.shortcut_help import ShortcutHelp 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/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/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/shortcut_help.py b/helios/pipeViewer/pipe_view/gui/dialogs/shortcut_help.py index 81179e4ba4..d6fecf691a 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() 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(__SHORTCUT_ITEMS) + __MESSAGE = _gen_message(__SHORTCUT_ITEMS) def __init__(self, parent: wx.Window, id: int) -> None: wx.Frame.__init__( 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..6bb483b068 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, - TransactionListBaseEntry) +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 44cc77cf4f..9244e58a1d 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 ..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 # @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/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/layout_canvas.py b/helios/pipeViewer/pipe_view/gui/layout_canvas.py index 1da1e2cc1e..3d0be4f623 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..3ab6e4c022 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 ...model.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/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/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/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/database.py b/helios/pipeViewer/pipe_view/model/database.py index 0eae41773a..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 @@ -12,36 +10,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..58f3e83e67 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, @@ -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 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/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 ec2ee4ea07..dca19a14bd 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 8d687cad07..592773aea9 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/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 8155d05600..5336465ee7 100644 --- a/helios/pipeViewer/pipe_view/model/search_handle.py +++ b/helios/pipeViewer/pipe_view/model/search_handle.py @@ -5,16 +5,18 @@ 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): +if TRANSACTION_SEARCH_PROGRAM and os.path.isfile(TRANSACTION_SEARCH_PROGRAM): can_search = True else: # keep looking if not explicitly stated @@ -86,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/settings.py b/helios/pipeViewer/pipe_view/model/settings.py index ba4eea2343..6360eeb1cc 100644 --- a/helios/pipeViewer/pipe_view/model/settings.py +++ b/helios/pipeViewer/pipe_view/model/settings.py @@ -4,8 +4,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/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/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/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/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 new file mode 100644 index 0000000000..cd01234327 --- /dev/null +++ b/helios/pipeViewer/setup.py @@ -0,0 +1,68 @@ +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 += [ + '-Wno-cast-qual', + '-Wno-deprecated-declarations', + '-Wno-strict-aliasing', + '-Wall', + '-Wpedantic' +] + +# Wrappers for the parts written in Cython +transaction_db = setuptools.Extension( + 'pipe_view.transactiondb', + language='c++', + sources=['pipe_view/transactiondb/src/transactiondb.pyx'], + libraries=["sparta", "simdb", "hdf5", "sqlite3"], + pyrex_gdb = True, + extra_compile_args = compile_args, +) +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", ] + +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 + ), + entry_points = { + '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, + setup_requires=[ + 'cython', + 'wxPython', + ], + install_requires=[ + 'wxPython', + ], + tests_require=['pytest'], + zip_safe=False, + ) 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 diff --git a/helios/pipeViewer/transactiondb/CMakeLists.txt b/helios/pipeViewer/transactiondb/CMakeLists.txt deleted file mode 100644 index 3c2c07cae1..0000000000 --- a/helios/pipeViewer/transactiondb/CMakeLists.txt +++ /dev/null @@ -1,49 +0,0 @@ -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) - -################################################################## -# Build the transactiondb.so -################################################################## -# FIXME use consistent cmake recipe for python extensions here and in .. -add_custom_command(OUTPUT transactiondb.sh - COMMAND printf 'SYSINCDIRS="$ENV{SYSINCDIRS}" - 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 ${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) 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/transactiondb/src/.gitignore b/helios/pipeViewer/transactiondb/src/.gitignore deleted file mode 100644 index 559b543d7a..0000000000 --- a/helios/pipeViewer/transactiondb/src/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# cython generated file -/transactiondb.cpp diff --git a/helios/pipeViewer/transactionsearch/CMakeLists.txt b/helios/pipeViewer/transactionsearch/CMakeLists.txt index 8cfffbf1a3..6373d7ecee 100644 --- a/helios/pipeViewer/transactionsearch/CMakeLists.txt +++ b/helios/pipeViewer/transactionsearch/CMakeLists.txt @@ -1,6 +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) -add_dependencies(transactionsearch sparta simdb) -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/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')) diff --git a/sparta/CMakeLists.txt b/sparta/CMakeLists.txt index 8aee89d16f..8d4f4cad53 100644 --- a/sparta/CMakeLists.txt +++ b/sparta/CMakeLists.txt @@ -10,26 +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 a custom CMake Modules directory -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") - -# 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 @@ -214,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} @@ -222,7 +204,13 @@ 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) +set (SPARTA_CMAKE_MACRO_PATH ${SPARTA_BASE}/cmake) # Build the SimDB library add_subdirectory (simdb) @@ -233,9 +221,10 @@ add_subdirectory (simdb) add_subdirectory (test EXCLUDE_FROM_ALL) 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) diff --git a/sparta/README.md b/sparta/README.md index c2c29a4cc1..f2e389399f 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 @@ -74,9 +78,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". @@ -88,6 +96,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. diff --git a/sparta/cmake/FindSparta.cmake b/sparta/cmake/FindSparta.cmake new file mode 100644 index 0000000000..d73991704f --- /dev/null +++ b/sparta/cmake/FindSparta.cmake @@ -0,0 +1,89 @@ +include(FindPackageHandleStandardArgs) + +if(NOT SPARTA_FOUND) + find_package(Boost REQUIRED COMPONENTS timer filesystem serialization program_options) + find_package(HDF5 REQUIRED COMPONENTS CXX) + find_package(SQLite3 REQUIRED) + find_package(ZLIB REQUIRED) + find_package(yaml-cpp REQUIRED) + 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 + 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) + + 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) + endif() + + mark_as_advanced(SPARTA_INCLUDE_DIRS SPARTA_LIBRARIES) + +endif() diff --git a/sparta/simdb/test/TestingMacros.cmake b/sparta/cmake/SimdbTestingMacros.cmake similarity index 95% rename from sparta/simdb/test/TestingMacros.cmake rename to sparta/cmake/SimdbTestingMacros.cmake index 0259a2bc83..c23a6a7475 100644 --- a/sparta/simdb/test/TestingMacros.cmake +++ b/sparta/cmake/SimdbTestingMacros.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. 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/cmake/sparta-config.cmake b/sparta/cmake/sparta-config.cmake index c5d1ba3e00..c66f5ae1b5 100644 --- a/sparta/cmake/sparta-config.cmake +++ b/sparta/cmake/sparta-config.cmake @@ -25,13 +25,6 @@ if (Sparta_VERBOSE) set (CMAKE_FIND_DEBUG_MODE ON) # verbosity for find_package 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}") @@ -45,43 +38,41 @@ else () set (USING_CONDA OFF) 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 () - -set (BUILD_SHARED_LIBS ${existing_build_shared}) +# Find Boost +set (Boost_USE_STATIC_LIBS OFF) +find_package (Boost 1.74.0 REQUIRED COMPONENTS ${_BOOST_COMPONENTS}) +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) +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) +# Find HDF5. +find_package (HDF5 1.10 REQUIRED COMPONENTS CXX) +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 -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 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/CMakeLists.txt b/sparta/simdb/CMakeLists.txt index 84fe33e2b3..83b70091e9 100644 --- a/sparta/simdb/CMakeLists.txt +++ b/sparta/simdb/CMakeLists.txt @@ -6,18 +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_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) diff --git a/sparta/simdb/test/CoreDatabase/CMakeLists.txt b/sparta/simdb/test/CoreDatabase/CMakeLists.txt index 2371a0b09e..11aac6180a 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(${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 10025572ba..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(../TestingMacros.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 5ded471f3d..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(../TestingMacros.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 edea5ca299..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(../TestingMacros.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 51a1f66abc..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(../TestingMacros.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 c6f1ccab8b..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(../../TestingMacros.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 d293f9dad9..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(../TestingMacros.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 86d57b35ce..c0629e8948 100644 --- a/sparta/test/Array/CMakeLists.txt +++ b/sparta/test/Array/CMakeLists.txt @@ -1,5 +1,5 @@ project(Array_test) -include(../TestingMacros.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 1b7f9c4d04..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(../TestingMacros.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 b3f4c08eea..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(../TestingMacros.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 3ab407b163..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(../TestingMacros.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 a28f17e110..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(../TestingMacros.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 0ed092c691..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(../TestingMacros.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 4af1caea28..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(../TestingMacros.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 ce317ae357..edf507a825 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(${SPARTA_CMAKE_MACRO_PATH}/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..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(../TestingMacros.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 bd70dc92be..2b20cc8f6b 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(${SPARTA_CMAKE_MACRO_PATH}/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..283ef4fcd2 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(${SPARTA_CMAKE_MACRO_PATH}/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..89f6c6062d 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(${SPARTA_CMAKE_MACRO_PATH}/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..9fad252078 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(${SPARTA_CMAKE_MACRO_PATH}/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..ef5b77f337 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(${SPARTA_CMAKE_MACRO_PATH}/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..f5b7711542 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(${SPARTA_CMAKE_MACRO_PATH}/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..7cab868a53 100644 --- a/sparta/test/CycleHistogram/CMakeLists.txt +++ b/sparta/test/CycleHistogram/CMakeLists.txt @@ -1,5 +1,6 @@ project(CycleHistogram_test) -include(../TestingMacros.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 911b0b0c02..6029717877 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(${SPARTA_CMAKE_MACRO_PATH}/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)