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

fix/python #133

Merged
merged 3 commits into from
Jan 18, 2025
Merged

fix/python #133

merged 3 commits into from
Jan 18, 2025

Conversation

jcelerier
Copy link
Member

  • python: build fixes
  • python: start adding api configurations

@pstiasny
Copy link

Thanks! That clears the previous errors but looks like I'm missing a boost lib (I have boost 1.87.0 installed from brew):

/Users/pawel/clones/libremidi/bindings/python/pylibremidi.cpp:3:10: fatal error: 'boost/variant2.hpp' file not found
    3 | #include <boost/variant2.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~

@jcelerier
Copy link
Member Author

jcelerier commented Jan 14, 2025

boost/variant2 has been there for many releases, I'd assume that it is getting an older version from somewhere on your hard drive. Did you try brew cleanup maybe to remove old versions ? otherwise can you share the result $ grep -i boost CMakeCache.txt ? it should tell all the folders in which it's looking for it

@pstiasny
Copy link

pstiasny commented Jan 14, 2025

$ grep -i boost CMakeCache.txt
//Actively look for Boost
LIBREMIDI_FIND_BOOST:BOOL=OFF
//Do not use Boost if available
LIBREMIDI_NO_BOOST:BOOL=OFF

Overriding with cmake -DLIBREMIDI_FIND_BOOST=1 . made it find the directory correctly.

However, I'm now encountering another dependency issue:

/Users/pawel/clones/libremidi/bindings/python/pylibremidi.cpp:13:10: fatal error: 'readerwriterqueue.h' file not found
   13 | #include <readerwriterqueue.h>
      |          ^~~~~~~~~~~~~~~~~~~~~
1 error generated.

I tried adding a directive to CMakeLists as in here - does not seem to make a difference.

@jcelerier
Copy link
Member Author

for this last one it's strange, CMake should download it on its own. It does when I test on Linux. will try on mac later.

@pstiasny
Copy link

Got a successfull build with this change:

diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
index f914daa..58d2334 100644
--- a/bindings/python/CMakeLists.txt
+++ b/bindings/python/CMakeLists.txt
@@ -12,5 +12,16 @@ FetchContent_Declare(
 )

 FetchContent_MakeAvailable(nanobind)
+
+FetchContent_Declare(
+  readerwriterqueue
+  GIT_REPOSITORY https://github.com/cameron314/readerwriterqueue
+  GIT_TAG        master
+)
+
+FetchContent_MakeAvailable(readerwriterqueue)
+
+
 nanobind_add_module(pylibremidi pylibremidi.cpp)
 target_link_libraries(pylibremidi PUBLIC libremidi)
+target_include_directories(pylibremidi PUBLIC SYSTEM $<BUILD_INTERFACE:${readerwriterqueue_SOURCE_DIR}>)

@jcelerier
Copy link
Member Author

ahh I see ! this code is already in libremidi but right now it only triggered on linux : https://github.com/celtera/libremidi/blob/master/cmake/libremidi.deps.cmake#L38

will just enable it unconditonally

@jcelerier jcelerier added this pull request to the merge queue Jan 18, 2025
Merged via the queue into master with commit ba6732f Jan 18, 2025
85 checks passed
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.

2 participants