From Kurt.Hornik at wu-wien.ac.at  Thu Sep 25 12:46:38 2003
From: Kurt.Hornik at wu-wien.ac.at (Kurt Hornik)
Date: Thu Sep 25 11:47:25 2003
Subject: [Rd] Bugs compiling R-1.7.1 with Intel compilers icc and ifc
	(PR#4295)
In-Reply-To: <200309250926.h8P9QG0P023078@pubhealth.ku.dk>
References: <200309250926.h8P9QG0P023078@pubhealth.ku.dk>
Message-ID: <16242.47486.545887.932453@mithrandir.hornik.net>

>>>>> CanisMaior  writes:

> Bugs compiling R-1.7.1 with Intel compilers icc and ifc,
> on x86-computer (Pentium IV) and linux operating system

> Hello,
> as there aren't many reports about that issue, I'll give a little 
> report here. (Hope I don't bother anyone)

> The best thing about using icc and ifc are the warnings, because
> it is said that the Intel compilers are stricter and give more 
> precise warnings than gcc.
> Warnings are good for making better code.

> used software :
> * Intel c/c++ Compiler for 32-bit applications, Version 7.1 Build 20030307Z
> * Intel Fortran Compiler for 32-bit applications, Version 7.1 Build 20030307Z
>   (both with licence FOR NON-COMMERCIAL USE ONLY)
> * autoconf (GNU Autoconf) 2.57
> * GNU Make version 3.79.1

> First:
> It is possible to compile R-1.7.1 with intel compilers ;-)

> But:
> There are several bugs. As the Intel compilers are quite reliable,
> the bugs may be in the R-code :-(

> *) some commands crashes R, see later.
> *) the configure script seems to have a bug, even if you make your own
>    configure script with autoconf.
>    Perhaps it's only a typo, perhaps it's an error of autoconf.
>    So you have to do some things manually:

> 1) 
> run configure : (you have to adjust the paths)
> env CPICFLAGS=-shared CXXPICFLAGS=-shared FPICFLAGS=-shared 
> SHLIB_LDFLAGS=-shared ./configure CC=icc CFLAGS=-O2  
> CPPFLAGS=-I/opt/intel/compiler70/ia32/include F77=ifc CXX=icc 
> CXXFLAGS=O2 FFLAGS=-C90

> 2) delete a wrong path in some Makefiles:
> -L/usr/local/lib"  
> The quotation mark is the wrong thing. Delete it!
> You can search all the files containing this erratum recursively by
R-1.7.1> grep local/lib\" *
R-1.7.1> grep local/lib\" */* 
R-1.7.1> grep local/lib\" */*/*
> and so on.

> On my computer, the incorrect files are:
> R-1.7.1/Makeconf
> R-1.7.1/etc/Makeconf
> R-1.7.1/bin/R
> R-1.7.1/src/library/ctest/src/Makefile
> R-1.7.1/src/library/modreg/src/Makefile
> R-1.7.1/src/library/mva/src/Makefile
> R-1.7.1/src/library/ts/src/Makefile

I find that hard to believe.

grep -r -e '-L/usr/local/lib' configure gives

  : ${LDFLAGS="-L/sw/lib -L/usr/local/lib"}
  : ${LDFLAGS="-L/usr/local/lib"}

and grep -r '@LDFLAGS@' in the top-level source tree gives

Makeconf.in:LDFLAGS = @LDFLAGS@
configure:s,@LDFLAGS@,$LDFLAGS,;t t
etc/Makeconf.in:LDFLAGS = @LDFLAGS@

so where should the offending double quote come from, and in particular
how would it end up in e.g. src/library/ctest/src/Makefile?

-k


[Rd] Bugs compiling R-1.7.1 with Intel compilers icc and ifc (PR#4295)
Kurt Hornik