-
Notifications
You must be signed in to change notification settings - Fork 202
Project modernization #79
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
base: master
Are you sure you want to change the base?
Conversation
cmake create the metis.h when generate.
dcd9efc to
2050292
Compare
|
I don't want to sound overly pessimistic, but what gives you the confidence that Prof. Karypis will merge your code? There are trivial pull requests waiting for months to get any feedback. Also simple things like creating a tag for GKlib to create initial packages are not happening. |
This is due to the octopus project being keen on using METIS as a hard-dependency. I need to make these cahnges to be able to import it there anyway so I will be maintaining my fork that other people can use as well. This MR will be here for when Prof. Karypis wishes to make these changes official. |
1cb8be1 to
33d2e6b
Compare
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
33d2e6b to
7779366
Compare
This resolves the compatibility with `set_package_properties()` Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
|
@gruenich If you find it useful feel free to give it a try. Right now the project is importable, and I will test on octopus if it is usable in this form. The tests I couldn't get them to work properly, but with some feedback we can see this through. |
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
| target_link_libraries(METIS_METIS PRIVATE GKlib::GKlib) | ||
|
|
||
| if (TARGET GKlib_GKlib) | ||
| target_compile_options(GKlib_GKlib PRIVATE -fPIC) |
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.
use POSITION_INDEPENDENT_CODE
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.
Indeed, it is marked as a temp commit because I am not sure how to properly handle it. Should GKlib become a shared library and be installed together with METIS, or remain a static, but patch it to be PIC. This is the first time I've encountered where this has become an issue so I'm not 100% sure of the proper handling. I'm leaning towards the latter.
| LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT METIS_Runtime NAMELINK_COMPONENT METIS_Development | ||
| ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT METIS_Development | ||
| PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT METIS_Development | ||
| RUNTIME DESTINATION ${CMAKE_INSTALL_RUNTIMEDIR} COMPONENT METIS_Runtime |
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.
CMAKE_INSTALL_BINDIR
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, not sure where that came from when copying from my other projects
|
Is this repo still actively maintained by Prof. Karypis? Hope this PR will be merged soon. |
1 similar comment
|
Is this repo still actively maintained by Prof. Karypis? Hope this PR will be merged soon. |
augusew1
left a comment
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.
Once again, thank you for doing this! I am testing on Windows and found these bugs. Otherwise, this works great and I'm able to build the project quite easily.
| GIT_TAG cmake/modernization | ||
| FIND_PACKAGE_ARGS ${gklib_find_package_args} | ||
| ) | ||
| METIS_FetchContent_MakeAvailable(GKlib) |
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.
While this is correct in principle, it excludes the possibility of using a pre-built gklib via cmake, which you spent effort on in your other PR. So I think something like this would be better:
find_package(GKlib)
if (NOT TARGET GKlib::GKlib)
# ......
# FetchContent_Declare(....
endif()I modified this locally and find_package(GKlib) works great with your other 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.
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.
Sure, I can revisit this and see what I need to update. I have gained quite a few insight in CMake design since writing this and I would want to simplify this quite a bit.
But first, I would suggest considering where to host ongoing maintenance, since this repo is dead. I do not have the domain knowledge to maintain this, just the build-system knowledge to assist. @scivision also provides a variant that is used in downstream https://github.com/scivision/METIS, but I don't know if that isn't a similar story as well.
If there are interested maintainers, I would suggest making an organization, and soft-forking the project and continue there officially.
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.
Sure, I can revisit this and see what I need to update. I have gained quite a few insight in CMake design since writing this and I would want to simplify this quite a bit.
But first, I would suggest considering where to host ongoing maintenance, since this repo is dead. I do not have the domain knowledge to maintain this, just the build-system knowledge to assist. @scivision also provides a variant that is used in downstream https://github.com/scivision/METIS, but I don't know if that isn't a similar story as well.
If there are interested maintainers, I would suggest making an organization, and soft-forking the project and continue there officially.
scivision's fork of METIS does not work as expected at the time I tested it. See the issue I opened there. I use his CMake repository for MUMPS, which is actively updated.
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.
Weird looking at the implemenation, I see that we have the same approach in
scivision/METIS@ae95e7a#diff-1fa6d22cb50f611cea6c06a4523dc8602907d4b30b6da0d05b6cce52fb18a546
They have added it as -Dintsize/-Drealsize, but it was not added as a proper cache variable in
https://github.com/scivision/METIS/blob/7f8f9b0d765c15efe3eefe3e9db0a9faf9a5f480/CMakeLists.txt#L16-L21
Probably they have overlooked that issue.
I suspect that a more proper solution is to redefine that variable since some other users seem to manually #define that macro in order to get it to work which clashes with the configured file #define. But these design issues are the things where a proper maintainer is preferred to actually state what is the usage and what fix is preferred.
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.
It looks like there is renewed interest in updating the bulid system. So it would be nice to clean up this PR and make sure it works on Windows as well as Linux. Additionally, while I wouldn't say I'm the biggest fan of cmake overall, I do see some improvements that could be made to the branch overall. I'm more than willing to collaborate on that.
| include(FetchContent) | ||
| if (METIS_INSTALL) | ||
| include(CMakePackageConfigHelpers) | ||
| if (UNIX) |
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.
This should be unconditional, as you use e.g. CMAKE_INSTALL_BINDIR elsewhere. It's not a problem to use GNUInstallDirs on Windows.
| # Configure main target to consume the metis.h | ||
| # TODO: Move to FILE_SET for cmake 3.23 | ||
| set_target_properties(METIS_METIS PROPERTIES | ||
| PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/metis.h |
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.
This should be CMAKE_CURRENT_BINARY_DIR
Coming in are a bunch of project modernization. I will make a summary of all of the changes later on. Requires an equivalent change in GKlib, coming soon
Pinging @shengjianda as they initiated this movement
Closes #10, #18
Depends on: KarypisLab/GKlib#33