-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Knutel/peter d cmake include fixes #397
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much cleaner already, nice - but a few remarks in the comments.
Also I was thinking: it's not very easy to see based on the config file what I need to do if I build a project to also link against libsparta or libsimdb...
It would be the most user friendly if you can just add Sparta to the target_link_libraries
statement.
And we did still break the examples in CI, though they build in this branch for me locally... |
Agreed! |
Hi Knute, In trying to get my cmake file to find sparta up and running and testing it on building Olympia, I've noticed that Olympia depends on a few parts of the sparta tests folder:
I was currently moving to a setup where make install installs:
Should the test code be installed as well? Right now That said: I've come to a point where it can Olympia can find sparta after a make install, generate all makefiles but then fails as it cannot include files from map/sparta/test (in my case I need to point it to the right folder with a command line arg, as it is not installed in a system wide location like /usr/local or such) |
Yep, expected.
Olympia depends on the tests? Odd (and sounds broken).
My original intent was just a dependency on the TestingMacros.cmake. I'm wondering if the install target could copy that file over... But your previous statement has be concerned.
That's AWESOME! And a bummer on the testing. None of this is set in stone. If this becomes too complex, other routes can be explored. Thanks for helping with this. |
That’s what I did now. It sits next to FindSparta.cmake and gets included when you find_package(Sparta). But turns out that’s not enough to get Olympia to build. I’m not at my computer tonight but will do some more digging on the test dependencies once I can. |
The culprit is Dispatch, which instantiates a A quick grep shows that this is the only place where this happens. Which then of course gives problems:
Looks to me like either that example weighted counter is useful enough to be part of sparta proper (there might be others like it?), or we should add the file to Olympia as a utility defined and used locally there. |
I've pushed what I have for now - FindSparta.cmake courtesy of my colleague @tomhaber, who put this together. A few things we should fix here before this is ready to merge:
|
So, ignoring the dependency on the counter from test, I also see Olympia needs What's the intent there? is cache supposed to be a fixed part of sparta? Or is it more like stf_lib and mavis, a set of utilities you can optionally use on top of/with sparta? Depending on that answer, it's relatively easy to install it, but question is if we want to/should. |
I had a quick look at pipeViewer/argos as well on how to install it properly, so it can be nicely used from projects like Olympia without needing the full sparta source as dependency, but it's net very clear what depends on what, with the mix of CPP, Python and Cython and If you know how that's structured, I can help pulling out all the right bits at |
3af0543 fails in CI :( On my system (no conda), cmake would find the right python (from homebrew) with So I fixed that, such that it finds the PythonInterp (and I can overrule that one from cmd line if needed, with the standard options). But that seems to now find the wrong one in CI... (probably due to the note here) I've updated to the recommended more modern way to find Python3, let's hope that fixes CI... ps this is quickly becoming a very deep rabbit hole ;-) |
Ugh, I have NO idea how that happened. Yes, it can be made proper esp since it has it own test. I'll work on that. |
Getting closer! The ArgosDumper tool needs the |
Yahoo!!! 100% pass! |
Great! I can confirm it still builds nicely on my end as well. One minor nitpick, I get (got it before as well I think, so it's not a side effect from the last few commits) a warning from setuptools on Other than that: looks good to go for me! |
… into knutel/peter-d_cmake_include_fixes
Gonna shoot for merging this PR this week. |
Anything I can/should do to help? |
Nope! About the push the Big Green Button! We needed to shut down auto-pulls and testing with our models here. |
Actually, Peter, do you mind putting up your PR for the risc-v performance model again? |
It’s there: riscv-software-src/riscv-perf-model#42 |
Overview -------- Overhaul of MAP build system and included proper support for installation Updated Documentation Updated/Cleaned up Argos and simplified build system Various bug fixes Details ------- * simpler boost detection on mac * cmake clean up: target specific include paths * boost 1.76 * boost 1.72 specific magic no longer needed * Moved reliance on include paths back to sparta.cmake file * Made simdb include a private include * PUBLIC includes for Sparta and SimDB to pass to regression * cmake file to enable find_package(Sparta) in other projects * make sure core setup.py actually uses the interpreter found by find_package(PythonInterp) * more modern way to find python3, hopefully also robust in conda/venv * cleaner cmake for testing macros for simdb and sparta * helios build now using FindSparta.cmake * pipeviewer cannot use find_package(sparta), which only works once installed * installing all py files and libs but module paths don't work yet after install * simpler setup for cython build - working for transactiondb, rest todo * cleaner HDF5 libs config for sparta * Documentation cleanup * Major overhaul of how argos ties into cmake * cmake pushes all config into setuptools via setup.cfg where possible (such that all found libs in cmake and sparta deps are automatically in sync with rest of the build) * python setup.py then manages the cythonized build *and* installation of all python files by doing python setup.py install * Cleaned up all python imports so they are relative imports (previously mixed absolute vs relative which breaks when you install the package) * relocated some of the cython files in the source tree for easier build and install * Fixed static method calls w/o object * Move __is_mac_os and __gen_message outside of the ShortcutHelp class * Clean up flake8 errors * make sure setuptools and cython use the right C/CXX/LD * proper dependencies for setup.py * gui script vs console script: should properly call pythonw * build argos_dumper again * _ vs __ otherwise cannot find the free helper functions in the class * Move sparta library target towards the end of sparta/CMakeLists.txt so it picks up all of the compile/link flags Bump required Boost version down to 1.74 so we can build on default Ubuntu environment * Pass CMAKE_INSTALL_PREFIX to setup.py install - Enables installing package to a non-default directory * Add Github workflow to run linters on Argos Reorganize mypy stubs and .ini locations to work with relative imports in Argos Use pip instead of (deprecated) setup.py install to install Argos - Also properly handle non-default install prefix * Set a a CMAKE_MACRO file path for the testers; allows sparta build anywhere * Update README.md for Conda on MacOS * seperated build for sparta and helios folder * Updated README and build rules for new layout * Fixed bad dir path in regression * Renamed DatabaseDump tool * Added missing rt library for Linux builds * Put in check for CPP check module * Fixed new compilation issue with HDF test * ANOTHER HDF5 test fix * Forced HDF5 test to be C++ testing * Removed rt library link * ONE more tweak: use CXX version of HDF5 * Fixed formatting * Updated README with install directions --------- Co-authored-by: Peter Debacker <[email protected]> Co-authored-by: Brett Dutro <[email protected]> Co-authored-by: Benoy Alexander <[email protected]> 4033e18
This fixes #35 and tracks the changes in Sparta [PR397(sparcians/map#397), which are merges into Sparta main already. --------- Signed-off-by: Peter Debacker <[email protected]> Signed-off-by: Knute Lingaard <[email protected]> Co-authored-by: Peter Debacker <[email protected]> Co-authored-by: Knute Lingaard <[email protected]> Co-authored-by: Knute Lingaard <[email protected]>
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this PR fixes quite a few things but I'm coming across this. Putting SimdbTestingMacros.cmake
in Sparta's cmake/
subdirectory and defining SPARTA_CMAKE_MACRO_PATH
in the toplevel sparta/CmakeLists.txt
makes it so that simdb can't be built and regressed on it's own as a "cmake project". @klingaard Was this intended? Seems slightly odd if not broken to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch - I think this is indeed odd to say the least. It probably should be in sparta/simdb/cmake
.
It should probably also be removed here as well:
map/sparta/cmake/FindSparta.cmake
Line 90 in 64e119f
include(${CMAKE_CURRENT_LIST_DIR}/SimdbTestingMacros.cmake) |
For context, as far as I remember correctly:
SpartaTestingMacros.cmake
needs to be exposed with all the other cmake files for sparta, wherever sparta is built or installed, as olympia and possibly other projects depend on it: it uses thesparta_regress
macro. That is why I moved that file to the toplevelcmake
folder. (that's not a very clean approach in olympia, imo, but we didn't want to break that)- I think @klingaard and I did the same for
SimdbTestingMacros.cmake
, simply by analogy. But it's probably not needed outside the sparta build tree. And even if it were, we should do that in such a way that simdb can be built and run stand-alone.
As a side note: SimdbTestingMacros.cmake
is now included in every CMakeLists.txt
file in the subfolder for every simdb test. Won't it be more logical (and cleaner) to include this once, 1 level up in sparta/simdb/test/CMakeLists.txt
?
No description provided.