Skip to content
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

Project modernization #79

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

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

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.

@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 <[email protected]>
@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.

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.

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