-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dont include rocksdb lib in the package
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 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
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,64 @@ | ||
diff --git a/setup.py b/setup.py | ||
index a6ba6e3..7fadf92 100644 | ||
--- a/setup.py | ||
+++ b/setup.py | ||
@@ -40,9 +40,6 @@ third_party_install_dir = os.environ.get('AIM_DEP_DIR', '/usr/local') | ||
third_party_deps = ['rocksdb'] | ||
|
||
third_party_lib_dir = os.path.join(third_party_install_dir, 'lib') | ||
-third_party_libs = glob(os.path.join(third_party_lib_dir, 'librocksdb.*')) | ||
- | ||
-third_party_headers = [os.path.join(third_party_install_dir, 'include/rocksdb')] | ||
|
||
# We define a local include directory to store all the required public headers. | ||
# The third party headers are copied into this directory to enable binding with | ||
@@ -54,17 +51,25 @@ local_lib_dir = os.path.abspath( | ||
os.path.join(os.path.dirname(__file__), 'src/aimrocks') | ||
) | ||
|
||
-print('third party libs detected:', third_party_libs) | ||
-for source in third_party_libs: | ||
- print('copying third party lib', source, local_lib_dir) | ||
- copy_file(source, local_lib_dir) | ||
+if os.environ.get("EMBED_ROCKSDB", "1") == "1": | ||
+ | ||
+ third_party_libs = glob(os.path.join(third_party_lib_dir, 'librocksdb.*')) | ||
|
||
-for source in third_party_headers: | ||
- basename = os.path.basename(source) | ||
- destination = os.path.join(local_include_dir, basename) | ||
- copy_tree(source, destination, | ||
- preserve_symlinks=False, update=True) | ||
+ print('third party libs detected:', third_party_libs) | ||
+ for source in third_party_libs: | ||
+ print('copying third party lib', source, local_lib_dir) | ||
+ copy_file(source, local_lib_dir) | ||
|
||
+ third_party_headers = [os.path.join(third_party_install_dir, 'include/rocksdb')] | ||
+ for source in third_party_headers: | ||
+ basename = os.path.basename(source) | ||
+ destination = os.path.join(local_include_dir, basename) | ||
+ copy_tree(source, destination, | ||
+ preserve_symlinks=False, update=True) | ||
+ | ||
+# `include_dirs` is used to specify the include directories for the extension. | ||
+# It contains the aimrocks local headers and the rocksdb ones. | ||
+include_dirs = [os.path.join(third_party_install_dir, 'include/'), local_include_dir] | ||
|
||
exts = [ | ||
Extension( | ||
@@ -73,13 +78,12 @@ exts = [ | ||
extra_compile_args=aimrocks_extra_compile_args, | ||
extra_link_args=aimrocks_extra_link_args, | ||
language='c++', | ||
- include_dirs=[local_include_dir], | ||
+ include_dirs=include_dirs, | ||
library_dirs=[third_party_lib_dir], | ||
libraries=['rocksdb'], | ||
) | ||
] | ||
|
||
- | ||
setup( | ||
name="aimrocks", | ||
version='0.2.1', |