Package Details: python-numpy-mkl 1.13.3-1

Git Clone URL: https://aur.archlinux.org/python-numpy-mkl.git (read-only)
Package Base: python-numpy-mkl
Description: Scientific tools for Python compiled with intel mkl
Upstream URL: http://numpy.scipy.org/
Keywords: numpy
Licenses: custom
Conflicts: python-numpy, python3-numpy
Provides: python-numpy=1.13.3, python3-numpy=1.13.3
Replaces: python3-numpy
Submitter: bred
Maintainer: bred
Last Packager: bred
Votes: 24
Popularity: 1.638215
First Submitted: 2012-08-25 16:55
Last Updated: 2017-10-07 16:48

Required by (338)

Sources (3)

Latest Comments

gwaterst commented on 2017-10-19 17:39

@derdigge:

You need to obtain a license for your intel software:
https://software.intel.com/en-us/parallel-studio-xe/choose-download

derdigge commented on 2017-10-18 15:08

Buils failed for me even using the PKGBUIL mentioned by gwaterst.

https://pastebin.com/ZpBKGwfk

gwaterst commented on 2017-10-05 11:09

Sorry there indeed was a typo. The line was supposed to be:

export __INTEL_PRE_CFLAGS="$__INTEL_PRE_CFLAGS -D_Float128=__float128"

(Someone might have defined __INTEL_PRE_CFLAGS system-wide so I keep the previous definition and append the float128 option to it)

Here is my entire functional (at least for me) PKGBUILD:

################################################################################
################################################################################
pkgbase="python-numpy-mkl"
pkgname="python-numpy-mkl"
true && pkgname=('python-numpy-mkl' 'python2-numpy-mkl')
#pkgname=('python-numpy')
pkgver=1.13.2
pkgrel=1
pkgdesc="Scientific tools for Python compiled with intel mkl"
arch=('i686' 'x86_64')
license=('custom')
options=('staticlibs')
url="http://numpy.scipy.org/"
depends=( 'intel-mkl' 'python' 'python2' )
makedepends=( 'python-setuptools' 'python2-setuptools' 'intel-compiler-base' 'intel-fortran-compiler' 'python-nose' 'python2-nose' 'cython' 'glibc')

source=( https://github.com/numpy/numpy/archive/v${pkgver}.tar.gz
'site64.cfg'
'site32.cfg')

sha256sums=( '11add7a40a868e70b7de8e568e5f20504f4dbfc7fce18887472220c2f5167ae4' # main pkg§
'86cd68a695a5e1d76f8e53cda70c888c4ed04349f15c8096d4492e346e7187e1' # site64
'882f2717deca0fd6a2e2384aac2dc7973c566f9cd2ba46777c3b5ffdffa814df' # site32
)

build() {

cd "${srcdir}"

if [ "$CARCH" = "i686" ]; then
cp ${srcdir}/site32.cfg ${srcdir}/site.cfg
_compiler=intel
else
cp ${srcdir}/site64.cfg ${srcdir}/site.cfg
_compiler=intelem
fi


cp -a numpy-${pkgver} numpy-py2-${pkgver}

export Atlas=None
export LDFLAGS="$LDFLAGS -shared"
export __INTEL_PRE_CFLAGS="$__INTEL_PRE_CFLAGS -D_Float128=__float128"

echo "Building Python2"
cd "${srcdir}"
cp ${srcdir}/site.cfg "${srcdir}/numpy-py2-${pkgver}"
cd "${srcdir}/numpy-py2-${pkgver}"

python2 setup.py config --compiler=${_compiler} build_clib --compiler=${_compiler} build_ext --compiler=${_compiler}

echo "Building Python3"
cd "${srcdir}"
cp ${srcdir}/site.cfg "${srcdir}/numpy-${pkgver}"
cd "${srcdir}/numpy-${pkgver}"

python setup.py config --compiler=${_compiler} build_clib --compiler=${_compiler} build_ext --compiler=${_compiler}
}

package_python2-numpy-mkl() {

depends=('intel-mkl' 'python2')
provides=( "python2-numpy=${pkgver}" )
replaces=( "python2-numpy" )
conflicts=( "python2-numpy" )
optdepends=('python-nose: testsuite')

cd "${srcdir}/numpy-py2-${pkgver}"
python2 setup.py config_fc install --prefix=/usr --root="${pkgdir}" --optimize=1

install -m755 -d "${pkgdir}/usr/share/licenses/python2-numpy"
install -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/python2-numpy/"

sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
-e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
-e "s|#![ ]*/bin/env python$|#!/usr/bin/env python2|" \
$(find ${pkgdir} -name '*.py')
}

package_python-numpy-mkl() {

depends=('intel-mkl' 'python')
provides=("python3-numpy=${pkgver}" "python-numpy=${pkgver}")
replaces=('python3-numpy')
conflicts=('python3-numpy' 'python-numpy')

cd "${srcdir}/numpy-${pkgver}"
python setup.py config_fc install --prefix=/usr --root="${pkgdir}" --optimize=1

install -m755 -d "${pkgdir}/usr/share/licenses/python3-numpy"
install -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/python3-numpy/"
}
################################################################################
################################################################################

invik commented on 2017-10-04 08:45

@arvidsaur

I think gwaterst had a typo. Should be:

export __INTEL_PRE_CFLAGS=" -D_Float128=__float128"

It worked for me by putting it like that right under the "build() {" line.

arvidsaur commented on 2017-10-04 07:20

@gwaterst:

Sorry if this is a stupid question, but where in the PKGBUILD should "export __INTEL_PRE_CFLAGS="__INTEL_PRE_CFLAGS -D_Float128=__float128" be entered?

Because I got "File not found: __INTEL_PRE_CFLAGS" when trying that method.

However adding "-D_Float128=__float128" in the icc.cfg file worked.

gwaterst commented on 2017-10-03 12:34

The makedepend glibc<2.26 can be removed when the following line is added to the PKGBUILD:

export __INTEL_PRE_CFLAGS="__INTEL_PRE_CFLAGS -D_Float128=__float128"

invik commented on 2017-10-02 16:23

@gwaterst:

It seems that the problem with gcc7 and glibc 2.26 related to "_Float128" is known:

https://software.intel.com/en-us/forums/intel-c-compiler/topic/742701

In the last post, they recommend a temporary fix: to add "-D_Float128=__float128" to the compiler flags.

I have been trying, and I have been able to compile the package with gcc7 + glibc 2.26 by including the suggested define to the files icc.cfg, icpc.cfg and ifort.cfg under /opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/

gwaterst commented on 2017-09-21 13:54

Downgrading to glibc 2.25 (during building) appears to solve the problem.

Additionally intel.py and intelccompiler.py are provided in the source package and the __init__ patches are not needed anymore, so I have update the PKGBUILD:

# $Id: PKGBUILD 164237 2012-07-28 03:14:33Z stephane $
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Douglas Soares de Andrade <dsa@aur.archlinux.org>
# Contributor: Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve>
# Adapted to mkl by Simone Riva
pkgbase="python-numpy-mkl"
pkgname="python-numpy-mkl"
true && pkgname=('python-numpy-mkl' 'python2-numpy-mkl')
#pkgname=('python-numpy')
pkgver=1.13.1
pkgrel=1
pkgdesc="Scientific tools for Python compiled with intel mkl"
arch=('i686' 'x86_64')
license=('custom')
options=('staticlibs')
url="http://numpy.scipy.org/"
depends=( 'intel-mkl' 'python' 'python2' )
makedepends=( 'python-setuptools' 'python2-setuptools' 'intel-compiler-base' 'intel-fortran-compiler' 'python-nose' 'python2-nose' 'cython' 'glibc<2.26' )

source=( https://github.com/numpy/numpy/archive/v${pkgver}.tar.gz
'site64.cfg'
'site32.cfg')

sha256sums=( 'cf8652b96582b282a5bb710aa4fe2300dca63bdd678a3cd7820314cb6c97ca89' # main pkg§
'86cd68a695a5e1d76f8e53cda70c888c4ed04349f15c8096d4492e346e7187e1' # site64
'882f2717deca0fd6a2e2384aac2dc7973c566f9cd2ba46777c3b5ffdffa814df' # site32
)

build() {

cd "${srcdir}"

if [ "$CARCH" = "i686" ]; then
cp ${srcdir}/site32.cfg ${srcdir}/site.cfg
_compiler=intel
else
cp ${srcdir}/site64.cfg ${srcdir}/site.cfg
_compiler=intelem
fi


cp -a numpy-${pkgver} numpy-py2-${pkgver}

export Atlas=None
export LDFLAGS="$LDFLAGS -shared"

echo "Building Python2"
cd "${srcdir}"
cp ${srcdir}/site.cfg "${srcdir}/numpy-py2-${pkgver}"
cd "${srcdir}/numpy-py2-${pkgver}"

python2 setup.py config --compiler=${_compiler} build_clib --compiler=${_compiler} build_ext --compiler=${_compiler}

echo "Building Python3"
cd "${srcdir}"
cp ${srcdir}/site.cfg "${srcdir}/numpy-${pkgver}"
cd "${srcdir}/numpy-${pkgver}"

python setup.py config --compiler=${_compiler} build_clib --compiler=${_compiler} build_ext --compiler=${_compiler}
}

package_python2-numpy-mkl() {

depends=('intel-mkl' 'python2')
provides=( "python2-numpy=${pkgver}" )
replaces=( "python2-numpy" )
conflicts=( "python2-numpy" )
optdepends=('python-nose: testsuite')

cd "${srcdir}/numpy-py2-${pkgver}"
python2 setup.py config_fc install --prefix=/usr --root="${pkgdir}" --optimize=1

install -m755 -d "${pkgdir}/usr/share/licenses/python2-numpy"
install -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/python2-numpy/"

sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
-e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
-e "s|#![ ]*/bin/env python$|#!/usr/bin/env python2|" \
$(find ${pkgdir} -name '*.py')
}

package_python-numpy-mkl() {

depends=('intel-mkl' 'python')
provides=("python3-numpy=${pkgver}" "python-numpy=${pkgver}")
replaces=('python3-numpy')
conflicts=('python3-numpy' 'python-numpy')

cd "${srcdir}/numpy-${pkgver}"
python setup.py config_fc install --prefix=/usr --root="${pkgdir}" --optimize=1

install -m755 -d "${pkgdir}/usr/share/licenses/python3-numpy"
install -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/python3-numpy/"
}

gwaterst commented on 2017-09-21 12:32

The problem with _Float128 is the recent update to glibc 2.26 and that icc only works with gcc up to version 6.3...

Haven't found a way to fix this anyways..

I have filed a bug report upstream:
https://github.com/numpy/numpy/issues/9731

arvidsaur commented on 2017-09-20 08:14

Hello,
I am getting the following errors when trying to build this.

First lots of "identifier "_Float128" is undefined for lots of functions:

In file included from /usr/include/math.h(315),
from /opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include/math.h(95),
from /usr/include/python2.7/pyport.h(325),
from /usr/include/python2.7/Python.h(58),
from _configtest.c(1):
/usr/include/bits/mathcalls.h(85): error: identifier "_Float128" is undefined
__MATHCALL (acosh,, (_Mdouble_ __x));

Then the build ends with:

failure.
removing: _configtest.c _configtest.o
Traceback (most recent call last):
File "setup.py", line 392, in <module>
setup_package()
File "setup.py", line 384, in setup_package
setup(**metadata)
File "/home/arvid/builds/python-numpy-mkl/src/numpy-py2-1.13.1/numpy/distutils/core.py", line 169, in setup
return old_setup(**new_attr)
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/arvid/builds/python-numpy-mkl/src/numpy-py2-1.13.1/numpy/distutils/command/build_clib.py", line 74, in run
self.run_command('build_src')
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/arvid/builds/python-numpy-mkl/src/numpy-py2-1.13.1/numpy/distutils/command/build_src.py", line 148, in run
self.build_sources()
File "/home/arvid/builds/python-numpy-mkl/src/numpy-py2-1.13.1/numpy/distutils/command/build_src.py", line 165, in build_sources
self.build_extension_sources(ext)
File "/home/arvid/builds/python-numpy-mkl/src/numpy-py2-1.13.1/numpy/distutils/command/build_src.py", line 324, in build_extension_sources
sources = self.generate_sources(sources, ext)
File "/home/arvid/builds/python-numpy-mkl/src/numpy-py2-1.13.1/numpy/distutils/command/build_src.py", line 377, in generate_sources
source = func(extension, build_dir)
File "numpy/core/setup.py", line 421, in generate_config_h
moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
File "numpy/core/setup.py", line 47, in check_types
out = check_types(*a, **kw)
File "numpy/core/setup.py", line 280, in check_types
"install {0}-dev|{0}-devel.".format(python))
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
==> ERROR: A failure occurred in build().

Any pointers on how I can debug this is appreciated.

dkumor commented on 2017-08-11 05:09

Thanks for the update! The "intel.py" file has changed in 1.13.1 (fixing the version bug), so I believe that it needs to have its checksum updated.

As a side note, won't this file be downloaded with the source anyways? Why is it downloaded separately?

Cheers!

dkumor commented on 2017-07-18 18:46

Please update to 1.13.1 - 1.13.0 fails compilation with

AttributeError: LooseVersion instance has no attribute 'split'

This was fixed in 1.13.1:
https://github.com/numpy/numpy/pull/9299

gergi commented on 2017-02-07 14:09

Add dependency 'cython'.

tsumina commented on 2017-01-20 07:15

@ricrogz you can try to make a symbol link of /opt/intel/mkl to /opt/intel/composerxe/mkl and this should work.

invik commented on 2016-10-16 11:07

As @bear mentioned, the current intel-mkl installs to a different path than mentioned in the site*.cfg files (/opt/intel/mkl instead of /opt/intel/composerxe/mkl).

Due to this, the package, as it is right now, is compiling *without* mkl support.

matrs commented on 2016-03-05 05:37

I did the changes suggested by @bear in the site files(hint: edit site files and install using --skipinteg) and it found the mkl library which previously didn't (FOUND: libraries = ['mkl_rt', 'pthread']). The thing is that if you dont make those changes it doesn't found the mkl library and still builds, so it's easy to believe that everything is working but your numpy is using another blas library.

liubenyuan commented on 2016-02-26 04:51

@bear

Thanks ! It works.

BTW, when compile, -openmp may be deprecated, it suggests using -qopenmp

bear commented on 2016-02-25 18:07

The site.cfg is not correct, after changed to the following, can import correctly after installed.

[mkl]
library_dirs = /opt/intel/mkl/lib/intel64
include_dirs = /opt/intel/mkl/include
mkl_libs = mkl_rt
lapack_libs =

liubenyuan commented on 2016-02-25 14:44

and can this package be compiled using -iopm5 instead of -openmp ?

liubenyuan commented on 2016-02-25 14:32

@trovao

Thanks ! I install the patchelfmod in aur (this package needs update, for example the pkgname is patchelfmod however the source dir is patchelf), and numpy.test() works fine.

and i think a patch in linking to libirc.so is needed :)

anyway, thanks for your solution !

liubenyuan commented on 2016-02-25 14:18

@trovao

I can only find patchelf in my archlinux, where could I get patchelfmod ?

BTW: I also tried to add -lirc in LDFLAGS, is it correct to do so?

trovao commented on 2016-02-25 11:51

@liubenyuan, @benob

I've solved this with patchelfmod by adding a dependency explicitly on the shared object files:

$ sudo patchelfmod -a libirc.so /usr/lib/python2.7/site-packages/numpy/linalg/_umath_linalg.so
sudo patchelfmod -a libirc.so /usr/lib/python3.5/site-packages/numpy/linalg/_umath_linalg.cpython-35m-x86_64-linux-gnu.so

I've tried tweaking the intelccompiler.py to include -lirc, but it seems my flags weren't enough.

liubenyuan commented on 2016-02-25 02:20

@benob

same problem here. using intel-mkl 2016.1.30

benob commented on 2015-07-14 09:51

Installs fine with intel parallel studio xe 2015, but when I import numpy I get the following error:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/numpy/__init__.py", line 170, in <module>
from . import add_newdocs
File "/usr/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/lib/python2.7/site-packages/numpy/lib/__init__.py", line 18, in <module>
from .polynomial import *
File "/usr/lib/python2.7/site-packages/numpy/lib/polynomial.py", line 19, in <module>
from numpy.linalg import eigvals, lstsq, inv
File "/usr/lib/python2.7/site-packages/numpy/linalg/__init__.py", line 51, in <module>
from .linalg import *
File "/usr/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 29, in <module>
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: /usr/lib/python2.7/site-packages/numpy/linalg/_umath_linalg.so: undefined symbol: _intel_fast_memset

Preloading the libirc.so library fixes the problem, but I would like a better solution.
LD_PRELOAD=/opt/intel/composer_xe_2015.3.187/compiler/lib/intel64/libirc.so python2

gilli commented on 2014-11-14 17:10

My installation failed because intel-fortran-compiler and intel-compiler-base targets havn't been found.

I guess this is a dependency issue.

bred commented on 2013-11-15 08:34

The conflicts are solved automatically by pacman.
python-numpy (form extra) will be removed automatically.

enedene commented on 2013-11-14 16:06

When installing python-numpy-mkl, do I need to remove the python-numpy from extra repository first? Are there conflicts? Or is it all done automatically?

bred commented on 2013-11-12 17:31

Note:
This Pkg must be compiled in couple with intel parallel studio:
https://aur.archlinux.org/packages/intel-parallel-studio-xe/

bred commented on 2013-11-08 14:53

Yes is still maintained.
But I've never seen the patch.

I'll fix the problem shorter:
http://www.scipy.org/scipylib/building/linux.html#intel-mkl-11-0-updated-dec-2012

iosonofabio commented on 2013-11-08 12:36

Is this package still maintained? Are the changes suggested by spleach going to be included?

Thanks!

spleach commented on 2013-09-10 21:01

Some of the dependencies in the PKGBUILD seem unnecessary.. The distribute dependencies should instead be replaced with setuptools, which are in the [extra] repo, whereas the python[2]-distribute packages in `depends` aren't available via pacman or the AUR.

Also, nose packages are also only required for testing, not for packaging, so should be listed either in `optdepends` or `checkdepends`.

Finally, on x86_64 systems, setup.py should be passed `--compiler=intelem` instead of `--compiler=intel`. I'll attach a patch in a minute...

jdarch commented on 2013-09-08 08:53

I can understand one might want to use Intel's compiler suite in addition to the MKL, but would a dependency on 'intel-mkl' not suffice for a minimal 'python-numpy-mkl'-package?

Anonymous comment on 2013-07-23 10:02

numpy-1.7.1 is out.

bred commented on 2013-02-17 09:46

For this PKGBUILD you must use the imtel-mkl and intel-compilers provided in the Intel parallel studio XE:

See:
https://aur.archlinux.org/packages.php?ID=56337

Nabobalis commented on 2012-10-05 12:10

Thanks for this. So does this create a python 2 and 3 version of numpy with mkl?

bred commented on 2012-10-03 06:28

Edit this line in the PKGBUILD

pkgname=('python-numpy-mkl')
true && pkgname=( 'python2-numpy-mkl') <<<<<< !!!

Remove 'python-numpy-mkl 'from the list.

kuantkid commented on 2012-10-03 06:17

There is one error here:
compile options: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include -I/usr/include/python2.7 -c'
icc: _configtest.c
icc -O3 -fPIC -fp-model strict -fomit-frame-pointer -openmp -xHost -w _configtest.o -o _configtest
ld: cannot find -limf
ld: cannot find -lsvml
ld: cannot find -lipgo
ld: cannot find -ldecimal
ld: cannot find -liomp5
ld: cannot find -lirc
ld: cannot find -limf
ld: cannot find -lsvml
ld: cannot find -lipgo
ld: cannot find -ldecimal
ld: cannot find -liomp5
ld: cannot find -lirc

kuantkid commented on 2012-10-03 05:40

How can I just build python2-numpy-mkl without installing python3 and related dependences?

bred commented on 2012-09-17 19:00

For this PKGBUILD you must use the imtel-mkl provided in the Intel parallel studio XE:

https://aur.archlinux.org/packages.php?ID=56337