Default R-3.4.0 RC CXXFLAGS without -O2 on x86_64-linux-gnu with g++-5.4.0 causes WARNING from stl_list.h

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Default R-3.4.0 RC CXXFLAGS without -O2 on x86_64-linux-gnu with g++-5.4.0 causes WARNING from stl_list.h

Steffen Neumann
Hi r-devel,

a recent install of R-3.4.0 RC (2017-04-13 r72510) 
on Linux (Ubuntu 16.04.1 LTS) x86_64-linux-gnu 
with g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
(see http://bioconductor.org/checkResults/devel/bioc-LATEST/malbec2-NodeInfo.html for more) 
results in CXXFLAGS not containing "-O2" as optimisation flag,
there is only " -Wall", while CFLAGS are happy with "-g -O2
-Wall"

This has an influence in at least one place
https://stat.ethz.ch/pipermail/bioc-devel/2017-April/010733.html
where we have WARNINGS in R CMD check from "Found ‘abort’, 
possibly from ‘abort’ (C)" in packages xcms/mzR.
The abort() call is not coming from XCMS, but rather 
from the C++ code in the STL:

        [...]
        # 1770 "/usr/include/c++/5/bits/stl_list.h"
        void _M_check_equal_allocators(list& __x) {
         if (_M_get_Node_allocator())
           __builtin_abort();
        }

If we compile with -O2 optimisation, this getting rid of 
the abort() symbol, as shown 
in https://github.com/sneumann/xcms/issues/150#issuecomment-293545521

Martin Morgan created a minimum example that shows that 
the symbol is indeed deep down in the STL (see below and in:
https://stat.ethz.ch/pipermail/bioc-devel/2017-April/010837.html )

This raises several questions:

1) is there any way to avoid the WARNING / abort() inside 
   the STL list implementation ? Or just live with it ?

2) If not, is there a reason why the Bioconductor build farm 
   Ubuntu machine is not using -O2 as default CXXFLAG ?
   BioC admins are trying to have a vanilla R installation with defaults. 
   According to Herve Pages, CXXFLAGS without -O2 is default 
   since R-3.4 beta, but I don't know enough about the package 
   build logic to point to a particular R commit. 

3) I thought about cheating the system and add -O2 
   in the package CXXFLAGS, but Martin Morgan 
   recommends packages shouldn't mess and override system build defaults
   to mask and paper over the actual issue having a nasty abort() 
   lurking somewhere.
   But I couldn't add PKG_CXXFLAGS=-O2 in first place, since that 
   triggers the different WARNING that -O2 is not portable. 

=> Any help and input would be highly appreciated. 

Thanks in advance, 
yours,
Steffen


tmp.cpp by Martin Morgan (also in above linked mail thread)
-------
#include <list>

int foo(int argc, const char *argv[]) {
     std::list<int> l1, l2;
     std::list<int>::iterator it;

     it = l1.begin();
     l1.splice (it, l2); // mylist1: 1 10 20 30 2 3 4

     return 0;
}
-------

Test with

   rm -f tmp.o && R CMD SHLIB tmp.cpp && nm tmp.o | grep abort

with compiler settings in ~/.R/Makevars with/without -O2
-------------
CXXFLAGS = -g -O0
-------------





--
IPB Halle                    AG Massenspektrometrie &
Bioinformatik
Dr. Steffen Neumann          http://www.IPB-Halle.DE
Weinberg 3                   Tel. +49 (0) 345 5582 - 1470
06120 Halle                       +49 (0) 345 5582 - 0           
sneumann(at)IPB-Halle.DE     Fax. +49 (0) 345 5582 - 1409

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Default R-3.4.0 RC CXXFLAGS without -O2 on x86_64-linux-gnu with g++-5.4.0 causes WARNING from stl_list.h

Martyn Plummer-3
This is fixed in R-rc_2017-04-19_r72555.tar.gz

If you are affected by this issue then please test the RC tarball. This
is the last chance to detect problems (including those created by the
last-minute patch) before the release of R 3.4.0.

Martyn

On Wed, 2017-04-19 at 12:19 +0000, Neumann, Steffen wrote:

> Hi r-devel,
>
> a recent install of R-3.4.0 RC (2017-04-13 r72510) 
> on Linux (Ubuntu 16.04.1 LTS) x86_64-linux-gnu 
> with g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
> (see http://bioconductor.org/checkResults/devel/bioc-LATEST/malbec2-N
> odeInfo.html for more) 
> results in CXXFLAGS not containing "-O2" as optimisation flag,
> there is only " -Wall", while CFLAGS are happy with "-g -O2
> -Wall"
>
> This has an influence in at least one place
> https://stat.ethz.ch/pipermail/bioc-devel/2017-April/010733.html
> where we have WARNINGS in R CMD check from "Found ‘abort’, 
> possibly from ‘abort’ (C)" in packages xcms/mzR.
> The abort() call is not coming from XCMS, but rather 
> from the C++ code in the STL:
>
> [...]
> # 1770 "/usr/include/c++/5/bits/stl_list.h"
> void _M_check_equal_allocators(list& __x) {
>  if (_M_get_Node_allocator())
>    __builtin_abort();
> }
>
> If we compile with -O2 optimisation, this getting rid of 
> the abort() symbol, as shown 
> in https://github.com/sneumann/xcms/issues/150#issuecomment-293545521
>
> Martin Morgan created a minimum example that shows that 
> the symbol is indeed deep down in the STL (see below and in:
> https://stat.ethz.ch/pipermail/bioc-devel/2017-April/010837.html )
>
> This raises several questions:
>
> 1) is there any way to avoid the WARNING / abort() inside 
>    the STL list implementation ? Or just live with it ?
>
> 2) If not, is there a reason why the Bioconductor build farm 
>    Ubuntu machine is not using -O2 as default CXXFLAG ?
>    BioC admins are trying to have a vanilla R installation with
> defaults. 
>    According to Herve Pages, CXXFLAGS without -O2 is default 
>    since R-3.4 beta, but I don't know enough about the package 
>    build logic to point to a particular R commit. 
>
> 3) I thought about cheating the system and add -O2 
>    in the package CXXFLAGS, but Martin Morgan 
>    recommends packages shouldn't mess and override system build
> defaults
>    to mask and paper over the actual issue having a nasty abort() 
>    lurking somewhere.
>    But I couldn't add PKG_CXXFLAGS=-O2 in first place, since that 
>    triggers the different WARNING that -O2 is not portable. 
>
> => Any help and input would be highly appreciated. 
>
> Thanks in advance, 
> yours,
> Steffen
>
>
> tmp.cpp by Martin Morgan (also in above linked mail thread)
> -------
> #include <list>
>
> int foo(int argc, const char *argv[]) {
>      std::list<int> l1, l2;
>      std::list<int>::iterator it;
>
>      it = l1.begin();
>      l1.splice (it, l2); // mylist1: 1 10 20 30 2 3 4
>
>      return 0;
> }
> -------
>
> Test with
>
>    rm -f tmp.o && R CMD SHLIB tmp.cpp && nm tmp.o | grep abort
>
> with compiler settings in ~/.R/Makevars with/without -O2 
> -------------
> CXXFLAGS = -g -O0
> -------------
>
>
>
>
>
> --
> IPB Halle                    AG Massenspektrometrie &
> Bioinformatik
> Dr. Steffen Neumann          http://www.IPB-Halle.DE
> Weinberg 3                   Tel. +49 (0) 345 5582 - 1470
> 06120 Halle                       +49 (0) 345 5582 - 0           
> sneumann(at)IPB-Halle.DE     Fax. +49 (0) 345 5582 - 1409
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Intel MKL compiling issue

jing hua zhao
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]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Intel MKL compiling issue

Prof Brian Ripley
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]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


--
Brian D. Ripley,                  [hidden email]
Emeritus Professor of Applied Statistics, University of Oxford

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Intel MKL compiling issue

jing hua zhao
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@XZ_5.0'
../../lib/libR.so: undefined reference to `pcre_fullinfo'
../../lib/libR.so: undefined reference to `lzma_stream_decoder@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@XZ_5.0'
../../lib/libR.so: undefined reference to `pcre_free'
../../lib/libR.so: undefined reference to `lzma_raw_decoder@XZ_5.0'
../../lib/libR.so: undefined reference to `lzma_lzma_preset@XZ_5.0'
../../lib/libR.so: undefined reference to `lzma_version_string@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@XZ_5.0'
../../lib/libR.so: undefined reference to `pcre_assign_jit_stack'
../../lib/libR.so: undefined reference to `lzma_end@XZ_5.0'
../../lib/libR.so: undefined reference to `lzma_raw_encoder@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@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 <[hidden email]>
Sent: 20 April 2017 16:48
To: jing hua zhao; [hidden email]
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]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


--
Brian D. Ripley,                  [hidden email]
Emeritus Professor of Applied Statistics, University of Oxford

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Intel MKL compiling issue

jing hua zhao
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 <[hidden email]>
Sent: 20 April 2017 19:27
To: Prof Brian Ripley; [hidden email]
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@XZ_5.0'
../../lib/libR.so: undefined reference to `pcre_fullinfo'
../../lib/libR.so: undefined reference to `lzma_stream_decoder@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@XZ_5.0'
../../lib/libR.so: undefined reference to `pcre_free'
../../lib/libR.so: undefined reference to `lzma_raw_decoder@XZ_5.0'
../../lib/libR.so: undefined reference to `lzma_lzma_preset@XZ_5.0'
../../lib/libR.so: undefined reference to `lzma_version_string@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@XZ_5.0'
../../lib/libR.so: undefined reference to `pcre_assign_jit_stack'
../../lib/libR.so: undefined reference to `lzma_end@XZ_5.0'
../../lib/libR.so: undefined reference to `lzma_raw_encoder@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@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 <[hidden email]>
Sent: 20 April 2017 16:48
To: jing hua zhao; [hidden email]
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]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


--
Brian D. Ripley,                  [hidden email]
Emeritus Professor of Applied Statistics, University of Oxford

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Intel MKL compiling issue

Cohn, Robert S
In reply to this post by jing hua zhao
> 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,

I successfully built R-rc_2017-04-19_r72555.tar.gz with icc & MKL on centos 7 with this:

# https://software.intel.com/en-us/articles/build-r-301-with-intel-c-compiler-and-intel-mkl-on-linux#                                             
export ICC_OPT="-mkl -xHOST -fp-model strict"
export CC="icc $ICC_OPT"
export CXX="icpc $ICC_OPT"
export FC="ifort -mkl -xHOST"
export F77="ifort -mkl -xHOST"
export FPICFLAGS=" -fPIC"
export AR=xiar
export LD=xild
export MKL="-lmkl_gf_lp64 -lmkl_intel_thread  -lmkl_core -liomp5 -lpthread"
./configure --with-x=no --with-blas=-lmkl

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Intel MKL compiling issue

jing hua zhao
HI Robert,


This helps -- would you be able to do with --enable-R-shlib? I also got complaints with it.


Jing Hua

________________________________
From: R-devel <[hidden email]> on behalf of Cohn, Robert S <[hidden email]>
Sent: 21 April 2017 13:26
To: [hidden email]
Subject: Re: [Rd] Intel MKL compiling issue

> 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,

I successfully built R-rc_2017-04-19_r72555.tar.gz with icc & MKL on centos 7 with this:

# https://software.intel.com/en-us/articles/build-r-301-with-intel-c-compiler-and-intel-mkl-on-linux#
Build R-3.3.1 with Intel� C++ and Fortran Compilers and ...<https://software.intel.com/en-us/articles/build-r-301-with-intel-c-compiler-and-intel-mkl-on-linux#>
software.intel.com
R is a freely available language and environment for statistical computing and graphics which provides a wide variety of statistical and graphical techniques: linear ...


export ICC_OPT="-mkl -xHOST -fp-model strict"
export CC="icc $ICC_OPT"
export CXX="icpc $ICC_OPT"
export FC="ifort -mkl -xHOST"
export F77="ifort -mkl -xHOST"
export FPICFLAGS=" -fPIC"
export AR=xiar
export LD=xild
export MKL="-lmkl_gf_lp64 -lmkl_intel_thread  -lmkl_core -liomp5 -lpthread"
./configure --with-x=no --with-blas=-lmkl

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Intel MKL compiling issue

Cohn, Robert S
In reply to this post by jing hua zhao
?  This helps -- would you be able to do with --enable-R-shlib? I also got complaints with it.

It works when I do this:
./configure --with-x=no --with-blas=-lmkl --enable-R-shlib




        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel