scipy在cygwin的安装

折腾一天,总结一下:

下载lapack-3.7.1,拷贝install目录下的make.inc.gfortran.到上一级目录,改名make.inc

OPTS    = -O2 -frecursive -m64 -fPIC
DRVOPTS = $(OPTS)
NOOPT   = -O0 -frecursive -m64 -fPIC

加上m64,fPIC对于amd64没用,加上无妨

make

然后到CBLAS目录下make,生成libcblas.a

在scipy源代码目录site.cfg文件中加入

[cblas]
library_dirs = /home/wuzhiqiao/lapack-3.7.1/lapack-3.7.1
blas_libs = cblas
extra_compile_args =-m64




[blas]
library_dirs = /home/wuzhiqiao/lapack-3.7.1/lapack-3.7.1
blas_libs = blas
extra_compile_args =-m64
[lapack]
library_dirs = /home/wuzhiqiao/lapack-3.7.1/lapack-3.7.1
lapack_libs = lapack
extra_compile_args =-m64


再修改F:\cygwin64\lib\python2.7\site-packages\numpy\distutils\system_info.py文件

加入extra_preargs="-m64"


    def has_cblas(self, info):
        # primitive cblas check by looking for the header and trying to link
        # cblas or blas
        res = False
        c = distutils.ccompiler.new_compiler()
        c.customize('')
        tmpdir = tempfile.mkdtemp()
        s = """#include <cblas.h>
        int main(int argc, const char *argv[])
        {
            double a[4] = {1,2,3,4};
            double b[4] = {5,6,7,8};
            return cblas_ddot(4, a, 1, b, 1) > 10;
        }"""
        src = os.path.join(tmpdir, 'source.c')
        try:
            with open(src, 'wt') as f:
                f.write(s)


            try:
                # check we can compile (find headers)
                obj = c.compile([src], output_dir=tmpdir,
                                include_dirs=self.get_include_dirs(), extra_preargs="-m64")


最后在scipy根目录下python setup.py install,这样可以不用编译MKL


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值