diff --git a/component/libatlas/buildout.cfg b/component/libatlas/buildout.cfg new file mode 100644 index 0000000000000000000000000000000000000000..36d0170bacb7f3ea76bad3c73c74b19d1f51a175 --- /dev/null +++ b/component/libatlas/buildout.cfg @@ -0,0 +1,70 @@ +[buildout] +parts = + libatlas + + +[skip-throttle-check.patch] +recipe = hexagonit.recipe.download +md5sum = 17c8471d67c99fac80ace05273ce0817 +url = ${:_profile_base_location_}/${:filename} +filename = ${:_buildout_section_name_} +download-only = true + + +[atlas-download] +recipe = hexagonit.recipe.download +version = 3.10.1 +filename = atlas${:version}.tar.bz2 +url = http://downloads.sourceforge.net/project/math-atlas/Stable/${:version}/${:filename} +md5sum = 78753e869231cc1417a92eebaa076718 +download-only = true +mode = 0644 +location = ${buildout:parts-directory}/${:_buildout_section_name_} + + +[lapack-download] +recipe = hexagonit.recipe.download +version = 3.5.0 +filename = lapack-${:version}.tgz +url = http://www.netlib.org/lapack/${:filename} +md5sum = b1d3e3e425b2e44a06760ff173104bdf +download-only = true +mode = 0644 +location = ${buildout:parts-directory}/${:_buildout_section_name_} + + + +[libatlas] +recipe = cp.recipe.cmd +location = ${buildout:parts-directory}/${:_buildout_section_name_} +lapack_version = 3.5.0 +install_cmd = + set -e + mkdir -p ${:location}__compile__ + cd ${:location}__compile__ + export SRCdir=`pwd`/ATLAS + export BLDdir=`pwd`/build + tar xfj ${atlas-download:location}/${atlas-download:filename} + cd $SRCdir + # http://stackoverflow.com/questions/14592401/atlas-install-really-need-to-get-past-cpu-throttle-check + # http://sourceforge.net/p/math-atlas/support-requests/886/ + patch -p1 <${skip-throttle-check.patch:location}/${skip-throttle-check.patch:filename} + mkdir -p $BLDdir + cd $BLDdir + export F77LIB=${gcc-fortran:location}/lib64/libgfortran.so.3 + export LD_PRELOAD=$F77LIB + $SRCdir/configure -b 64 \ + --prefix=${:location} \ + --with-netlib-lapack-tarfile=${lapack-download:location}/${lapack-download:filename} \ + -C acg ${gcc-fortran:location}/bin/gcc \ + -C if ${gcc-fortran:location}/bin/gfortran \ + --shared + + #-Ss f77lib `${gcc-fortran:location}/bin/gfortran --print-file-name=libgfortran.so` \ + + make build # tune & build lib + make check # sanity check correct answer +# make ptcheck # sanity check parallel + make time # check if lib is fast + make install # copy libs to install dir + diff --git a/component/libatlas/skip-throttle-check.patch b/component/libatlas/skip-throttle-check.patch new file mode 100644 index 0000000000000000000000000000000000000000..2b8762c8903539c2ae66ee8d576e23a53bc205d7 --- /dev/null +++ b/component/libatlas/skip-throttle-check.patch @@ -0,0 +1,14 @@ +diff --git a/CONFIG/src/probe_arch.c b/CONFIG/src/probe_arch.c +index 75edef9..f440bf6 100644 +--- a/CONFIG/src/probe_arch.c ++++ b/CONFIG/src/probe_arch.c +@@ -238,8 +238,7 @@ int main(int nargs, char **args) + printf("CPU MHZ=%d\n", + ProbeOneInt(OS, asmd, targ, "-m", "CPU MHZ=", &sure)); + if (flags & Pthrottle) +- printf("CPU THROTTLE=%d\n", +- ProbeOneInt(OS, asmd, targ, "-t", "CPU THROTTLE=", &sure)); ++ printf("CPU THROTTLE=0\n"); + if (flags & P64) + { + if (asmd == gas_x86_64) diff --git a/component/libblas/buildout.cfg b/component/libblas/buildout.cfg new file mode 100644 index 0000000000000000000000000000000000000000..9d24c1b236481824d11d4073c717a4a217bf1b8d --- /dev/null +++ b/component/libblas/buildout.cfg @@ -0,0 +1,29 @@ +[buildout] +parts = + libblas + + +[libblas] +recipe = cp.recipe.cmd +location = ${buildout:parts-directory}/${:_buildout_section_name_} +gfortran=${gcc-fortran:location}/bin/gfortran +gcc=${gcc-fortran:location}/bin/gcc +install_cmd = + set -e + mkdir -p ${:location}__compile__ + cd ${:location}__compile__ + wget -nc http://www.netlib.org/blas/blas.tgz + tar xzf blas.tgz + cd BLAS + ${:gfortran} -O3 -std=legacy -m64 -fno-second-underscore -fPIC -c *.f + ar r libfblas.a *.o + ranlib libfblas.a + ${:gcc} -shared -Wl,-soname,libf77blas.so.3 -o libf77blas.so.3.0.0 *.o -lc + # rm -rf *.o + mkdir -p ${:location} + mv libfblas.a ${:location}/ + cp libf77blas.so.3.0.0 ${:location}/ + cd ${:location} + ln -sf libf77blas.so.3.0.0 libf77blas.so.3.0 + ln -sf libf77blas.so.3.0 libf77blas.so.3 + diff --git a/component/numpy/buildout.cfg b/component/numpy/buildout.cfg new file mode 100644 index 0000000000000000000000000000000000000000..26e1091f2b6e531fff2859689c058a37355f8ba3 --- /dev/null +++ b/component/numpy/buildout.cfg @@ -0,0 +1,76 @@ +[buildout] + +extends = + ../git/buildout.cfg + ../gcc/buildout.cfg + ../libatlas/buildout.cfg + ../libblas/buildout.cfg + + +[scipy-repository.git] +recipe = slapos.recipe.build:gitclone +repository = https://github.com/mmariani/scipy.git +# bumped version number to ensure we're using the freshly compiled egg +branch = 0.13.3001 +git-executable = ${git:location}/bin/git + +[scikit-learn-repository.git] +recipe = slapos.recipe.build:gitclone +repository = https://github.com/scikit-learn/scikit-learn.git +branch = master +git-executable = ${git:location}/bin/git + + +[build-venv] +dependency = ${prerequired-eggs:recipe} +recipe = cp.recipe.cmd +location = ${buildout:parts-directory}/${:_buildout_section_name_} +install_cmd = + if [ -d ${:location} ]; then + exit + fi + mkdir -p ${:location} + cd ${:location} + unset PYTHONPATH + export PATH="${gcc-fortran:location}/bin:$PATH" + export LD_PRELOAD="${gcc-fortran:location}/lib64/libgfortran.so.3 ${libblas:location}/libf77blas.so.3" + export ATLAS=${libatlas:location}/lib/libsatlas.so + export BLAS=${libblas:location}/lib/libfblas.a + export LAPACK=${libatlas:location}/lib/liblapack.a + ${python2.7-virtualenv:executable} ${:location} + . ${:location}/bin/activate + ${:location}/bin/pip install numpy + ${:location}/bin/pip install Tempita + export PYTHONPATH=${buildout:eggs-directory}/numpy-${versions:numpy}-py2.7-linux-x86_64.egg + cd ${scipy-repository.git:location} + python setupegg.py bdist_egg + cd ${scikit-learn-repository.git:location} + python setup.py bdist_egg +update_cmd = ${:install_cmd} + + +[prerequired-eggs] +recipe = zc.recipe.egg +eggs = + slapos.cookbook + numpy + + +[numpy-eggs] +dependencies = ${build-venv:recipe} +recipe = zc.recipe.egg +find-links = + ${scipy-repository.git:location}/dist + ${scikit-learn-repository.git:location}/dist +eggs = + numpy + scipy + scikit-learn +interpreter = python-numpy + + +[versions] +numpy = 1.8.1 +scipy = 0.13.3001 +scikit-learn = 0.16-git + diff --git a/component/numpy/software.cfg b/component/numpy/software.cfg new file mode 100644 index 0000000000000000000000000000000000000000..deaf83039ae05e208fc26fcf05c5ebb729a57b3c --- /dev/null +++ b/component/numpy/software.cfg @@ -0,0 +1,15 @@ +# A minimal software release to test the numpy component (depends on gfortran). + +[buildout] +extends = + ../../stack/slapos.cfg + ../../component/numpy/buildout.cfg + +parts = + numpy-eggs + +[versions] +numpy = 1.8.1 +scipy = 0.13.3001 +scikit-learn = 0.16-git + diff --git a/stack/erp5/buildout.cfg b/stack/erp5/buildout.cfg index 9983a6b4d1b5a68895e15b03e001dc554606ed8b..9b83c9d96550878e07754e1aa5731bc0dd7dd580 100644 --- a/stack/erp5/buildout.cfg +++ b/stack/erp5/buildout.cfg @@ -66,6 +66,7 @@ extends = ../../component/aspell/buildout.cfg ../../component/cloudooo/buildout.cfg ../../component/jsl/buildout.cfg + ../../component/numpy/buildout.cfg parts = rdiff-backup @@ -430,6 +431,7 @@ ZODB3-patch-binary = ${patch:location}/bin/patch [eggs] recipe = zc.recipe.egg eggs = + ${numpy-eggs:eggs} ${mysql-python:egg} ${lxml-python:egg} ${pil-python:egg} @@ -581,7 +583,7 @@ setuptools = 2.2 huBarcode = 0.63 # Known version with works -numpy = 1.6.2 +numpy = 1.8.1 # test_UserManagerInterfaces in testERP5Security fails with 1.10.0. Products.PluggableAuthService = 1.9.0