aboutsummaryrefslogtreecommitdiff
path: root/setup.py
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 /setup.py
parentFormatting (diff)
downloadpygensvm-f429fee7fb446050957fefa4015eb41b209ea03b.tar.gz
pygensvm-f429fee7fb446050957fefa4015eb41b209ea03b.zip
Attempt to hardcode environment into setup.py
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py23
1 files changed, 23 insertions, 0 deletions
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()