From ripley at stats.ox.ac.uk  Thu Nov  6 07:48:53 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu, 6 Nov 2008 06:48:53 +0000 (GMT)
Subject: [Rd] [R] Building with MKL on Ubuntu
In-Reply-To: <2bc7a5a50811051538m4b65e1efuc5c333da454c1ae3@mail.gmail.com>
References: <2bc7a5a50811041000u698ccbdm252e2209735192f1@mail.gmail.com>
	<alpine.LFD.2.00.0811041824550.10858@gannet.stats.ox.ac.uk>
	<1225827242.4910a3aace7b9@webmail.iarc.fr>
	<2bc7a5a50811050829o2904bddbw8be864d087096640@mail.gmail.com> 
	<1225907974.10672.9.camel@seurat.iarc.fr>
	<2bc7a5a50811051001j25ec2359x66009cd74852d9eb@mail.gmail.com>
	<4911E8EB.40305@biostat.ku.dk>
	<1225918922.491209ca64fd5@webmail.iarc.fr>
	<2bc7a5a50811051310y2ccaee02p39a093add499bc9b@mail.gmail.com>
	<2bc7a5a50811051538m4b65e1efuc5c333da454c1ae3@mail.gmail.com>
Message-ID: <alpine.LFD.2.00.0811060647180.17118@gannet.stats.ox.ac.uk>

And how does that help you?  At some future point on a real problem you 
will get incorrect answers/segfault.

That test was put there as a result of such incorrect results found the 
hard way.

On Wed, 5 Nov 2008, Anand Patil wrote:

> Scratch that- finally got it working! The steps were:
> - Change configure to 'break the thermometer' as suggested:
> ===================================================================
> --- configure ? (revision 46843)
> +++ configure ? (working copy)
> @@ -37473,6 +37473,8 @@
> ?
> ?fi
> ?
> +r_cv_zdotu_is_usable=yes
> +
> ?? rm -rf conftest conftest.* conftestf.* core
> ?? if test -n "${r_cv_zdotu_is_usable}"; then
> ?? ? { echo "$as_me:$LINENO: result: yes" >&5
> 
> - Set environment variables:
> CFLAGS=-pthread -O3
> FC=gfortran -pthread
> FFLAGS=-pthread
> CXXFLAGS=-O3 -pthread
> FCLAGS=-pthread
> LDFLAGS=-lpthread
> 
> - Configure command:
> ./configure --with-blas='-L/opt/intel/mkl/10.0.2.018/lib/em64t -lmkl -lguide
> -lpthread' --enable-R-shlib
> 
> I owe you all a beer!
> 
> Anand
> 
> 
> On Wed, Nov 5, 2008 at 9:10 PM, Anand Patil
> <anand.prabhakar.patil at gmail.com> wrote:
>       Thanks for your help, everyone. I was using gcc previously, but
>       building with the Intel compilers causes its own problems:
> /opt/intel/cce/10.1.018/lib/libguide.so: undefined reference to
> `pthread_atfork'
> make[3]: *** [R.bin] Error 1
> make[3]: Leaving directory `/working_copies/R/src/main'
> make[2]: *** [R] Error 2
> make[2]: Leaving directory `/working_copies/R/src/main'
> make[1]: *** [R] Error 1
> make[1]: Leaving directory `/working_copies/R/src'
> make: *** [R] Error 1
> 
> If your experience with MKL has been negative, I've definitely had
> enough; I'll try my luck with gcc and GotoBLAS.?
> 
> Cheers,
> Anand
> 
> 
> On Wed, Nov 5, 2008 at 9:02 PM, <plummer at iarc.fr> wrote:
>       Quoting Peter Dalgaard <P.Dalgaard at biostat.ku.dk>:
>
>       > Anand Patil wrote:
>       > > On Wed, Nov 5, 2008 at 5:59 PM, Martyn Plummer
>       <plummer at iarc.fr> wrote:
>       > >
>       > >> It looks like the em64t version of MKL fails the test
>       for the accuracy
>       > >> of zdotu ("checking whether double complex BLAS can
>       be used") and is
>       > >> therefore dropped in favour of R's built-in BLAS. ?I
>       have just tested
>       > >> this on Fedora and get the same result.
>       > >>
>       > >> The 32-bit MKL does work for me.
>       > >>
>       > >> Martyn
>       > >>
>       > >
>       > > Many thanks, Martyn. The 64-bit index space is
>       important to me, will I lose
>       > > it if I link against the 32-bit MKL? Also, should I
>       file a bug report with
>       > > Intel?
>       > > Anand
>       >
>       > There's also the option of "breaking the thermometer".
>       You might examine
>       > that check and decide whether the loss of accuracy is
>       enough for you to
>       > worry about and if not, take out the test from
>       configure.
>       >
>       > Apparently, this check was put in place in R-2.2.0
>       >
>       > ? ? o Any external BLAS found is now tested to see if
>       the complex
>       > ? ? ? ? routine zdotu works correctly: this provides a
>       compatibility
>       > ? ? ? ? test of compiler return conventions.
>       >
>       > which suggests that the expected failure is
>       catastrophic, and looking at
>       > the code, there's a fuzz of 1e-10 which would seem to be
>       about 1e5 times
>       > larger than required.
> 
> My apologies. I skimmed the code of the test program, but as
> Brian says
> it is not a question of accuracy. The test program does in fact
> segfault,
> although you won't see this in your config.log.
> 
> Anyway, Anand, I would just carry on with libRblas.
> 
> Martyn
> 
> 
> 
> -----------------------------------------------------------------------
> This message and its attachments are strictly confiden...{{dropped:26}}



[Rd] [R] Building with MKL on Ubuntu
Prof Brian Ripley