-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to version 4.3.0 and try to include headers in result.
- Loading branch information
Showing
8 changed files
with
91 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ConfigureFileOnly.cmake: generate an mlpack binding file given input | ||
# arguments, using the @ONLY option. | ||
# | ||
# This file depends on the following variables being set: | ||
# | ||
# * GENERATE_CPP_IN: the .cpp.in file to configure. | ||
# * GENERATE_CPP_OUT: the .cpp file we'll generate. | ||
# | ||
# Any other defined variables will be passed on to the file that is being | ||
# generated. | ||
configure_file(${GENERATE_CPP_IN} ${GENERATE_CPP_OUT} @ONLY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
prefix=${pcfiledir}/../../ | ||
includedir=${prefix}/include | ||
|
||
Name: mlpack | ||
Description: a flexible, fast machine learning library | ||
Version: @PACKAGE_VERSION@ | ||
Cflags: -I${includedir} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- mlpack-4.3.0/src/mlpack/bindings/python/setup.py.in 2023-11-27 13:27:20.000000000 -0500 | ||
+++ mlpack-4.3.0-mod/src/mlpack/bindings/python/setup.py.in 2023-12-11 16:58:43.457383940 -0500 | ||
@@ -116,6 +116,12 @@ | ||
else '${DISABLE_CFLAGS}'.split(' ')) \ | ||
for name in pyxs] | ||
|
||
+# Find all include files. | ||
+include_files = [] | ||
+for (path, directories, filenames) in os.walk('include/'): | ||
+ for filename in filenames: | ||
+ include_files.append(os.path.join('..', path, filename)) | ||
+ | ||
setup(name='mlpack', | ||
version='${PACKAGE_VERSION}', | ||
description='a flexible, fast machine learning library', | ||
@@ -141,6 +147,8 @@ | ||
install_requires=['cython>=0.24', 'numpy', 'pandas'], | ||
package_dir={ '': '.' }, # Might be superfluous. | ||
packages=['mlpack'], | ||
+ package_data={ '': include_files + ['share/pkgconfig/mlpack.pc'] }, | ||
+ include_package_data=True, | ||
cmdclass={ 'build_ext': build_ext }, | ||
ext_modules = modules, | ||
setup_requires=['cython', 'pytest-runner'], | ||
--- mlpack-4.3.0/src/mlpack/bindings/python/CMakeLists.txt 2023-11-27 13:27:20.000000000 -0500 | ||
+++ mlpack-4.3.0-mod/src/mlpack/bindings/python/CMakeLists.txt 2023-12-11 16:59:03.689447094 -0500 | ||
@@ -158,6 +158,23 @@ | ||
${CMAKE_CURRENT_SOURCE_DIR}/setup_readme.md | ||
${CMAKE_BINARY_DIR}/src/mlpack/bindings/python/) | ||
|
||
+# Copy all mlpack headers for inclusion in the package. | ||
+add_custom_command(TARGET python_copy PRE_BUILD | ||
+ COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory | ||
+ ${CMAKE_SOURCE_DIR}/src/ | ||
+ ${CMAKE_BINARY_DIR}/src/mlpack/bindings/python/include/) | ||
+ | ||
+# Generate pkgconfig file for easy use of included headers. | ||
+add_custom_target(python_pkgconfig | ||
+ COMMAND ${CMAKE_COMMAND} | ||
+ -D GENERATE_CPP_IN=${CMAKE_SOURCE_DIR}/src/mlpack/bindings/python/mlpack.pc.in | ||
+ -D GENERATE_CPP_OUT=${CMAKE_BINARY_DIR}/src/mlpack/bindings/python/share/pkgconfig/mlpack.pc | ||
+ -D PACKAGE_VERSION="${PACKAGE_VERSION}" | ||
+ -P "${CMAKE_SOURCE_DIR}/CMake/ConfigureFileOnly.cmake" | ||
+ BYPRODUCTS "${CMAKE_BINARY_DIR}/src/mlpack/bindings/python/share/pkgconfig/mlpack.pc" | ||
+ COMMENT "Configuring Python mlpack.pc...") | ||
+add_dependencies(python_copy python_pkgconfig) | ||
+ | ||
if (BUILD_TESTS) | ||
foreach(test_file ${TEST_SOURCES}) | ||
add_custom_command(TARGET python_copy PRE_BUILD |