Skip to content

Conversation

@LecrisUT
Copy link

@LecrisUT LecrisUT commented Oct 26, 2023

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

@gruenich
Copy link
Contributor

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.
Maybe wait until you get some reactions or things merged, before you invest too much time.

@LecrisUT
Copy link
Author

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.

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.

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>
@LecrisUT LecrisUT force-pushed the cmake/modernization branch from 33d2e6b to 7779366 Compare October 27, 2023 14:31
This resolves the compatibility with `set_package_properties()`

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
@LecrisUT LecrisUT marked this pull request as ready for review October 27, 2023 15:25
@LecrisUT
Copy link
Author

@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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use POSITION_INDEPENDENT_CODE

Copy link
Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMAKE_INSTALL_BINDIR

Copy link
Author

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

@adam-sim-dev
Copy link

Is this repo still actively maintained by Prof. Karypis? Hope this PR will be merged soon.

1 similar comment
@adam-sim-dev
Copy link

Is this repo still actively maintained by Prof. Karypis? Hope this PR will be merged soon.

Copy link

@augusew1 augusew1 left a 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)

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LecrisUT Could you please address these comments by @augusew1 so we can use your lastest branch?

Copy link
Author

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.

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.

Copy link
Author

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.

Copy link

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)

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide MetisConfig.cmake

6 participants