From p.dalgaard at biostat.ku.dk  Sun Apr 20 13:31:50 2008
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Sun, 20 Apr 2008 13:31:50 +0200
Subject: [Rd] Fortran underscore problem persists on Linux x86/64
	(PR#11206)
In-Reply-To: <alpine.LFD.1.10.0804201141590.3204@auk.stats.ox.ac.uk>
References: <20080419181513.6E73D2834154@mail.pubhealth.ku.dk>	<480AFDDF.7060905@biomserv.univ-lyon1.fr>	<alpine.LFD.1.10.0804201023270.31126@gannet.stats.ox.ac.uk>	<480B1D8D.2080808@biomserv.univ-lyon1.fr>
	<alpine.LFD.1.10.0804201141590.3204@auk.stats.ox.ac.uk>
Message-ID: <480B29A6.7000900@biostat.ku.dk>

Prof Brian Ripley wrote:
> On Sun, 20 Apr 2008, Thibaut Jombart wrote:
>
>> Prof Brian Ripley wrote:
>>
>>> And your machine is? -- you haven't given the 'at a minimum' 
>>> information asked for in the posting guide.
>>>
>>> Neither example is reproducible on my Fedora 8 x86_64 systems (nor 
>>> in the case of tripack, on CRAN's).  It will need someone with an 
>>> affected system to debug this.  One possibility is that they are 
>>> using double underscores, where the code does not look right to me 
>>> -- but few systems do and this code is the same as in 2.6.2.
>>>
>>> For the record, 'iniaqua' is a not a valid Fortran entry point, and 
>>> all these issues will go away if you register your package's symbols.
>>>
>>> What does nm -g report on the affected DSOs?
>>>
>>>
>> My mistake, I thought sessionInfo() would be enough. My system is an 
>> Ubuntu Dapper Drake (6.06.2 LTS, 64 bits version). R installed from 
>> the sources, same for the packages, using install.packages (one 
>> warning for tripack: an unmatched right brace in a manpage). My 
>> fortran and C compilers are respectively g77 and gcc:
>>> g77 -dumpversion
>> GNU Fortran (GCC) 3.4.6 (Ubuntu 3.4.6-1ubuntu2)
>>
>>> gcc --version
>> gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
>
> Thanks, for code-compilation problems we need that level of detail.
>
> Your problem appears to be that you are mixing gcc4 and g77 (not 
> recommended), and g77 does use extra underscores, I believe.  I have
>
> /* Define if your Fortran compiler appends an extra_underscore to 
> external
>    names containing an underscore. */
> /* #undef HAVE_F77_EXTRA_UNDERSCORE */
>
> /* Define if your Fortran compiler appends an underscore to external 
> names. */
> #define HAVE_F77_UNDERSCORE 1
>
> in src/include/config.h.  If the first of these is defined, please try 
> commenting it out and rebuilding R.
>
> I've found an old Solaris box that still has g77 on, and I can 
> reproduce this there.  I will patch the sources after further testing, 
> but altering src/include/config.h worked for me.
>
> I was certainly not expecting Ubuntu 7.07 to be using g77, so we need 
> the same details from Thomas Petzoldt.
Is this perhaps an installation issue (missing gfortran)?

more `R RHOME`/etc/Makeconf

should tell you which compilers R itself was built with. In my 
experience, it just doesn't work to mix v.3.x and 4.x compilers (Brian 
might correct me on that though).

-- 
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907



[Rd] Fortran underscore problem persists on Linux x86/64 (PR#11206)
Peter Dalgaard