-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix new suitesparse version and Apple Clang compiling #473
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.
I'm going to let @peddie review this since he's much more familiar with the uses of suitesparse here. I'd prefer to not have preprocessor macros sprinkled throughout the code, but I'm not sure if there's a better option.
Could we enforce a specific version of suitesparse instead of trying to support multiple versions?
@jbangelo The problem without macros is that we will break someone's build setup, if we force to use newer version. My solution is at least safe and not breaking backward compatibility. |
@AlttiJokinen thanks for identifying this and making a fix; sorry the details of this are so annoying. @isaactorz can you think of any reasonable way to solve this at the cmake level rather than in the C++ code? can we enforce that everyone upgrade to suitesparse v5 somehow? can Bazel always use v5? |
Couldn't we just bump the bazel version so it's the same as whatever the latest homebrew is? Line 83 in 95579dd
Alternatively we could use a submodule instead (as much as I generally hate the idea of adding more submodules) - so we drop relying on the system altogether. Either of those are preferable to me than having a macro and running different code depending on which platform/build system you're using. |
Ahhh nevermind that would probably break linux w/ cmake because we don't really know which version is shipped with their package manager |
Is it feasible to at least fail to generate build files and tell the user to go manually install suitesparse 5? is that going too far with cmake? |
So my view here when it comes to cmake is that if you're writing find_package(suiteparse 7.4 REQUIRED) That's idiomatic IMO - it clearly tells the person whose trying to build your software what version they need to install. If it's in their package manager - great, and if not they can build and install from source - which feels geriatric - but that's life in the C++ development ecosystem. But since writing But obviously we're aware of the downsides of that approach when taken to the extreme. I think it's a pick your poison situation here. I'd probably prefer either of those to having a macro in the code. |
My preference is probably to leave the user on her own to install the required version in this case -- |
@peddie So you would prefer breaking backward compatibility by supporting just suitesparser 7.4 ? How about Jenkins pipeline, I think that Linux test using cmake would fail ? Or is cmake Linux also taking latest suitesparser ? I am just wondering that is it worth of benefit to break backward compatibility, because failures in test pipeline ? Who would update necessary Jenkins configurations ? |
I'd prefer breaking backwards compatibility by moving to support just suitesparse 7.5. The serialised objects are already not going to be compatible across versions (they have different fields and different behaviors). So what is the concern about compatibility? I think we would have to get cmake to require suitesparse 7.5 or newer (harder) and fix the Jenkins environment to provide suitesparse 7.5 (easier than working with cmake, I suspect). |
@peddie I changed in the way like you wanted. However, I don't have idea that how to check version in cmake file, but I added check to suitesparse.hpp @peddie @isaactorz How do have idea that why Bazel build fails ? Are these build files somewhere in Swift-repo or they are Suistesoparse ? I used Suitesparse 7.4, because it is still latest on in Homebrew. I can see that they just published 7.5 in their site. |
Someone else wrote a CMake find package for suite sparse, and have the logic to try extracting the version number from the headers here. If we want to check when running CMake we could lift that bit of logic, and probably try to translate it into Bazel as well? |
In bazel we build from source so no need to translate. The sources are fetched using an Line 81 in 95579dd
This avoids needing a submodule, and having to deal with finding the packages on the system - but has the downside that we had to write the build files for the library ourself, which are defined here: https://github.com/swift-nav/rules_swiftnav/blob/main/third_party/suitesparse.BUILD. It looks like if we bump the version we'll have to re-write this build file to match the new sources. |
Thanks. @isaactorz I don't see https://github.com/swift-nav/rules_swiftnav as albatross submodule. If I change https://github.com/swift-nav/rules_swiftnav first before albatross, it will break build for everyone, because old suitesparse is used, but I cannot change albatross before rules_swiftnav, because it will break builds as well. Is the necessary to create completely new build file for suitesparse 7.4 in https://github.com/swift-nav/rules_swiftnav that it would not break builds ? |
@AlttiJokinen We don't have to create a completely new build file for suitesparse 7.4 in Side note: 7.5 is out now, so perhaps it's worth going straight to that? I don't fully understand the Macintosh packaging situation that led to this change, but it would be a shame if the versions of dependencies for the whole project were dictated by whatever homebrew happens to be doing. |
@peddie Yes, Homebrew has also now Suitesparse 7.51 Do you have some automated way to generate suitesparse.BUILD ? Also how I can test this new build file ? How I can make this PR to use build file from swift-nav/rules_swiftnav#129 ? |
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.
OK, no problem for now. Sorry for the runaround -- didn't realise it would turn into such a time sink.
https://swift-nav.atlassian.net/browse/OC-729
Handle new Suitesparse version and dix Apple Clang compiling
Submodule links need to be corrected for Cmake and eigen after these PRs are merged
swift-nav/cmake#171
swift-nav/eigen#4