Build mlpy with python3.3 (64bit) (windows 64bit)

Build mlpy in windows 64bit environment

The binary for windows of mlpy is provided only for 32bit, so build it by yourself. usage environment:

Preparation

Get the library you need

Install numpy, scipy

If you're trying to use mlpy, you probably already have it installed. If not, install it with pip install numpy scipy

GSL build

You will need a static library. I used to build another GSL more than half a year ago, but now it seems that things are changing.

Before

When I did it, I referred to the link below. It was surprisingly easy.

Current

Now the link to the visual studio project is gone. The version is a little old, but gsl-1.15-vc10.zip I found a page that distributes. There was also something that looked like an All in One package (gnu-gsl-for-windows). I'm not using either, so I'm not sure if it's really available.

Fix mlpy

Modify the source code for 64-bit environment.

Changed " win32 " in setup.py to " win-amd64 ". However, the 25th line remains as it is

before

setup.py(29-41 lines)


#### libs
if get_platform() == "win32":
   gsl_lib = ['gsl', 'cblas']
   math_lib = []
else:
   gsl_lib = ['gsl', 'gslcblas']
   math_lib = ['m']
   
#### Extra compile args
if get_platform() == "win32":
   extra_compile_args = []
else:
   extra_compile_args = ['-Wno-strict-prototypes']

after

setup.py(29-41 lines)


#### libs
if get_platform() == "win-amd64":
   gsl_lib = ['gsl', 'cblas']
   math_lib = []
else:
   gsl_lib = ['gsl', 'gslcblas']
   math_lib = ['m']
   
#### Extra compile args
if get_platform() == "win-amd64":
   extra_compile_args = []
else:
   extra_compile_args = ['-Wno-strict-prototypes']

Fixed double-byte characters in comments. Removed Θ and double quotes (”)

before

mlpy/fastcluster/fastcluster/src/fastcluster.cpp(630-632 lines)


    // Complexity: Θ(size)
    // Reference: Cormen, Leiserson, Rivest, Stein, Introduction to Algorithms,
    // 3rd ed., 2009, Section 6.3 “Building a heap”

after Delete comment

Change np.int_t to np.int64_t

If you do not correct it, a runtime error will occur due to a mismatch between int type and long long type, and even Tutorial cannot be executed. __ There may be other areas that need to be fixed, but I haven't found them yet __ before

mlpy/libsvm/libsvm.pyx(28-32 lines)


# array 1D to svm node
cdef svm_node *array1d_to_node(np.ndarray[np.float64_t, ndim=1] x):
    cdef int i, k
    cdef np.ndarray[np.int_t, ndim=1] nz
    cdef svm_node *ret

after

mlpy/libsvm/libsvm.pyx(28-32 lines)


# array 1D to svm node
cdef svm_node *array1d_to_node(np.ndarray[np.float64_t, ndim=1] x):
    cdef int i, k
    cdef np.ndarray[np.int64_t, ndim=1] nz
    cdef svm_node *ret

before

mlpy/adatron/adatron.pyx(69-73 lines)


        
        cdef np.ndarray[np.int_t, ndim=1] ynew
        cdef np.ndarray[np.float_t, ndim=2] K_arr
        cdef np.ndarray[np.float_t, ndim=1] alpha_arr
        cdef double margin

after

mlpy/adatron/adatron.pyx(69-73 lines)


        
        cdef np.ndarray[np.int64_t, ndim=1] ynew
        cdef np.ndarray[np.float_t, ndim=2] K_arr
        cdef np.ndarray[np.float_t, ndim=1] alpha_arr
        cdef double margin

build mlpy

Sorry I made you wait later

set LIB=%LIB%;(gsl.lib,cblas.Directory with lib)
python setup.py build_ext --include-dirs=(gsl include directory)
python setup.py install

Or(If you installed anaconda)
python setup.py build_ext --include-dirs=(gsl include directory) --compiler=msvc install

It is completed with. Thank you for your hard work.

Recommended Posts

Build mlpy with python3.3 (64bit) (windows 64bit)
Python starting with Windows 7
Python with VS Code (Windows 10)
Run python with PyCharm (Windows)
Build python3 environment with ubuntu 16.04
Build Python environment on Windows
Build python environment with direnv
Full bit search with Python
Build python environment on windows
Let's build git-cat with Python
Time synchronization (Windows) with Python
Build a Python extension for E-Cell 4 on Windows 7 (64bit)
Installing Kivy on Windows10 64bit Python3.5
Build python virtual environment with virtualenv
Put MeCab in "Windows 10; Python3.5 (64bit)"
Install python2.7 on windows 32bit environment
Learn search with Python # 2bit search, permutation search
Build Mysql + Python environment with docker
Installing Kivy-Designer on Windows10 64bit Python3.5
Use Windows 10 speech synthesis with Python
Automatically build Python documentation with Sphinx
Build Python3 for Windows 10 on ARM with Visual Studio 2019 (x86) on Windows 10 on ARM
[2021 version] Python installation Windows 10 (64bit) edition
Getting started with Python 3.8 on Windows
Build Vim with MinGW. (+ lua, + python)
Build python 1.0
[Python] Creating multiple windows with Tkinter
[Python Windows] pip install with Python version
Change Python 64bit environment to 32bit environment with Anaconda
Run servo with Python on ESP32 (Windows)
Build Jupyter Lab (Python) environment with Docker
Python 2.7, 3.4, 3.5 extension module build environment on Windows
Build a blockchain with Python ① Create a class
Develop Windows apps with Python 3 + Tkinter (Preparation)
Build Python environment with Anaconda on Mac
Build a python virtual environment with pyenv
Build a modern Python environment with Neovim
Build AI / machine learning environment with Python
Statistics with python
Python with Go
python windows environment
Twilio with Python
Integrate with Python
Python installation (Windows)
Play with 2016-Python
AES256 with python
Tested with Python
python starts with ()
with syntax (Python)
Bingo with python
Zundokokiyoshi with python
PYTHON2.7 64bit version
Excel with Python
Microcomputer with Python
Cast with python
Project cannot be created with Python3.5 (Windows) + django1.7.1
Build python environment with pyenv on EC2 (ubuntu)
Use dein.vim and ckw-mod with Windows7 32bit PowerShell
Simply build a Python 3 execution environment on Windows
Build Python development environment with Visual Studio Code
Build a python environment with ansible on centos6