Skip to content

Commit ce9fd95

Browse files
committed
Build stuff.
1 parent f8184ce commit ce9fd95

File tree

6 files changed

+24
-4
lines changed

6 files changed

+24
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ parts/
443443
sdist/
444444
var/
445445
wheels/
446+
wheelhouse/
446447
share/python-wheels/
447448
*.egg-info/
448449
.installed.cfg

CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O2")
1919
find_package(Python COMPONENTS Interpreter Development)
2020
add_subdirectory(lib/pybind11)
2121

22-
if (Python_FOUND)
22+
if (Python_FOUND OR Python_INCLUDE_DIRS)
2323
add_compile_definitions(WITH_PYTHON_H)
2424
endif()
2525

@@ -132,6 +132,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
132132
endif()
133133
endif()
134134

135+
target_link_libraries(backend PRIVATE -static-libgcc -static-libstdc++)
135136
target_link_libraries(backend PRIVATE ${Nyxus_LIBRARIES})
136137
target_link_libraries(backend PRIVATE ${Python_LIBRARIES})
137138

build-wheels.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
PYTHON_VERSIONS=("cp36-cp36m" "cp37-cp37m" "cp38-cp38" "cp39-cp39")
2+
3+
for PYTHON_VERSION in ${PYTHON_VERSIONS[@]}; do
4+
env CMAKE_ARGS="-DPython_INCLUDE_DIR=/opt/python/${PYTHON_VERSION}/include/python3.6m -DPython_LIBRARY=/opt/python/${PYTHON_VERSION}/lib/" /opt/python/${PYTHON_VERSION}/bin/python setup.py bdist_wheel -d dist
5+
6+
done
7+
8+
for whl in ./dist/*.whl; do
9+
auditwheel repair --plat manylinux2010_x86_64 $whl -w ./dist
10+
rm $whl
11+
done

setup.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[versioneer]
22
# Automatic version numbering scheme
33
VCS = git
4-
style = pep440
4+
style = pep440-pre
55
versionfile_source = src/nyx/python/nyxus/_version.py
6-
versionfile_build = src/nyx/python/nyxus/_version.py
6+
versionfile_build = nyxus/_version.py
77
tag_prefix = ''

setup.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,15 @@ def build_extension(self, ext):
6969
env["CXXFLAGS"] = '{} -DVERSION_INFO=\\"{}\\"'.format(
7070
env.get("CXXFLAGS", ""), self.distribution.get_version()
7171
)
72+
73+
if len(os.environ.get("CMAKE_ARGS", "")):
74+
cmake_args += os.environ.get("CMAKE_ARGS", "").split(" ")
75+
7276
if not os.path.exists(self.build_temp):
7377
os.makedirs(self.build_temp)
7478
print("--------------- cmake_args=" + str(cmake_args))
7579
print("--------------- build_args=" + str(build_args))
80+
7681
subprocess.check_call(
7782
["cmake", ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env
7883
)
@@ -102,5 +107,5 @@ def build_extension(self, ext):
102107
test_suite="tests",
103108
zip_safe=False,
104109
python_requires=">=3.6",
105-
install_requires=["numpy>=1.20.1", "pandas>=1.30"],
110+
install_requires=["numpy>=1.20.1", "pandas>=1.2.0"],
106111
)

src/nyx/phase2.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,10 @@ namespace Nyxus
194194
}
195195

196196
// Allow heyboard interrupt.
197+
#ifdef WITH_PYTHON_H
197198
if (PyErr_CheckSignals() != 0)
198199
throw pybind11::error_already_set();
200+
#endif
199201
}
200202

201203
// Process what's remaining pending

0 commit comments

Comments
 (0)