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

Windows: DLL copied to the wrong directory #883

Open
Tillsten opened this issue Aug 31, 2024 · 3 comments
Open

Windows: DLL copied to the wrong directory #883

Tillsten opened this issue Aug 31, 2024 · 3 comments

Comments

@Tillsten
Copy link

Tillsten commented Aug 31, 2024

Hi,

i am trying the get a nanobind binding to the Blend2D libarary running. However, the scikit-build does not place the dll correctly. Instead of the libary directory next to the pyd it gets placed into site-packages/bin for some reasone. Any hint?

cmake_minimum_required(VERSION 3.15)

project(${SKBUILD_PROJECT_NAME}
        VERSION ${SKBUILD_PROJECT_VERSION}
        LANGUAGES C CXX)

find_package(Python 3.8
  REQUIRED COMPONENTS Interpreter Development.Module
  OPTIONAL_COMPONENTS Development.SABIModule)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/blend2d)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/nanobind)

find_package(nanobind CONFIG REQUIRED)

nanobind_add_module(
  # Name of the extension
  blend2dpy_ext

  # Target the stable ABI for Python 3.12+, which reduces
  # the number of binary wheels that must be built. This
  # does nothing on older Python versions
  STABLE_ABI

  # Build libnanobind statically and merge it into the
  # extension (which itself remains a shared library)
  #
  # If your project builds multiple extensions, you can
  # replace this flag by NB_SHARED to conserve space by
  # reusing a shared libnanobind across libraries
  NB_STATIC


  # Source code goes here
  src/blend2dpy_ext.cpp
)

target_include_directories(blend2dpy_ext PRIVATE "${BLEND2D_DIR}/src")
target_link_libraries(blend2dpy_ext PRIVATE blend2d::blend2d)

install(TARGETS blend2dpy_ext DESTINATION ${SKBUILD_PROJECT_NAME})
@LecrisUT
Copy link
Collaborator

LecrisUT commented Sep 2, 2024

Could you re-run it with verbose options? Maybe even debug logging:

pip install . -v --config-settings=cmake.verbose=true --config-settings=logging.level=DEBUG

@henryiii
Copy link
Collaborator

henryiii commented Sep 3, 2024

I expect this is an issue with add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/blend2d) having an install command that's incorrectly specified. It's probably fixable without modifying the code there (though I'd guess that would be better). I'll try to look soon, ping me if needed.

@henryiii
Copy link
Collaborator

henryiii commented Sep 3, 2024

Do you have a repo where I can try a few things?

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

3 participants