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

Adding Metis and GKlib as ExternalProject in CMake #16

Open
gnikit opened this issue Jul 6, 2022 · 0 comments
Open

Adding Metis and GKlib as ExternalProject in CMake #16

gnikit opened this issue Jul 6, 2022 · 0 comments

Comments

@gnikit
Copy link

gnikit commented Jul 6, 2022

I was wondering if it would be more convenient adding Metis and GKlib as external projects to ParMetis, or adding GKlib as an external project to Metis and Metis to ParMetis, thus eliminating the need to be built seperately.

Something like this should work (snippet is for building Zoltan, not Metis but you get the idea).

ExternalProject_Add(libmetis
  PREFIX Zoltan
  GIT_REPOSITORY https://github.com/
  GIT_TAG origin/main
  CONFIGURE_COMMAND ${ZOLTAN_CONFIGURE}
  BUILD_COMMAND make everything
  BUILD_BYPRODUCTS <BINARY_DIR>/src/libzoltan.a
  INSTALL_COMMAND ""
  LOG_DOWNLOAD ON
  LOG_CONFIGURE ON
  LOG_BUILD ON
)
ExternalProject_Get_property(libzoltan BINARY_DIR)
set(Zoltan_BINARY_DIR ${BINARY_DIR})
add_library(Zoltan STATIC IMPORTED)
add_dependencies(Zoltan libzoltan)
set_target_properties(Zoltan
  PROPERTIES IMPORTED_LOCATION ${Zoltan_BINARY_DIR}/src/libzoltan.a
)

Docs for ExternalProject_Add.

This would also, mostly, eliminate the need to carry the Makefile which produces the build directory.

Let me know what you think.

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

No branches or pull requests

1 participant