From 617bb3ebbfecb72c13abfc549b98c5407e0fee3d Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Tue, 12 Nov 2019 09:17:14 +0000 Subject: First attempt at setting up travis for cibuildwheel --- setup.py | 60 +++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 15 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index ff6b0a9..e625eef 100644 --- a/setup.py +++ b/setup.py @@ -4,13 +4,38 @@ import os import re +# Package meta-data +AUTHOR = "Gertjan van den Burg" +DESCRIPTION = "Generalized Multiclass Support Vector Machines" +EMAIL = "gertjanvandenburg@gmail.com" +LICENSE = "GPLv2" +LICENSE_TROVE = ( + "License :: OSI Approved :: GNU General Public License v2 (GPLv2)" +) +NAME = "gensvm" +REQUIRES_PYTHON = ">=2.7" +URL = "https://github.com/GjjvdBurg/PyGenSVM" +VERSION = None + +REQUIRED = ["scikit-learn", "numpy"] + +docs_require = ["Sphinx==1.6.5", "sphinx_rtd_theme>=0.4.3"] +test_require = [] +dev_require = ["Cython"] + +EXTRAS = { + "docs": docs_require, + "tests": test_require, + "dev": docs_require + test_require + dev_require, +} + # Set this to True to enable building extensions using Cython. Set it to False· # to build extensions from the C file (that was previously generated using· # Cython). Set it to 'auto' to build with Cython if available, otherwise from· # the C file. USE_CYTHON = "auto" -# If we are in a release, we always never use Cython directly +# If we are in a release, we never use Cython directly IS_RELEASE = os.path.exists("PKG-INFO") if IS_RELEASE: USE_CYTHON = False @@ -25,15 +50,16 @@ if USE_CYTHON: else: raise -# Try to load setuptools, so that NumPy's distutils module that we use to -# provide the setup() function below comes from the setuptools package. If it -# fails, it'll use distutils' version, which doesn't support installing +# Try to load setuptools, so that NumPy's distutils module that we use to +# provide the setup() function below comes from the setuptools package. If it +# fails, it'll use distutils' version, which doesn't support installing # dependencies. try: - import setuptools + import setuptools except ImportError: - print("Warning: setuptools not found. You may have to install GenSVM's dependencies manually.") - + print( + "Warning: setuptools not found. You may have to install GenSVM's dependencies manually." + ) def _skl_get_blas_info(): @@ -111,7 +137,7 @@ def get_lapack_info(): lapack_info = get_info("lapack_opt", 0) if (not lapack_info) or atlas_not_found(lapack_info): - # This is a guess, but seems to work in practice. Need more systems to + # This is a guess, but seems to work in practice. Need more systems to # test this fully. lapack_libs = ["lapack"] lapack_info.pop("libraries", None) @@ -182,6 +208,9 @@ def read(fname): def check_requirements(): numpy_instructions = ( + "\n" + "GenSVM Installation Error:" + "\n" "Numerical Python (NumPy) is not installed on your " "system. This package is required for GenSVM. Please install " "NumPy using the instructions available here: " @@ -206,14 +235,15 @@ if __name__ == "__main__": attr = configuration().todict() attr["version"] = version - attr["description"] = "Python package for the GenSVM classifier" + attr["description"] = DESCRIPTION attr["long_description"] = read("README.rst") - attr["packages"] = ["gensvm"] - attr["url"] = "https://github.com/GjjvdBurg/PyGenSVM" - attr["author"] = "G.J.J. van den Burg" - attr["author_email"] = "gertjanvandenburg@gmail.com" - attr["license"] = "GPL v2" - attr["install_requires"] = ["scikit-learn", "numpy"] + attr["packages"] = [NAME] + attr["url"] = URL + attr["author"] = AUTHOR + attr["author_email"] = EMAIL + attr["license"] = LICENSE + attr["install_requires"] = REQUIRED + attr['extras_require'] = EXTRAS from numpy.distutils.core import setup -- cgit v1.2.3 From fc6a87130b560bcd45f90d9f80a560b4c2579926 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 4 Dec 2019 12:31:19 +0000 Subject: Add debug flags for now --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index e625eef..2eddcfd 100644 --- a/setup.py +++ b/setup.py @@ -190,7 +190,7 @@ def configuration(): get_include(), blas_info.pop("include_dirs", []), ], - extra_compile_args=blas_info.pop("extra_compile_args", []), + extra_compile_args=blas_info.pop("extra_compile_args", ['-g']), depends=gensvm_depends, **blas_info ) -- cgit v1.2.3 From 14ea553941568e02321f3299ca3f67f21e298292 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 4 Dec 2019 13:19:02 +0000 Subject: Remove -g flag, no longer needed --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 2eddcfd..e625eef 100644 --- a/setup.py +++ b/setup.py @@ -190,7 +190,7 @@ def configuration(): get_include(), blas_info.pop("include_dirs", []), ], - extra_compile_args=blas_info.pop("extra_compile_args", ['-g']), + extra_compile_args=blas_info.pop("extra_compile_args", []), depends=gensvm_depends, **blas_info ) -- cgit v1.2.3 From eb71d81a2696f41b0235c49e148de002e2e62764 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 4 Dec 2019 13:21:29 +0000 Subject: Attempt to hard code the libraries on windows --- setup.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index e625eef..597d940 100644 --- a/setup.py +++ b/setup.py @@ -118,6 +118,12 @@ def _skl_get_blas_info(): else: cblas_libs = blas_info.pop("libraries", []) + if ( + os.environ.get("CIBUILDWHEEL", "0") == "1" + and os.environ.get("TRAVIS_OS_NAME", "none") == "windows" + ): + cblas_libs = ["/c/cibw/lapacke/OpenBLAS.0.2.14.1/lib/native"] + return cblas_libs, blas_info @@ -144,6 +150,10 @@ def get_lapack_info(): else: lapack_libs = lapack_info.pop("libraries", []) + if (os.environ.get("CIBUILDWHEEL", "0") == "1" + and os.environ.get("TRAVIS_OS_NAME", "none") == "windows"): + lapack_libs = ["/c/cibw/lapacke/lapacke.0.1.0/lib/native"] + return lapack_libs, lapack_info -- cgit v1.2.3 From 999740be9d3f56a1deda2b3389e92bcf38a7c273 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 4 Dec 2019 16:31:20 +0000 Subject: Check if these lines are even reached --- setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 597d940..3986455 100644 --- a/setup.py +++ b/setup.py @@ -122,6 +122,7 @@ def _skl_get_blas_info(): os.environ.get("CIBUILDWHEEL", "0") == "1" and os.environ.get("TRAVIS_OS_NAME", "none") == "windows" ): + print("\n\n*** On CIBW ***\n\n") cblas_libs = ["/c/cibw/lapacke/OpenBLAS.0.2.14.1/lib/native"] return cblas_libs, blas_info @@ -150,8 +151,11 @@ def get_lapack_info(): else: lapack_libs = lapack_info.pop("libraries", []) - if (os.environ.get("CIBUILDWHEEL", "0") == "1" - and os.environ.get("TRAVIS_OS_NAME", "none") == "windows"): + if ( + os.environ.get("CIBUILDWHEEL", "0") == "1" + and os.environ.get("TRAVIS_OS_NAME", "none") == "windows" + ): + print("\n\n*** On CIBW ***\n\n") lapack_libs = ["/c/cibw/lapacke/lapacke.0.1.0/lib/native"] return lapack_libs, lapack_info -- cgit v1.2.3 From 4e2c47562e8b883998d5b617028d8de44f3a641d Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 4 Dec 2019 16:41:34 +0000 Subject: Debugging numpy get info --- setup.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 3986455..3b28068 100644 --- a/setup.py +++ b/setup.py @@ -112,6 +112,7 @@ def _skl_get_blas_info(): return False blas_info = get_info("blas_opt", 0) + print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) if (not blas_info) or atlas_not_found(blas_info): cblas_libs = ["cblas"] blas_info.pop("libraries", None) @@ -143,6 +144,7 @@ def get_lapack_info(): return False lapack_info = get_info("lapack_opt", 0) + print("\n\n*** lapack_info: \n%r\n\n ***\n\n" % lapack_info) if (not lapack_info) or atlas_not_found(lapack_info): # This is a guess, but seems to work in practice. Need more systems to # test this fully. -- cgit v1.2.3 From ab2b483bf080519dc599b7fa1655aa1fca77d1da Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 4 Dec 2019 16:49:21 +0000 Subject: Debug if environment variables are present --- setup.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 3b28068..d31adba 100644 --- a/setup.py +++ b/setup.py @@ -113,6 +113,10 @@ def _skl_get_blas_info(): blas_info = get_info("blas_opt", 0) print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) + print( + "\n\n*** os.environ.get('BLAS') = %r ***\n\n" + % (os.environ.get("BLAS", None)) + ) if (not blas_info) or atlas_not_found(blas_info): cblas_libs = ["cblas"] blas_info.pop("libraries", None) @@ -145,6 +149,10 @@ def get_lapack_info(): lapack_info = get_info("lapack_opt", 0) print("\n\n*** lapack_info: \n%r\n\n ***\n\n" % lapack_info) + print( + "\n\n*** os.environ.get('LAPACK') = %r ***\n\n" + % (os.environ.get("LAPACK", None)) + ) if (not lapack_info) or atlas_not_found(lapack_info): # This is a guess, but seems to work in practice. Need more systems to # test this fully. -- cgit v1.2.3 From 4ed38711101dd1ab0423aae12c0edacef9d7fafb Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 4 Dec 2019 17:23:18 +0000 Subject: Try to be more specific with library paths --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index d31adba..1f4990a 100644 --- a/setup.py +++ b/setup.py @@ -114,8 +114,8 @@ def _skl_get_blas_info(): blas_info = get_info("blas_opt", 0) print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) print( - "\n\n*** os.environ.get('BLAS') = %r ***\n\n" - % (os.environ.get("BLAS", None)) + "\n\n*** os.environ.get('OPENBLAS') = %r ***\n\n" + % (os.environ.get("OPENBLAS", None)) ) if (not blas_info) or atlas_not_found(blas_info): cblas_libs = ["cblas"] -- cgit v1.2.3 From 33393b247ca756bdf8c59d612e1aa4a9c6625845 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 12:24:28 +0000 Subject: Remove old attempts --- setup.py | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 1f4990a..fbd1dc7 100644 --- a/setup.py +++ b/setup.py @@ -123,13 +123,6 @@ def _skl_get_blas_info(): else: cblas_libs = blas_info.pop("libraries", []) - if ( - os.environ.get("CIBUILDWHEEL", "0") == "1" - and os.environ.get("TRAVIS_OS_NAME", "none") == "windows" - ): - print("\n\n*** On CIBW ***\n\n") - cblas_libs = ["/c/cibw/lapacke/OpenBLAS.0.2.14.1/lib/native"] - return cblas_libs, blas_info @@ -161,13 +154,6 @@ def get_lapack_info(): else: lapack_libs = lapack_info.pop("libraries", []) - if ( - os.environ.get("CIBUILDWHEEL", "0") == "1" - and os.environ.get("TRAVIS_OS_NAME", "none") == "windows" - ): - print("\n\n*** On CIBW ***\n\n") - lapack_libs = ["/c/cibw/lapacke/lapacke.0.1.0/lib/native"] - return lapack_libs, lapack_info -- cgit v1.2.3 From 6dfc6ff3c45eab117249bb775c4bf06374554d96 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 12:24:38 +0000 Subject: Formatting --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index fbd1dc7..2f943b7 100644 --- a/setup.py +++ b/setup.py @@ -253,7 +253,7 @@ if __name__ == "__main__": attr["author_email"] = EMAIL attr["license"] = LICENSE attr["install_requires"] = REQUIRED - attr['extras_require'] = EXTRAS + attr["extras_require"] = EXTRAS from numpy.distutils.core import setup -- cgit v1.2.3 From f429fee7fb446050957fefa4015eb41b209ea03b Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 12:25:12 +0000 Subject: Attempt to hardcode environment into setup.py --- setup.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'setup.py') 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() -- cgit v1.2.3 From 0ec2d7f22321410f569a60257aae389eb6b2e7f9 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 12:33:01 +0000 Subject: debug printing --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 9a4a0d7..b0ca124 100644 --- a/setup.py +++ b/setup.py @@ -242,6 +242,7 @@ def cibuildwheel_windows(): and os.environ.get("TRAVIS_OS_NAME", "none") == "windows" ): return + print("\n*** Preparing GenSVM for CIBuildWheel ***") import shutil @@ -256,6 +257,11 @@ def cibuildwheel_windows(): os.environ["OPENBLAS"] = "/c/cibw/lapacke/OpenBLAS.0.2.14.1/lib/native" + for path, dirs, files in os.walk("/c/cibw/lapacke"): + print(path) + for f in files: + print('\t' + f) + if __name__ == "__main__": check_requirements() -- cgit v1.2.3 From c048e44287f4a9f808abae91fbd9e34467022797 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 12:38:48 +0000 Subject: add lib to path --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index b0ca124..ebb6462 100644 --- a/setup.py +++ b/setup.py @@ -255,7 +255,7 @@ def cibuildwheel_windows(): if os.path.exists(dllpath): shutil.move(dllpath, basepath + "/lib/") - os.environ["OPENBLAS"] = "/c/cibw/lapacke/OpenBLAS.0.2.14.1/lib/native" + os.environ["OPENBLAS"] = "/c/cibw/lapacke/OpenBLAS.0.2.14.1/lib/native/lib" for path, dirs, files in os.walk("/c/cibw/lapacke"): print(path) -- cgit v1.2.3 From b1c831e621abd66d3cc679785d1afa3e4cb9aa69 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 12:38:53 +0000 Subject: flush stdout --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index ebb6462..9a02566 100644 --- a/setup.py +++ b/setup.py @@ -260,7 +260,8 @@ def cibuildwheel_windows(): for path, dirs, files in os.walk("/c/cibw/lapacke"): print(path) for f in files: - print('\t' + f) + print("\t" + f) + sys.stdout.flush() if __name__ == "__main__": -- cgit v1.2.3 From 7b028ee9eb90a1dfca9b91691dcc996647c4418e Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 14:51:09 +0000 Subject: try installing just openblas --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 9a02566..cd81196 100644 --- a/setup.py +++ b/setup.py @@ -250,12 +250,14 @@ def cibuildwheel_windows(): 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" + basepath = "/c/cibw/openblas/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/lib" + os.environ[ + "OPENBLAS" + ] = "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/lib" for path, dirs, files in os.walk("/c/cibw/lapacke"): print(path) -- cgit v1.2.3 From 5287a470390011a24bbc3e7dce1ee729e193f8dc Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 14:54:46 +0000 Subject: debugging --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index cd81196..585a7f6 100644 --- a/setup.py +++ b/setup.py @@ -259,11 +259,14 @@ def cibuildwheel_windows(): "OPENBLAS" ] = "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/lib" - for path, dirs, files in os.walk("/c/cibw/lapacke"): + for path, dirs, files in os.walk("/c/cibw/openblas"): print(path) for f in files: print("\t" + f) sys.stdout.flush() + import time + + time.sleep(5) if __name__ == "__main__": -- cgit v1.2.3 From 635f2b255ce33044873056f0965d53595775c77b Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 16:09:08 +0000 Subject: double check environment variable set --- setup.py | 1 + 1 file changed, 1 insertion(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 585a7f6..dd33279 100644 --- a/setup.py +++ b/setup.py @@ -258,6 +258,7 @@ def cibuildwheel_windows(): os.environ[ "OPENBLAS" ] = "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/lib" + print(os.environ.get('OPENBLAS', 'none')) for path, dirs, files in os.walk("/c/cibw/openblas"): print(path) -- cgit v1.2.3 From 86818f69dd997a107253146cb651030598488249 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 16:24:07 +0000 Subject: try manually specifying the info dict --- setup.py | 46 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index dd33279..bc5adfc 100644 --- a/setup.py +++ b/setup.py @@ -63,6 +63,13 @@ except ImportError: ) +def on_cibw_win(): + return ( + os.environ.get("CIBUILDWHEEL", "0") == "1" + and os.environ.get("TRAVIS_OS_NAME", "none") == "windows" + ) + + def _skl_get_blas_info(): """Copyright notice for this function @@ -112,7 +119,21 @@ def _skl_get_blas_info(): return True return False - blas_info = get_info("blas_opt", 0) + if on_cibw_win(): + blas_info = { + "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], + "libraries": ["openblas"], + "library_dirs": [ + "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/lib/" + ], + "include_dirs": [ + "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/include" + ], + "language": "c", + } + return ["cblas"], blas_info + + blas_info = get_info("blas_opt", notfound_action=2) print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) print( "\n\n*** os.environ.get('OPENBLAS') = %r ***\n\n" @@ -141,7 +162,21 @@ def get_lapack_info(): return True return False - lapack_info = get_info("lapack_opt", 0) + if on_cibw_win(): + blas_info = { + "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], + "libraries": ["openblas"], + "library_dirs": [ + "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/lib/" + ], + "include_dirs": [ + "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/include" + ], + "language": "c", + } + return ["cblas"], blas_info + + lapack_info = get_info("lapack_opt", notfound_action=2) print("\n\n*** lapack_info: \n%r\n\n ***\n\n" % lapack_info) print( "\n\n*** os.environ.get('LAPACK') = %r ***\n\n" @@ -237,10 +272,7 @@ def check_requirements(): def cibuildwheel_windows(): - if not ( - os.environ.get("CIBUILDWHEEL", "0") == "1" - and os.environ.get("TRAVIS_OS_NAME", "none") == "windows" - ): + if not on_cibw_win(): return print("\n*** Preparing GenSVM for CIBuildWheel ***") @@ -258,7 +290,7 @@ def cibuildwheel_windows(): os.environ[ "OPENBLAS" ] = "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/lib" - print(os.environ.get('OPENBLAS', 'none')) + print(os.environ.get("OPENBLAS", "none")) for path, dirs, files in os.walk("/c/cibw/openblas"): print(path) -- cgit v1.2.3 From 5dcdcb8dabee143b2a2c422d5830ff43ef571e23 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 16:31:27 +0000 Subject: Remove 'libraries' from dict --- setup.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index bc5adfc..9bc6e7d 100644 --- a/setup.py +++ b/setup.py @@ -122,7 +122,6 @@ def _skl_get_blas_info(): if on_cibw_win(): blas_info = { "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], - "libraries": ["openblas"], "library_dirs": [ "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/lib/" ], @@ -131,7 +130,7 @@ def _skl_get_blas_info(): ], "language": "c", } - return ["cblas"], blas_info + return ["openblas"], blas_info blas_info = get_info("blas_opt", notfound_action=2) print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) @@ -163,9 +162,8 @@ def get_lapack_info(): return False if on_cibw_win(): - blas_info = { + lapack_info = { "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], - "libraries": ["openblas"], "library_dirs": [ "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/lib/" ], @@ -174,7 +172,7 @@ def get_lapack_info(): ], "language": "c", } - return ["cblas"], blas_info + return ["openblas"], lapack_info lapack_info = get_info("lapack_opt", notfound_action=2) print("\n\n*** lapack_info: \n%r\n\n ***\n\n" % lapack_info) -- cgit v1.2.3 From aec531912e8d0ed4e0d3fcd6cf325f87acdc894e Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 16:43:50 +0000 Subject: use os.sep instead --- setup.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 7 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 9bc6e7d..8bfb8b2 100644 --- a/setup.py +++ b/setup.py @@ -120,13 +120,35 @@ def _skl_get_blas_info(): return False if on_cibw_win(): + blas_info = get_info("blas_opt", notfound_action=0) + print("***\nDetected blas info: %r" % blas_info) blas_info = { "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], "library_dirs": [ - "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/lib/" + os.sep.join( + [ + "C:", + "cibw", + "openblas", + "OpenBLAS.0.2.14.1", + "lib", + "native", + "lib", + ] + ) ], "include_dirs": [ - "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/include" + os.sep.join( + [ + "C:", + "cibw", + "openblas", + "OpenBLAS.0.2.14.1", + "lib", + "native", + "include", + ] + ) ], "language": "c", } @@ -162,16 +184,39 @@ def get_lapack_info(): return False if on_cibw_win(): + lapack_info = get_info("lapack_opt", notfound_action=0) + print("***\nDetected lapack info: %r" % lapack_info) lapack_info = { "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], "library_dirs": [ - "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/lib/" + os.sep.join( + [ + "C:", + "cibw", + "openblas", + "OpenBLAS.0.2.14.1", + "lib", + "native", + "lib", + ] + ) ], "include_dirs": [ - "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/include" + os.sep.join( + [ + "C:", + "cibw", + "openblas", + "OpenBLAS.0.2.14.1", + "lib", + "native", + "include", + ] + ) ], "language": "c", } + print("***\nDefined lapack info: %r" % lapack_info) return ["openblas"], lapack_info lapack_info = get_info("lapack_opt", notfound_action=2) @@ -291,10 +336,10 @@ def cibuildwheel_windows(): print(os.environ.get("OPENBLAS", "none")) for path, dirs, files in os.walk("/c/cibw/openblas"): - print(path) + print(path, file=sys.stderr) for f in files: - print("\t" + f) - sys.stdout.flush() + print("\t" + f, file=sys.stderr) + sys.stderr.flush() import time time.sleep(5) -- cgit v1.2.3 From b3146ef614ea815c845ad47686ed41f6fb63fa89 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 17:13:08 +0000 Subject: Attempt to fix the library name --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 8bfb8b2..5f3c77e 100644 --- a/setup.py +++ b/setup.py @@ -152,7 +152,7 @@ def _skl_get_blas_info(): ], "language": "c", } - return ["openblas"], blas_info + return ["libopenblas.dll.a"], blas_info blas_info = get_info("blas_opt", notfound_action=2) print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) @@ -217,7 +217,7 @@ def get_lapack_info(): "language": "c", } print("***\nDefined lapack info: %r" % lapack_info) - return ["openblas"], lapack_info + return ["libopenblas.dll.a"], lapack_info lapack_info = get_info("lapack_opt", notfound_action=2) print("\n\n*** lapack_info: \n%r\n\n ***\n\n" % lapack_info) -- cgit v1.2.3 From 3e266c9314ccbeb1f162104d194f951d96d2ab60 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 17:36:04 +0000 Subject: remove filename extension --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 5f3c77e..bb521c9 100644 --- a/setup.py +++ b/setup.py @@ -152,7 +152,7 @@ def _skl_get_blas_info(): ], "language": "c", } - return ["libopenblas.dll.a"], blas_info + return ["libopenblas"], blas_info blas_info = get_info("blas_opt", notfound_action=2) print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) @@ -217,7 +217,7 @@ def get_lapack_info(): "language": "c", } print("***\nDefined lapack info: %r" % lapack_info) - return ["libopenblas.dll.a"], lapack_info + return ["libopenblas"], lapack_info lapack_info = get_info("lapack_opt", notfound_action=2) print("\n\n*** lapack_info: \n%r\n\n ***\n\n" % lapack_info) -- cgit v1.2.3 From 24934c1fbb9154e26dcb150a698daa535e679066 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 17:36:14 +0000 Subject: move the library to a .lib file --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index bb521c9..9a83c0c 100644 --- a/setup.py +++ b/setup.py @@ -328,7 +328,7 @@ def cibuildwheel_windows(): basepath = "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native" dllpath = basepath + "/lib/" + bitprefix + "/libopenblas.dll.a" if os.path.exists(dllpath): - shutil.move(dllpath, basepath + "/lib/") + shutil.move(dllpath, basepath + "/lib/libopenblas.lib") os.environ[ "OPENBLAS" -- cgit v1.2.3 From c1c9fd761c8220bffe0fb801f34966aab80e68aa Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 17:43:10 +0000 Subject: change to windows seps --- setup.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 9a83c0c..5014570 100644 --- a/setup.py +++ b/setup.py @@ -325,17 +325,19 @@ def cibuildwheel_windows(): bits = 64 if sys.maxsize > 2 ** 32 else 32 bitprefix = "x64" if bits == 64 else "win32" - basepath = "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native" - dllpath = basepath + "/lib/" + bitprefix + "/libopenblas.dll.a" + basepath = "C:\\cibw\\openblas\\OpenBLAS.0.2.14.1\\lib\\native" + dllpath = basepath + "\\lib\\" + bitprefix + "\\libopenblas.dll.a" + print("dllpath: %s" % dllpath) if os.path.exists(dllpath): - shutil.move(dllpath, basepath + "/lib/libopenblas.lib") + shutil.move(dllpath, basepath + "\\lib\\libopenblas.lib") + print(os.listdir(basepath + "\\lib")) os.environ[ "OPENBLAS" - ] = "/c/cibw/openblas/OpenBLAS.0.2.14.1/lib/native/lib" + ] = "C:\\cibw\\openblas\\OpenBLAS.0.2.14.1\\lib\\native\\lib" print(os.environ.get("OPENBLAS", "none")) - for path, dirs, files in os.walk("/c/cibw/openblas"): + for path, dirs, files in os.walk("C:\\cibw\\openblas"): print(path, file=sys.stderr) for f in files: print("\t" + f, file=sys.stderr) -- cgit v1.2.3 From a3859e56ae446bec51d94624f83cc8f46887c915 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 17:49:58 +0000 Subject: autodetect now seems to work lets try that --- setup.py | 139 ++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 70 insertions(+), 69 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 5014570..6b10d0c 100644 --- a/setup.py +++ b/setup.py @@ -119,40 +119,41 @@ def _skl_get_blas_info(): return True return False - if on_cibw_win(): - blas_info = get_info("blas_opt", notfound_action=0) - print("***\nDetected blas info: %r" % blas_info) - blas_info = { - "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], - "library_dirs": [ - os.sep.join( - [ - "C:", - "cibw", - "openblas", - "OpenBLAS.0.2.14.1", - "lib", - "native", - "lib", - ] - ) - ], - "include_dirs": [ - os.sep.join( - [ - "C:", - "cibw", - "openblas", - "OpenBLAS.0.2.14.1", - "lib", - "native", - "include", - ] - ) - ], - "language": "c", - } - return ["libopenblas"], blas_info + +# if on_cibw_win(): +# blas_info = get_info("blas_opt", notfound_action=0) +# print("***\nDetected blas info: %r" % blas_info) +# blas_info = { +# "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], +# "library_dirs": [ +# os.sep.join( +# [ +# "C:", +# "cibw", +# "openblas", +# "OpenBLAS.0.2.14.1", +# "lib", +# "native", +# "lib", +# ] +# ) +# ], +# "include_dirs": [ +# os.sep.join( +# [ +# "C:", +# "cibw", +# "openblas", +# "OpenBLAS.0.2.14.1", +# "lib", +# "native", +# "include", +# ] +# ) +# ], +# "language": "c", +# } +# return ["libopenblas"], blas_info blas_info = get_info("blas_opt", notfound_action=2) print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) @@ -183,41 +184,41 @@ def get_lapack_info(): return True return False - if on_cibw_win(): - lapack_info = get_info("lapack_opt", notfound_action=0) - print("***\nDetected lapack info: %r" % lapack_info) - lapack_info = { - "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], - "library_dirs": [ - os.sep.join( - [ - "C:", - "cibw", - "openblas", - "OpenBLAS.0.2.14.1", - "lib", - "native", - "lib", - ] - ) - ], - "include_dirs": [ - os.sep.join( - [ - "C:", - "cibw", - "openblas", - "OpenBLAS.0.2.14.1", - "lib", - "native", - "include", - ] - ) - ], - "language": "c", - } - print("***\nDefined lapack info: %r" % lapack_info) - return ["libopenblas"], lapack_info +# if on_cibw_win(): +# lapack_info = get_info("lapack_opt", notfound_action=0) +# print("***\nDetected lapack info: %r" % lapack_info) +# lapack_info = { +# "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], +# "library_dirs": [ +# os.sep.join( +# [ +# "C:", +# "cibw", +# "openblas", +# "OpenBLAS.0.2.14.1", +# "lib", +# "native", +# "lib", +# ] +# ) +# ], +# "include_dirs": [ +# os.sep.join( +# [ +# "C:", +# "cibw", +# "openblas", +# "OpenBLAS.0.2.14.1", +# "lib", +# "native", +# "include", +# ] +# ) +# ], +# "language": "c", +# } +# print("***\nDefined lapack info: %r" % lapack_info) +# return ["libopenblas"], lapack_info lapack_info = get_info("lapack_opt", notfound_action=2) print("\n\n*** lapack_info: \n%r\n\n ***\n\n" % lapack_info) -- cgit v1.2.3 From f6e971d92de52ea83923aef6cf6473794c12019d Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 18:10:14 +0000 Subject: Reset defined info dicts The detected ones don't seem to find the include directories. --- setup.py | 139 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 69 insertions(+), 70 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 6b10d0c..5014570 100644 --- a/setup.py +++ b/setup.py @@ -119,41 +119,40 @@ def _skl_get_blas_info(): return True return False - -# if on_cibw_win(): -# blas_info = get_info("blas_opt", notfound_action=0) -# print("***\nDetected blas info: %r" % blas_info) -# blas_info = { -# "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], -# "library_dirs": [ -# os.sep.join( -# [ -# "C:", -# "cibw", -# "openblas", -# "OpenBLAS.0.2.14.1", -# "lib", -# "native", -# "lib", -# ] -# ) -# ], -# "include_dirs": [ -# os.sep.join( -# [ -# "C:", -# "cibw", -# "openblas", -# "OpenBLAS.0.2.14.1", -# "lib", -# "native", -# "include", -# ] -# ) -# ], -# "language": "c", -# } -# return ["libopenblas"], blas_info + if on_cibw_win(): + blas_info = get_info("blas_opt", notfound_action=0) + print("***\nDetected blas info: %r" % blas_info) + blas_info = { + "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], + "library_dirs": [ + os.sep.join( + [ + "C:", + "cibw", + "openblas", + "OpenBLAS.0.2.14.1", + "lib", + "native", + "lib", + ] + ) + ], + "include_dirs": [ + os.sep.join( + [ + "C:", + "cibw", + "openblas", + "OpenBLAS.0.2.14.1", + "lib", + "native", + "include", + ] + ) + ], + "language": "c", + } + return ["libopenblas"], blas_info blas_info = get_info("blas_opt", notfound_action=2) print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) @@ -184,41 +183,41 @@ def get_lapack_info(): return True return False -# if on_cibw_win(): -# lapack_info = get_info("lapack_opt", notfound_action=0) -# print("***\nDetected lapack info: %r" % lapack_info) -# lapack_info = { -# "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], -# "library_dirs": [ -# os.sep.join( -# [ -# "C:", -# "cibw", -# "openblas", -# "OpenBLAS.0.2.14.1", -# "lib", -# "native", -# "lib", -# ] -# ) -# ], -# "include_dirs": [ -# os.sep.join( -# [ -# "C:", -# "cibw", -# "openblas", -# "OpenBLAS.0.2.14.1", -# "lib", -# "native", -# "include", -# ] -# ) -# ], -# "language": "c", -# } -# print("***\nDefined lapack info: %r" % lapack_info) -# return ["libopenblas"], lapack_info + if on_cibw_win(): + lapack_info = get_info("lapack_opt", notfound_action=0) + print("***\nDetected lapack info: %r" % lapack_info) + lapack_info = { + "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], + "library_dirs": [ + os.sep.join( + [ + "C:", + "cibw", + "openblas", + "OpenBLAS.0.2.14.1", + "lib", + "native", + "lib", + ] + ) + ], + "include_dirs": [ + os.sep.join( + [ + "C:", + "cibw", + "openblas", + "OpenBLAS.0.2.14.1", + "lib", + "native", + "include", + ] + ) + ], + "language": "c", + } + print("***\nDefined lapack info: %r" % lapack_info) + return ["libopenblas"], lapack_info lapack_info = get_info("lapack_opt", notfound_action=2) print("\n\n*** lapack_info: \n%r\n\n ***\n\n" % lapack_info) -- cgit v1.2.3 From bccdaf98238e77e31851e73b070851a2ff37808a Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 18:10:23 +0000 Subject: fix typos --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 5014570..206a430 100644 --- a/setup.py +++ b/setup.py @@ -107,7 +107,7 @@ def _skl_get_blas_info(): from numpy.distutils.system_info import get_info def atlas_not_found(blas_info_): - def_macros = blas_info.get("define_macros", []) + def_macros = blas_info_.get("define_macros", []) for x in def_macros: if x[0] == "NO_ATLAS_INFO": # if x[1] != 1 we should have lapack @@ -174,7 +174,7 @@ def get_lapack_info(): from numpy.distutils.system_info import get_info def atlas_not_found(lapack_info_): - def_macros = lapack_info.get("define_macros", []) + def_macros = lapack_info_.get("define_macros", []) for x in def_macros: if x[0] == "NO_ATLAS_INFO": return True -- cgit v1.2.3 From 825c72ba9ead9f9c7f4a3b526b66fc705fd5267d Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 18:30:25 +0000 Subject: Debug use_cython Wheel builds now, but testing fails with "dll load failed" --- setup.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 206a430..5938c01 100644 --- a/setup.py +++ b/setup.py @@ -345,6 +345,8 @@ def cibuildwheel_windows(): import time time.sleep(5) + print("*** USE CYTHON = %s\n" % USE_CYTHON) + raise ValueError(USE_CYTHON) if __name__ == "__main__": -- cgit v1.2.3 From 1c644224c8d0d306159dabb867bf0fc5247c1aab Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Dec 2019 18:38:47 +0000 Subject: remove debug statement USE_CYTHON = 'auto', so cythonize should be run --- setup.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 5938c01..206a430 100644 --- a/setup.py +++ b/setup.py @@ -345,8 +345,6 @@ def cibuildwheel_windows(): import time time.sleep(5) - print("*** USE CYTHON = %s\n" % USE_CYTHON) - raise ValueError(USE_CYTHON) if __name__ == "__main__": -- cgit v1.2.3 From 21f8b5caaba22c80d950b8f29d257c080bf43f7e Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 4 Mar 2020 14:51:24 +0000 Subject: Edit debug statements to deal with MacOS failure --- setup.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 206a430..cc0bfa0 100644 --- a/setup.py +++ b/setup.py @@ -155,17 +155,18 @@ def _skl_get_blas_info(): return ["libopenblas"], blas_info blas_info = get_info("blas_opt", notfound_action=2) - print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) - print( - "\n\n*** os.environ.get('OPENBLAS') = %r ***\n\n" - % (os.environ.get("OPENBLAS", None)) - ) if (not blas_info) or atlas_not_found(blas_info): cblas_libs = ["cblas"] blas_info.pop("libraries", None) else: cblas_libs = blas_info.pop("libraries", []) + print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) + print( + "\n\n*** os.environ.get('OPENBLAS') = %r ***\n\n" + % (os.environ.get("OPENBLAS", None)) + ) + return cblas_libs, blas_info @@ -220,11 +221,7 @@ def get_lapack_info(): return ["libopenblas"], lapack_info lapack_info = get_info("lapack_opt", notfound_action=2) - print("\n\n*** lapack_info: \n%r\n\n ***\n\n" % lapack_info) - print( - "\n\n*** os.environ.get('LAPACK') = %r ***\n\n" - % (os.environ.get("LAPACK", None)) - ) + if (not lapack_info) or atlas_not_found(lapack_info): # This is a guess, but seems to work in practice. Need more systems to # test this fully. @@ -233,6 +230,12 @@ def get_lapack_info(): else: lapack_libs = lapack_info.pop("libraries", []) + print("\n\n*** lapack_info: \n%r\n\n ***\n\n" % lapack_info) + print( + "\n\n*** os.environ.get('LAPACK') = %r ***\n\n" + % (os.environ.get("LAPACK", None)) + ) + return lapack_libs, lapack_info @@ -288,6 +291,9 @@ def configuration(): if USE_CYTHON: config.ext_modules = cythonize(config.ext_modules) + print("\n\n *** CONFIG ***\n") + print(config) + return config -- cgit v1.2.3 From 3a341f0712a5fdad39a86aceeb931c88215c06bb Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 4 Mar 2020 15:07:37 +0000 Subject: More debugging --- setup.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index cc0bfa0..aea27e6 100644 --- a/setup.py +++ b/setup.py @@ -293,6 +293,9 @@ def configuration(): print("\n\n *** CONFIG ***\n") print(config) + print("\n\n *** EXT_MODULE ***\n") + from pprint import pprint + print(pprint(config.ext_modules[0].__dict__)) return config -- cgit v1.2.3 From d975c661031edbf2fff37705ea86dae6b0db8c8e Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Fri, 6 Mar 2020 13:24:40 +0000 Subject: Manually add openblas include dir on MacOS travis --- setup.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index aea27e6..0d963d2 100644 --- a/setup.py +++ b/setup.py @@ -70,6 +70,13 @@ def on_cibw_win(): ) +def on_cibw_mac(): + return ( + os.environ.get("CIBUILDWHEEL", "0") == "1" + and os.environ.get("TRAVIS_OS_NAME", "none") == "osx" + ) + + def _skl_get_blas_info(): """Copyright notice for this function @@ -161,6 +168,13 @@ def _skl_get_blas_info(): else: cblas_libs = blas_info.pop("libraries", []) + if on_cibw_mac(): + libdir = blas_info.get("library_dirs", []) + libdir = libdir[0] if libdir else None + if libdir: + base = os.path.join(os.path.split(libdir)[:-1]) + blas_info["include_dirs"] = os.path.join(base, "include") + print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) print( "\n\n*** os.environ.get('OPENBLAS') = %r ***\n\n" @@ -295,6 +309,7 @@ def configuration(): print(config) print("\n\n *** EXT_MODULE ***\n") from pprint import pprint + print(pprint(config.ext_modules[0].__dict__)) return config -- cgit v1.2.3 From 95574c32fde7d9daf89cdbd1330ab40dc0991774 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Fri, 6 Mar 2020 14:10:02 +0000 Subject: Debugging travis --- setup.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 0d963d2..4665ecb 100644 --- a/setup.py +++ b/setup.py @@ -168,6 +168,9 @@ def _skl_get_blas_info(): else: cblas_libs = blas_info.pop("libraries", []) + print("\nCIBUILDWHEEL = %s" % os.environ.get('CIBUILDWHEEL', '0')) + print("\nTRAVIS_OS_NAME = %s" % os.environ.get('TRAVIS_OS_NAME', '1')) + if on_cibw_mac(): libdir = blas_info.get("library_dirs", []) libdir = libdir[0] if libdir else None -- cgit v1.2.3 From e4441c772343e0e49236028d5c136aca98f70e5f Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Fri, 6 Mar 2020 14:15:49 +0000 Subject: We need the includedir always on travis --- setup.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 4665ecb..59f0f50 100644 --- a/setup.py +++ b/setup.py @@ -168,10 +168,7 @@ def _skl_get_blas_info(): else: cblas_libs = blas_info.pop("libraries", []) - print("\nCIBUILDWHEEL = %s" % os.environ.get('CIBUILDWHEEL', '0')) - print("\nTRAVIS_OS_NAME = %s" % os.environ.get('TRAVIS_OS_NAME', '1')) - - if on_cibw_mac(): + if os.environ.get("TRAVIS_OS_NAME", "none") == "osx": libdir = blas_info.get("library_dirs", []) libdir = libdir[0] if libdir else None if libdir: -- cgit v1.2.3 From 1eae3e8f1509396e44a8a0a311b19c3ec01e064e Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Fri, 6 Mar 2020 14:23:11 +0000 Subject: Correct use of os.path.split --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 59f0f50..ce66bfe 100644 --- a/setup.py +++ b/setup.py @@ -172,7 +172,7 @@ def _skl_get_blas_info(): libdir = blas_info.get("library_dirs", []) libdir = libdir[0] if libdir else None if libdir: - base = os.path.join(os.path.split(libdir)[:-1]) + base = os.path.split(libdir)[0] blas_info["include_dirs"] = os.path.join(base, "include") print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) -- cgit v1.2.3 From 2b3a17ed64009ddbc6b495ee948fe5b32bf83d90 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Fri, 6 Mar 2020 14:40:25 +0000 Subject: Debugging macos build -I/.. is provided but still cblas.h is not found. --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index ce66bfe..344b056 100644 --- a/setup.py +++ b/setup.py @@ -175,6 +175,10 @@ def _skl_get_blas_info(): base = os.path.split(libdir)[0] blas_info["include_dirs"] = os.path.join(base, "include") + if on_cibw_mac(): + # debugging + print(os.listdir('/System/Library/Frameworks/vecLib.framework/Headers')) + print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) print( "\n\n*** os.environ.get('OPENBLAS') = %r ***\n\n" -- cgit v1.2.3 From 69404b0a4621cb5224e24cad2665258cb7900198 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Fri, 6 Mar 2020 15:00:46 +0000 Subject: Mnaually setting a search path for the veclib headers --- setup.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 344b056..6713d18 100644 --- a/setup.py +++ b/setup.py @@ -173,11 +173,10 @@ def _skl_get_blas_info(): libdir = libdir[0] if libdir else None if libdir: base = os.path.split(libdir)[0] - blas_info["include_dirs"] = os.path.join(base, "include") - + blas_info["include_dirs"] = [os.path.join(base, "include")] + if on_cibw_mac(): - # debugging - print(os.listdir('/System/Library/Frameworks/vecLib.framework/Headers')) + blas_info['include_dirs'] = ['/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers/'] print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) print( -- cgit v1.2.3 From f6b4a5f032a249e52997d2c1433bde0e78b4850e Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Fri, 6 Mar 2020 15:22:06 +0000 Subject: Remove print statements and windows stuff --- setup.py | 61 ++++--------------------------------------------------------- 1 file changed, 4 insertions(+), 57 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 6713d18..5738dc4 100644 --- a/setup.py +++ b/setup.py @@ -128,7 +128,6 @@ def _skl_get_blas_info(): if on_cibw_win(): blas_info = get_info("blas_opt", notfound_action=0) - print("***\nDetected blas info: %r" % blas_info) blas_info = { "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], "library_dirs": [ @@ -174,15 +173,11 @@ def _skl_get_blas_info(): if libdir: base = os.path.split(libdir)[0] blas_info["include_dirs"] = [os.path.join(base, "include")] - - if on_cibw_mac(): - blas_info['include_dirs'] = ['/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers/'] - print("\n\n*** blas_info: \n%r\n\n ***\n\n" % blas_info) - print( - "\n\n*** os.environ.get('OPENBLAS') = %r ***\n\n" - % (os.environ.get("OPENBLAS", None)) - ) + if on_cibw_mac(): + blas_info["include_dirs"] = [ + "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers/" + ] return cblas_libs, blas_info @@ -203,7 +198,6 @@ def get_lapack_info(): if on_cibw_win(): lapack_info = get_info("lapack_opt", notfound_action=0) - print("***\nDetected lapack info: %r" % lapack_info) lapack_info = { "define_macros": [("NO_ATLAS_INFO", 1), ("HAVE_CBLAS", None)], "library_dirs": [ @@ -247,12 +241,6 @@ def get_lapack_info(): else: lapack_libs = lapack_info.pop("libraries", []) - print("\n\n*** lapack_info: \n%r\n\n ***\n\n" % lapack_info) - print( - "\n\n*** os.environ.get('LAPACK') = %r ***\n\n" - % (os.environ.get("LAPACK", None)) - ) - return lapack_libs, lapack_info @@ -308,13 +296,6 @@ def configuration(): if USE_CYTHON: config.ext_modules = cythonize(config.ext_modules) - print("\n\n *** CONFIG ***\n") - print(config) - print("\n\n *** EXT_MODULE ***\n") - from pprint import pprint - - print(pprint(config.ext_modules[0].__dict__)) - return config @@ -341,42 +322,8 @@ def check_requirements(): raise ImportError(numpy_instructions) -def cibuildwheel_windows(): - if not on_cibw_win(): - return - print("\n*** Preparing GenSVM for CIBuildWheel ***") - - 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\\openblas\\OpenBLAS.0.2.14.1\\lib\\native" - dllpath = basepath + "\\lib\\" + bitprefix + "\\libopenblas.dll.a" - print("dllpath: %s" % dllpath) - if os.path.exists(dllpath): - shutil.move(dllpath, basepath + "\\lib\\libopenblas.lib") - print(os.listdir(basepath + "\\lib")) - - os.environ[ - "OPENBLAS" - ] = "C:\\cibw\\openblas\\OpenBLAS.0.2.14.1\\lib\\native\\lib" - print(os.environ.get("OPENBLAS", "none")) - - for path, dirs, files in os.walk("C:\\cibw\\openblas"): - print(path, file=sys.stderr) - for f in files: - print("\t" + f, file=sys.stderr) - sys.stderr.flush() - import time - - time.sleep(5) - - if __name__ == "__main__": check_requirements() - cibuildwheel_windows() version = re.search( '__version__ = "([^\']+)"', open("gensvm/__init__.py").read() -- cgit v1.2.3