aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2019-12-05 12:25:12 +0000
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2019-12-05 12:25:12 +0000
commitf429fee7fb446050957fefa4015eb41b209ea03b (patch)
treebb54eddb9ab4493c4a3882093a0a6628dc024dca
parentFormatting (diff)
downloadpygensvm-f429fee7fb446050957fefa4015eb41b209ea03b.tar.gz
pygensvm-f429fee7fb446050957fefa4015eb41b209ea03b.zip
Attempt to hardcode environment into setup.py
-rw-r--r--.travis.yml4
-rw-r--r--setup.py23
2 files changed, 26 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index 3310c63..91a1417 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -39,7 +39,9 @@ matrix:
- PATH=/c/Python36:/c/Python36/Scripts:/c/ProgramData/chocolatey/bin:$PATH
- PYTHON="python"
- PIP="pip"
- - CIBW_ENVIRONMENT="LAPACK=/c/cibw/lapacke/lapacke.0.1.0/lib/native/lib/x64 OPENBLAS=/c/cibw/lapacke/OpenBLAS.0.2.14.1/lib/native/lib/x64"
+ #-
+ #CIBW_ENVIRONMENT="LAPACK=/c/cibw/lapacke/lapacke.0.1.0/lib/native/lib/x64
+ #OPENBLAS=/c/cibw/lapacke/OpenBLAS.0.2.14.1/lib/native/"
#- LAPACK="/c/cibw/lapacke/lapacke.0.1.0/lib"
#- BLAS="/c/cibw/lapacke/OpenBLAS.0.2.14.1/lib"
- CIBW_BEFORE_BUILD="/c/cibw/nuget.exe install lapacke -OutputDirectory /cibw/lapacke -Verbosity detailed && echo && find /c/cibw/lapacke -type f -maxdepth 8 && echo && pip install numpy Cython"
diff --git a/setup.py b/setup.py
index 2f943b7..9a4a0d7 100644
--- a/setup.py
+++ b/setup.py
@@ -3,6 +3,7 @@
import os
import re
+import sys
# Package meta-data
AUTHOR = "Gertjan van den Burg"
@@ -235,8 +236,30 @@ def check_requirements():
raise ImportError(numpy_instructions)
+def cibuildwheel_windows():
+ if not (
+ os.environ.get("CIBUILDWHEEL", "0") == "1"
+ and os.environ.get("TRAVIS_OS_NAME", "none") == "windows"
+ ):
+ return
+
+ import shutil
+
+ # check if we're executing python in 32bit or 64bit mode
+ bits = 64 if sys.maxsize > 2 ** 32 else 32
+ bitprefix = "x64" if bits == 64 else "win32"
+
+ basepath = "/c/cibw/lapacke/OpenBLAS.0.2.14.1/lib/native"
+ dllpath = basepath + "/lib/" + bitprefix + "/libopenblas.dll.a"
+ if os.path.exists(dllpath):
+ shutil.move(dllpath, basepath + "/lib/")
+
+ os.environ["OPENBLAS"] = "/c/cibw/lapacke/OpenBLAS.0.2.14.1/lib/native"
+
+
if __name__ == "__main__":
check_requirements()
+ cibuildwheel_windows()
version = re.search(
'__version__ = "([^\']+)"', open("gensvm/__init__.py").read()