オランのまったりな
開発日記
Building Numpy for Maya Python (2.7)
Sorry, failed to load main article image
Bantukul Olarn
    
Dec 16 2020 16:49
  

But why?

The process

mayapy.exe setup.py bdist_wheel

Building the BLAS backend (OpenBLAS)

Numpy Mingw Build Tools.jpg

make \
-j 4 \
BINARY=64 \
HOSTCC=gcc \
CC=gcc \
FC=gfortran \
CFLAGS='-static -static-libgcc -static-libstdc++ -fopenmp' \
CXXFLAGS='-static -static-libgcc -static-libstdc++ -fopenmp' \
FFLAGS='-static -fopenmp' \
BUILD_WITHOUT_LAPACK=0 \
NOFORTRAN=0 \
DYNAMIC_ARCH=1 \
USE_THREAD=1 \
USE_OPENMP=1 \
NUM_THREADS=64 \
MAKE_BUILD_TYPE=Release

Compiled OpenBLAS Binaries.JPG

Building and packaging

[DEFAULT]
library_dirs = ..\opt\0.3.13-omp\lib
include_dirs = ..\opt\0.3.13-omp

[openblas]
openblas_libs = openblas

[blas_opt]
blas_opt_libs = openblas

[lapack]
lapack_libs = openblas

[lapack_opt]
lapack_opt_libs = openblas

import distutils.dist
from distutils.command import build_ext
bld_ext = build_ext.build_ext(distutils.dist.Distribution())
bld_ext.finalize_options()
print(bld_ext.include_dirs)
# ['C:\\Program Files\\Autodesk\\Maya2018\\Python\\include',
# 'C:\\Program Files\\Autodesk\\Maya2018\\Python\\PC']
print(bld_ext.library_dirs)
# ['C:\\Program Files\\Autodesk\\Maya2018\\Python\\libs',
# 'C:\\Program Files\\Autodesk\\Maya2018\\Python\\PC\\VC6']

Check your results!

Numpy Dependency Test.jpg

Tags:

No tags found