I have an AMD Ryzen 7 2700X and I’m trying to compile Numpy in Anaconda virtual environment using the BLIS/Lapack libraries of AMD AOCL 4.2,that I installed locally.
I tried to compile through pip in three different modes, but always without success because via msvc the settings of .pc are not detected, while by gcc the blis is downloaded remotely instead of using the blis/ AOCL that I installed on the PC.
Following the instructions from Building from source — NumPy, I installed GCC in in c:ming32 togheter with pkg_config 0.26, and also VisualStudio 2022, pip 23.3.1,python 3.9.19.
I set the following environment variables:
Path = …,C:mingw32bin, C:mingw32
PKG_CONFIG_PATH = C:UsersAugDesktopAOCLpc
VLANG = 1033
BLIS_ENABLE_CBLAS = 1
NPY_BLAS_ORDER = BLIS
NPY_LAPACK_ORDER = LAPLACK
NPY_USE_BLAS_ILP64 = 1
pkg-config files in C:UsersAugDesktopAOCLpc:
[AOCL-LibBlis-Win.pc]
libdir= C:Program FilesAMDAOCL-Windowsamd-blislibILP64
includedir= C:Program FilesAMDAOCL-Windowsamd-blisincludeILP64
version= 1.0
Name: AOCL-LibBlis-Win
Description: AOCL Perf Libraries
Version: ${version}
Cflags: -I${includedir}
Libs: -L${libdir} -lAOCL-LibBlis-Win
[AOCL-LibFlame-Win.pc]
libdir= C:Program FilesAMDAOCL-Windowsamd-libflamelibILP64
includedir= C:Program FilesAMDAOCL-Windowsamd-libflameincludeILP64
version= 1.0
Name: AOCL-LibFlame-Win
Description: AOCL LibFlame-Win Perf Libraries
Version: ${version}
Cflags: -I${includedir}
Libs: -L${libdir} -lAOCL-LibFlame-Win # linker flags
check
(numpy24) C:UsersAug>pkg-config –list-all
AOCL-LibBlis-Win AOCL-LibBlis-Win – AOCL Perf Libraries
AOCL-LibFlame-Win AOCL-LibFlame-Win – AOCL LibFlame-Win Perf Libraries
(numpy24) C:UsersAug>pkg-config --libs AOCL-LibBlis-Win
FilesAMDAOCL-Windowsamd-blislibILP64 -LC:Program -lAOCL-LibBlis-Win
following the various attempts:
python -m pip install numpy –no-binary numpy
numpy.show_config() shows that the compiler used is msvc, but the blas library is “auto”
python -m pip install numpy –no-binary numpy -Csetup-args=-Dblas=blis -Csetup-args=-Duse-ilp64=true –no-cache-dir
specifing the libraries to use, gcc is invoked but I have the error:
Need python for x86, but found x86_64
To avoid this problem I used the .bat for MSVC: vcvars64.bat and then I added this configuration file too distutils.cfg:
[build]
compiler=mingw32
trying again with:
python -m pip install numpy –no-binary numpy -Csetup-args=-Dblas=blis -Csetup-args=-Duse-ilp64=true –no-cache-dir
numpy is compiled by msvc but using “blas”: {“name”: “blis” }, and “lapack”: {“name”: “dep1569490624224”.
How could I associate the desired library with Numpy? Thanks
user25005585 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.