diff options
author | Alexander Phinikarides | 2016-01-20 22:57:04 +0200 |
---|---|---|
committer | Alexander Phinikarides | 2016-01-20 22:57:04 +0200 |
commit | 52943b52fcf94ad1fcbe21fe661dd0fc74f5d534 (patch) | |
tree | c3d3bc026ccd31ce540fc43050fe5de7df46cc02 | |
parent | eab0a5279f7c945a53f48a1e3edc162d2fe48868 (diff) | |
download | aur-52943b52fcf94ad1fcbe21fe661dd0fc74f5d534.tar.gz |
fixed compilation without icc
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 261 |
2 files changed, 159 insertions, 109 deletions
@@ -1,7 +1,7 @@ # Generated by mksrcinfo v8 -# Fri Jan 15 13:05:52 UTC 2016 +# Wed Jan 20 20:55:51 UTC 2016 pkgbase = r-mkl - pkgdesc = Language and environment for statistical computing and graphics, set up to use Intel's MKL + pkgdesc = Language and environment for statistical computing and graphics, set up to use Intel's MKL by default. pkgver = 3.2.3 pkgrel = 1 url = http://www.r-project.org/ @@ -9,7 +9,7 @@ pkgbase = r-mkl arch = i686 arch = x86_64 license = GPL - makedepends = jdk8-openjdk-infinality + makedepends = jdk8-openjdk makedepends = gcc-fortran makedepends = tk depends = intel-mkl @@ -30,6 +30,7 @@ pkgbase = r-mkl depends = desktop-file-utils depends = zip depends = unzip + depends = openmp optdepends = tk: tcl/tk interface optdepends = texlive-bin: latex sty files optdepends = icc: intel compiler @@ -1,62 +1,91 @@ -# Maintainer: halfhorn <mwellsa -at- gmail -dot- com> +# Maintainer: alexanderp <alexisph -at- gmail -dot- com> +# Contributor: halfhorn <mwellsa -at- gmail -dot- com> # Contributor: jdarch <jda -dot- cloud -plus- archlinux -at- gmail -dot- com> # Based on the PKGBUILD for R pkgname=r-mkl pkgver=3.2.3 pkgrel=1 -pkgdesc="Language and environment for statistical computing and graphics, set up to use Intel's MKL" +pkgdesc="Language and environment for statistical computing and graphics, set up to use Intel's MKL by default." arch=('i686' 'x86_64') license=('GPL') url=('http://www.r-project.org/') provides=("r=${pkgver}","r-mkl=${pkgver}") conflicts=('r') -depends=('intel-mkl' 'bzip2' 'libpng' 'libjpeg' 'libtiff' - 'ncurses' 'pcre' 'readline' 'zlib' 'perl' 'gcc-libs' - 'libxt' 'libxmu' 'pango' 'xz' 'desktop-file-utils' 'zip' 'unzip') -makedepends=('jdk8-openjdk-infinality' 'gcc-fortran' 'tk') -optdepends=('tk: tcl/tk interface' 'texlive-bin: latex sty files' - 'icc: intel compiler' 'icpc: intel compiler' 'xiar: intel compiler' +depends=('intel-mkl' + 'bzip2' + 'libpng' + 'libjpeg' + 'libtiff' + 'ncurses' + 'pcre' + 'readline' + 'zlib' + 'perl' + 'gcc-libs' + 'libxt' + 'libxmu' + 'pango' + 'xz' + 'desktop-file-utils' + 'zip' + 'unzip' + 'openmp') +makedepends=('jdk8-openjdk' + 'gcc-fortran' + 'tk') +optdepends=('tk: tcl/tk interface' + 'texlive-bin: latex sty files' + 'icc: intel compiler' + 'icpc: intel compiler' + 'xiar: intel compiler' 'xild: intel compiler') -backup=('etc/R/Makeconf' 'etc/R/Renviron' 'etc/R/ldpaths' 'etc/R/repositories' 'etc/R/javaconf') +backup=('etc/R/Makeconf' + 'etc/R/Renviron' + 'etc/R/ldpaths' + 'etc/R/repositories' + 'etc/R/javaconf') options=('!makeflags' '!emptydirs') install=r-mkl.install source=("http://cran.r-project.org/src/base/R-${pkgver%%.*}/R-${pkgver}.tar.gz" - 'r.desktop' - 'r.png' - 'R.conf') + 'r.desktop' + 'r.png' + 'R.conf') md5sums=('1ba3dac113efab69e706902810cc2970' - '44ca875140b148543148b7749c7d6f5e' - '00659f39e90627fe87f1645df5d4e3a7' - '1dfa62c812aed9642f6e4ac34999b9fe') + '44ca875140b148543148b7749c7d6f5e' + '00659f39e90627fe87f1645df5d4e3a7' + '1dfa62c812aed9642f6e4ac34999b9fe') sha512sums=('9d7294af860204f4d84e25eb503111c9607beedbc42f01de073c915945a6342c3e24e25a9cc038a2e58442036bee931975d93dc327081ed02afe5ffa365170ea' '1a90aed5411d72dd3e7708db0cb92c518e656e1a510ece02ad934131e05b8e683b4a36da8d37198263dc19fb2f3f19656c19c01f9b67974f0d7755974076d0b7' '55ed6e819dcbb231d842d825134b84d1a24db177558d5dad9369d57fd21d0239d6433c4311531171a101ca3c7c0685493e9cc6c1fe9e4e0df59f2331cff150ba' 'aae388c5b6c02d9fb857914032b0cd7d68a9f21e30c39ba11f5a29aaf1d742545482054b57ce18872eabb6605bbb359b2fc1e9be5ce6881443fdbdf6b67fab3b') if [ "$CARCH" == "x86_64" ]; then - _intel_arch=intel64 - _intel_lib=mkl_intel_lp64 + _intel_arch=intel64 + _intel_lib=mkl_intel_lp64 elif [ "$CARCH" == "i686" ]; then - _intel_arch=ia32 - _intel_lib=mkl_gf + _intel_arch=ia32 + _intel_lib=mkl_gf fi -_CC="icc" # uncomment to build with the Intel compiler +_CC="icc" # comment to build without the Intel compiler prepare() { - cd R-${pkgver} - # set texmf dir correctly in makefile - sed -i 's|$(rsharedir)/texmf|${datarootdir}/texmf|' share/Makefile.in - # fix for texinfo 5.X - sed -i 's|test ${makeinfo_version_min} -lt 7|test ${makeinfo_version_min} -lt 0|' configure - # Fix the config script to look in Makeconf for LDFLAGS - sed -i '/LIBS=`eval $query VAR=LIBS`/a\LDFLAGS=`eval $query VAR=LDFLAGS`' src/scripts/config + cd R-${pkgver} + # set texmf dir correctly in makefile + sed -i 's|$(rsharedir)/texmf|${datarootdir}/texmf|' share/Makefile.in + # fix for texinfo 5.X + sed -i 's|test ${makeinfo_version_min} -lt 7|test ${makeinfo_version_min} -lt 0|' configure + # Fix the config script to look in Makeconf for LDFLAGS + sed -i '/LIBS=`eval $query VAR=LIBS`/a\LDFLAGS=`eval $query VAR=LDFLAGS`' src/scripts/config } build() { + cd R-${pkgver} + + if [ $_CC = "icc" ]; then # Set up the environment for MKL source /opt/intel/mkl/bin/mklvars.sh ${_intel_arch} source /opt/intel/composerxe/linux/bin/ifortvars.sh ${_intel_arch} @@ -64,93 +93,113 @@ build() { _mkllibpath=$MKLROOT/lib/${_intel_arch} _openmplibpath=${PROD_DIR}/compiler/lib/intel64 _mkllibs="-L${_mkllibpath} -L${_openmplibpath} -Wl,--no-as-needed \ - -l${_intel_lib} \ - -lmkl_intel_thread \ - -lmkl_core \ - -liomp5 -ldl -lpthread -lm" + -l${_intel_lib} \ + -lmkl_intel_thread \ + -lmkl_core \ + -liomp5 -ldl -lpthread -lm" LDFLAGS="${LDFLAGS} -L${_icclibpath}" export MAIN_LDFLAGS="-qopenmp" - - - if [ $_CC = "icc" ]; then - export CC="icc" - export CXX="icpc" - export AR="xiar" - export LD="xild" - export _F77="ifort" - export _FC="ifort" - export CFLAGS="-O3 -ipo -qopenmp -parallel -xHost -fp-model strict -qopt-mem-layout-trans=3 -I${MKLROOT}/include" - export CXXFLAGS="-O3 -ipo -qopenmp -parallel -xHost -fp-model strict -qopt-mem-layout-trans=3 -I${MKLROOT}/include" - export FFLAGS="-O3 -ipo -qopenmp -parallel -xHost -fp-model strict -qopt-mem-layout-trans=3 -I${MKLROOT}/include" - export FCFLAGS="-O3 -ipo -qopenmp -parallel -xHost -fp-model strict -qopt-mem-layout-trans=3 -I${MKLROOT}/include" - else - export _F77="gfortran" - export _FC="gfortran" - fi - - cd R-${pkgver} + + export CC="icc" + export CXX="icpc" + export AR="xiar" + export LD="xild" + export _F77="ifort" + export _FC="ifort" + export CFLAGS="-O3 -ipo -qopenmp -parallel -xHost -fp-model strict -qopt-mem-layout-trans=3 -I${MKLROOT}/include" + export CXXFLAGS="-O3 -ipo -qopenmp -parallel -xHost -fp-model strict -qopt-mem-layout-trans=3 -I${MKLROOT}/include" + export FFLAGS="-O3 -ipo -qopenmp -parallel -xHost -fp-model strict -qopt-mem-layout-trans=3 -I${MKLROOT}/include" + export FCFLAGS="-O3 -ipo -qopenmp -parallel -xHost -fp-model strict -qopt-mem-layout-trans=3 -I${MKLROOT}/include" + ./configure --prefix=/usr \ - --libdir=/usr/lib \ - --sysconfdir=/etc/R \ - --datarootdir=/usr/share \ - rsharedir=/usr/share/R/ \ - rincludedir=/usr/include/R/ \ - rdocdir=/usr/share/doc/R/ \ - --with-x \ - --with-blas="${_mkllibs}" \ - --with-lapack \ - --enable-R-shlib \ - --enable-memory-profiling \ - --enable-BLAS-shlib \ - --enable-openmp \ - F77=${_F77} \ - FC=${_FC} \ - LIBnn=lib - - # Place Intel's basic math library prior to GLIBC libm + --libdir=/usr/lib \ + --sysconfdir=/etc/R \ + --datarootdir=/usr/share \ + rsharedir=/usr/share/R/ \ + rincludedir=/usr/include/R/ \ + rdocdir=/usr/share/doc/R/ \ + --with-x \ + --with-blas="${_mkllibs}" \ + --with-lapack \ + --enable-R-shlib \ + --enable-memory-profiling \ + --enable-BLAS-shlib \ + --enable-openmp \ + F77=${_F77} \ + FC=${_FC} \ + LIBnn=lib + + # Place Intel's basic math library prior to GLIBC libm sed -i "s/\(^\| \)-lm\( \|$\)/\1-limf -lm\2/g" {./,etc/}Makeconf - - # Build the package - make - - # make libRmath.so - cd src/nmath/standalone - make shared + + else + export _F77="gfortran" + export _FC="gfortran" + export CFLAGS="-O3 -fopenmp" + export CXXFLAGS="-O3 -fopenmp" + export FFLAGS="-O3 -fopenmp" + export FCFLAGS="-O3 -fopenmp" + + ./configure --prefix=/usr \ + --libdir=/usr/lib \ + --sysconfdir=/etc/R \ + --datarootdir=/usr/share \ + rsharedir=/usr/share/R/ \ + rincludedir=/usr/include/R/ \ + rdocdir=/usr/share/doc/R/ \ + --with-x \ + --with-blas \ + --with-lapack \ + --enable-R-shlib \ + --enable-memory-profiling \ + --enable-openmp \ + F77=${_F77} \ + FC=${_FC} \ + LIBnn=lib + fi + + # Build the package + make + + # make libRmath.so + cd src/nmath/standalone + make shared } check() { - cd R-${pkgver} - make check-recommended + cd R-${pkgver} + make check-recommended } package() { - cd R-${pkgver} - make DESTDIR="${pkgdir}" install - - # install libRmath.so - cd src/nmath/standalone - make DESTDIR="${pkgdir}" install - - # Fixup R wrapper scripts. - sed -i "s|${pkgdir} ||" "${pkgdir}/usr/bin/R" - rm "${pkgdir}/usr/lib/R/bin/R" - cd "${pkgdir}/usr/lib/R/bin" - ln -s ../../../bin/R - - # install some freedesktop.org compatibility - install -Dm644 "${srcdir}/r.desktop" \ - "${pkgdir}/usr/share/applications/r.desktop" - install -Dm644 "${srcdir}/r.png" \ - "${pkgdir}/usr/share/pixmaps/r.png" - - # move the config directory to /etc and create symlinks - install -d "${pkgdir}/etc/R" - cd "${pkgdir}/usr/lib/R/etc" - for i in *; do - mv -f ${i} "${pkgdir}/etc/R" - ln -s /etc/R/${i} ${i} - done - - # Install ld.so.conf.d file to ensure other applications access the shared lib - install -Dm644 "${srcdir}/R.conf" "${pkgdir}/etc/ld.so.conf.d/R.conf" + cd R-${pkgver} + make DESTDIR="${pkgdir}" install + + # install libRmath.so + cd src/nmath/standalone + make DESTDIR="${pkgdir}" install + + # Fixup R wrapper scripts. + sed -i "s|${pkgdir} ||" "${pkgdir}/usr/bin/R" + rm "${pkgdir}/usr/lib/R/bin/R" + cd "${pkgdir}/usr/lib/R/bin" + ln -s ../../../bin/R + + # install some freedesktop.org compatibility + install -Dm644 "${srcdir}/r.desktop" \ + "${pkgdir}/usr/share/applications/r.desktop" + install -Dm644 "${srcdir}/r.png" \ + "${pkgdir}/usr/share/pixmaps/r.png" + + # move the config directory to /etc and create symlinks + install -d "${pkgdir}/etc/R" + cd "${pkgdir}/usr/lib/R/etc" + for i in *; do + mv -f ${i} "${pkgdir}/etc/R" + ln -s /etc/R/${i} ${i} + done + + # Install ld.so.conf.d file to ensure other applications access the shared lib + install -Dm644 "${srcdir}/R.conf" "${pkgdir}/etc/ld.so.conf.d/R.conf" } + |