[Rd] Intel MKL compiling issue

jing hua zhao jinghuazhao at hotmail.com
Fri Apr 21 10:44:19 CEST 2017


Dear Prof Ripley,


This must be confusing as I am able to compile on our RHEL6:


$ uname -a
Linux b08.mrc-epid.private.cam.ac.uk 2.6.32-642.3.1.el6.x86_64 #1 SMP Sun Jun 26 18:16:44 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Copyright (C) 2010 Free Software Foundation, Inc.

The script now mirrors those on the Scientific Linux 6

# 21-4-2017 MRC-Epid JHZ

export MKL_NUM_THREAD=15
export MKL=/genetics/data/software/intel/composer_xe_2013.4.183/mkl
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MKLROOT/lib/intel64
./configure LDFLAGS=-L/genetics/data/software/lib CPPFLAGS=-I/genetics/data/software/include --enable-R-shlib \
--with-lapack \
--with-blas="-fopenmp -m64 -I$MKL/include -L$MKL/lib/intel64 -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lpthread -lm"
make


> sessionInfo()
R Under development (unstable) (2017-04-20 r72569)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server release 6.8 (Santiago)

Matrix products: default
BLAS/LAPACK: /genetics/data/software/intel/composer_xe_2013.4.183/composer_xe_2013.4.183/mkl/lib/intel64/libmkl_gf_lp64.so

locale:
 [1] LC_CTYPE=en_US.utf8       LC_NUMERIC=C
 [3] LC_TIME=en_US.utf8        LC_COLLATE=en_US.utf8
 [5] LC_MONETARY=en_US.utf8    LC_MESSAGES=en_US.utf8
 [7] LC_PAPER=en_US.utf8       LC_NAME=C
 [9] LC_ADDRESS=C              LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_3.5.0


Thanks for looking into these; I should have been more patient.


Best regards,



Jing Hua

________________________________
From: jing hua zhao <jinghuazhao at hotmail.com>
Sent: 20 April 2017 19:27
To: Prof Brian Ripley; r-devel at r-project.org
Subject: Re: [Rd] Intel MKL compiling issue


On our Scientific Linux 6, there is


gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)


and later version (a symbolic at HOME to the system directory),

export MKL=/home/jhz22/11.3.3.210/mkl
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MKLROOT/lib/intel64
./configure --prefix=/home/jhz22 LDFLAGS=-L/home/jhz22/lib CPPFLAGS=-I/home/jhz22/include  \
--enable-R-shlib --with-lapack \
--with-blas="-fopenmp -m64 -I$MKL/include -L$MKL/lib/intel64 -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lpthread -lm"


The errors are as follows,


/usr/bin/ld: warning: libpcre.so.1, needed by ../../lib/libR.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: liblzma.so.5, needed by ../../lib/libR.so, not found (try using -rpath or -rpath-link)
../../lib/libR.so: undefined reference to `pcre_exec'
../../lib/libR.so: undefined reference to `pcre_study'
../../lib/libR.so: undefined reference to `lzma_alone_decoder at XZ_5.0'
../../lib/libR.so: undefined reference to `pcre_fullinfo'
../../lib/libR.so: undefined reference to `lzma_stream_decoder at XZ_5.0'
../../lib/libR.so: undefined reference to `pcre_version'
../../lib/libR.so: undefined reference to `pcre_maketables'
../../lib/libR.so: undefined reference to `lzma_stream_encoder at XZ_5.0'
../../lib/libR.so: undefined reference to `pcre_free'
../../lib/libR.so: undefined reference to `lzma_raw_decoder at XZ_5.0'
../../lib/libR.so: undefined reference to `lzma_lzma_preset at XZ_5.0'
../../lib/libR.so: undefined reference to `lzma_version_string at XZ_5.0'
../../lib/libR.so: undefined reference to `pcre_jit_stack_alloc'
../../lib/libR.so: undefined reference to `pcre_free_study'
../../lib/libR.so: undefined reference to `lzma_crc64 at XZ_5.0'
../../lib/libR.so: undefined reference to `pcre_assign_jit_stack'
../../lib/libR.so: undefined reference to `lzma_end at XZ_5.0'
../../lib/libR.so: undefined reference to `lzma_raw_encoder at XZ_5.0'
../../lib/libR.so: undefined reference to `pcre_config'
../../lib/libR.so: undefined reference to `pcre_compile'
../../lib/libR.so: undefined reference to `lzma_code at XZ_5.0'
collect2: ld returned 1 exit status
make[3]: *** [R.bin] Error 1
make[3]: Leaving directory `/home/jhz22/R-devel/src/main'
make[2]: *** [R] Error 2
make[2]: Leaving directory `/home/jhz22/R-devel/src/main'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/home/jhz22/R-devel/src'
make: *** [R] Error 1


However, once --enable-R-shlib is dropped, the compile is successful. I suppose I can live with this though the option is required by RStudio. For the MKL version I reported earlier, I have on our RHEL6,


gcc --version

gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)


The error is as follows -- I did try various versions of pcre and gcc 4.8.2 as well with similar error messages.


ranlib libR.a
gcc -std=gnu99 -Wl,--export-dynamic -fopenmp    -L/usr/local/lib64 -o R.bin Rmain.o CommandLineArgs.o Rdynload.o Renviron.o RNG.o agrep.o apply.o arithmetic.o array.o attrib.o bind.o builtin.o character.o coerce.o colors.o complex.o connections.o context.o cum.o dcf.o datetime.o debug.o deparse.o devices.o dotcode.o dounzip.o dstruct.o duplicate.o edit.o engine.o envir.o errors.o eval.o format.o gevents.o gram.o gram-ex.o graphics.o grep.o identical.o inlined.o inspect.o internet.o iosupport.o lapack.o list.o localecharset.o logic.o main.o mapply.o match.o memory.o names.o objects.o options.o paste.o platform.o plot.o plot3d.o plotmath.o print.o printarray.o printvector.o printutils.o qsort.o radixsort.o random.o raw.o registration.o relop.o rlocale.o saveload.o scan.o seq.o serialize.o sort.o source.o split.o sprintf.o startup.o subassign.o subscript.o subset.o summary.o sysutils.o times.o unique.o util.o version.o g_alab_her.o g_cntrlify.o g_fontdb.o g_her_glyph.o xxxpr.o   `ls ../unix/*.o ../appl/*.o ../nmath/*.o` ../extra/tre/libtre.a    -fopenmp -m64 -I/genetics/data/software/intel/composer_xe_2013.4.183/mkl/include -L/genetics/data/software/intel/composer_xe_2013.4.183/mkl/lib/intel64 -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lpthread -lm -lgfortran -lm   -lreadline  -lpcre -llzma -lbz2 -lz -lrt -ldl -lm
grep.o: In function `setup_jit':
/genetics/data/software/R-devel/src/main/grep.c:109: undefined reference to `pcre_assign_jit_stack'
/genetics/data/software/R-devel/src/main/grep.c:106: undefined reference to `pcre_jit_stack_alloc'
grep.o: In function `do_regexpr':
/genetics/data/software/R-devel/src/main/grep.c:2832: undefined reference to `pcre_free_study'
grep.o: In function `do_gsub':
/genetics/data/software/R-devel/src/main/grep.c:2116: undefined reference to `pcre_free_study'
grep.o: In function `do_grep':
/genetics/data/software/R-devel/src/main/grep.c:1109: undefined reference to `pcre_free_study'
grep.o: In function `do_strsplit':
/genetics/data/software/R-devel/src/main/grep.c:629: undefined reference to `pcre_free_study'
collect2: ld returned 1 exit status
make[3]: *** [R.bin] Error 1
make[3]: Leaving directory `/genetics/data/software/R-devel/src/main'
make[2]: *** [R] Error 2
make[2]: Leaving directory `/genetics/data/software/R-devel/src/main'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/genetics/data/software/R-devel/src'
make: *** [R] Error 1


________________________________
From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
Sent: 20 April 2017 16:48
To: jing hua zhao; r-devel at r-project.org
Subject: Re: [Rd] Intel MKL compiling issue

There is nothing here indicating any kind of error, so no way to give
any insights ....

And please do follow the posting guide, including not posting HTML.

FWIW, I have tested R 3.4.0 RC (sic) with MKL 11.3, which is later than
your 2013 ... (on x86_64 Fedora 24).


On 20/04/2017 10:39, jing hua zhao wrote:
> Dear R-developers,
>
>
> I would appreciate any insights over compiling R 3.4 with Intel MKL -- I have been successful until R 3.3.3 but now it stops complaining about pcre though it worked without Intel MKL as follows,
>
>
> ./configure LDFLAGS=-L/genetics/data/software/lib CFLAGS=-fPIC -I/genetics/data/software/include --enable-R-shlib
>
>
> I have used,
>
>
> export MKL_NUM_THREADS=15
> export MKLROOT=/genetics/data/software/intel/composer_xe_2013.4.183/mkl
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MKLROOT/lib/intel64
> /genetics/data/software/intel/composer_xe_2013.4.183/mkl/bin/mklvars.sh intel64
> CPPFLAGS="-I/genetics/data/software/include -L/genetics/data/software/lib" \
> ./configure --prefix=/genetics/data/software --enable-R-shlib --enable-threads=posix --with-lapack \
>  --with-blas="-fopenmp -m64 -I$MKLROOT/include -L$MKLROOT/lib/intel64 -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lpthread -lm"
>
>
> Many thanks,
>
>
>
> Jing Hua
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


--
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford

	[[alternative HTML version deleted]]



More information about the R-devel mailing list