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

cmake/conan.cmake missing from PyPI source tarball of krbalancing 0.5.0b0 #24

Open
boegel opened this issue Feb 15, 2023 · 6 comments
Open

Comments

@boegel
Copy link

boegel commented Feb 15, 2023

The source tarball available on PyPI for krbalancing 0.5.0b0 is missing cmake/conan.cmake, which leads to the following errors when trying to build from those sources:

  CMake Error at CMakeLists.txt:20 (include):
    include could not find requested file:

      /tmp/krbalancing-0.5.0b0/cmake/conan.cmake


  --  project version 0.5.0b0
  CMake Error at CMakeLists.txt:33 (conan_cmake_configure):
    Unknown CMake command "conan_cmake_configure".


  -- Configuring incomplete, errors occurred!

It seems like 0.5.0b0 was published on PyPI by @dilawar using changes in the the open pull request #22 ?

@boegel
Copy link
Author

boegel commented Feb 15, 2023

I danced around this by downloading the sources from //github.com/dilawar/Knight-Ruiz-Matrix-balancing-algorithm/archive/v0.5.0b0.tar.gz, and also applying this patch to fix some problems with the current version of conan (1.58.0):

remove workaround for problem with conan and pybind11 (which is fixed in recent conan versions),
and fix for: ERROR: No remote 'conan-center' defined in remotes
author: Kenneth Hoste (HPC-UGent)
--- Knight-Ruiz-Matrix-balancing-algorithm-0.5.0b0/CMakeLists.txt.orig	2023-02-15 10:51:06.719532727 +0100
+++ Knight-Ruiz-Matrix-balancing-algorithm-0.5.0b0/CMakeLists.txt	2023-02-15 10:50:25.589499665 +0100
@@ -27,31 +27,20 @@
 message(STATUS " project version ${CMAKE_PROJECT_VERSION}")
 add_definitions(-DCMAKE_PROJECT_VERSION=\"${CMAKE_PROJECT_VERSION}\")
 
-# pybind11 config file has a bug that makes is impossible to use with
-# conan_cmake_configure.
-# https://github.com/conan-io/conan-center-index/pull/4445
 conan_cmake_configure(REQUIRES 
-    # pybind11/2.6.1
+    pybind11/2.6.1
     eigen/3.3.9
     GENERATORS cmake_find_package)
-# find_package(pybind11 REQUIRED)
 
 conan_cmake_autodetect(settings)
 conan_cmake_install(PATH_OR_REFERENCE .
     BUILD missing
-    REMOTE conan-center
+    REMOTE conancenter
     SETTINGS ${settings})
 
+find_package(pybind11 REQUIRED)
 find_package(Eigen3 REQUIRED)
 
-
-# hack around pybind11 bug 
-# https://github.com/conan-io/conan-center-index/pull/4445
-conan_cmake_run(REQUIRES pybind11/2.6.1 
-    BASIC_SETUP NO_OUTPUT_DIRS CMAKE_TARGETS
-    BUILD missing)
-
-
 pybind11_add_module(krbalancing  src/krbalancing.cpp)
-target_link_libraries(krbalancing PRIVATE Eigen3::Eigen CONAN_PKG::pybind11)
+target_link_libraries(krbalancing PRIVATE Eigen3::Eigen pybind11::pybind11)
 target_link_libraries(krbalancing PRIVATE OpenMP::OpenMP_CXX)

@dilawar
Copy link

dilawar commented Feb 15, 2023

@boegel Thanks for the changes. I'd be happy to merge these changes to my fork.

I needed a wheel (pip compatible) for my cicd pipeline hence I published the wheel. Unfortunately, pypi doesn't still have namespace support. Anyway, I might have used a slightly different name.

Not sure what is the best way forward.

@boegel
Copy link
Author

boegel commented Feb 15, 2023

@dilawar I'm happy to open a pull request, but should I then send it to your fork (since #22 is not merged)?
Is that the new official upstream for the project?

@dilawar
Copy link

dilawar commented Feb 15, 2023

@dilawar I'm happy to open a pull request, but should I then send it to your fork (since #22 is not merged)?

Yes. That's the best way forward since there is no update on #22.

Is that the new official upstream for the project?

No.

@boegel
Copy link
Author

boegel commented Feb 16, 2023

Is that the new official upstream for the project?

No.

But that fork is used to publish new releases on PyPI though? Doesn't that make it official? 🤔

@dilawar
Copy link

dilawar commented Feb 16, 2023

But that fork is used to publish new releases on PyPI though? Doesn't that make it official? 🤔

I opened #22 because this package was not available on PyPI but was available on conda. I needed a package that could be installed using pip because I was not using conda. I published it on PyPI because it there was no pypi package before. I will hand over the PyPI package to the owner of this repo happily.

I should add a note in README that it is not an official package.

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

2 participants