From ripley at stats.ox.ac.uk  Tue Jan 25 08:23:52 2005
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue Jan 25 10:08:50 2005
Subject: [Rd] about R CMD check 
In-Reply-To: <1106608541.41f5819dabd24@mail.encs.concordia.ca>
References: <1106608541.41f5819dabd24@mail.encs.concordia.ca>
Message-ID: <Pine.LNX.4.61.0501250716310.26800@gannet.stats>

On Mon, 24 Jan 2005 xt_wang@cse.concordia.ca wrote:

> I create a package which includes C code and Lapack. But when I run " R CMD
> check ". an error message, "/usr/bin/ld: cannot find -lfrtbegin " occurs. could
> you tell me what is the problem?

You are presumably (you have not told us) running Linux and do not have 
g77 installed (so I guess you installed R from an RPM or similar).  The 
best solution is to install it.  On my system

gannet% rpm -ql gcc-g77-3.4.2-6.fc3
/usr/bin/f77
/usr/bin/g77
/usr/lib/gcc
/usr/lib/gcc/i386-redhat-linux
/usr/lib/gcc/i386-redhat-linux/3.4.2
/usr/lib/gcc/i386-redhat-linux/3.4.2/include
/usr/lib/gcc/i386-redhat-linux/3.4.2/include/g2c.h
/usr/lib/gcc/i386-redhat-linux/3.4.2/libfrtbegin.a
/usr/lib/gcc/i386-redhat-linux/3.4.2/libg2c.a
/usr/lib/gcc/i386-redhat-linux/3.4.2/libg2c.so
...

The next best is to edit R_HOME/etc/Makeconf and remove -lftrbegin from 
FLIBS.

> the detailed message is as follows:
> [credsim@confsys ~/src]$ R CMD check var
> * checking for working latex ... OK
> * using log directory '/home/credsim/src/var.Rcheck'
> * checking for file 'var/DESCRIPTION' ... OK
> * checking if this is a source package ... OK
>
> * Installing *source* package 'WXT' ...
> ** libs
> gcc -I/usr/lib/R/include  -I/usr/local/include -D__NO_MATH_INLINES -mieee-fp
> -fPIC  -O2 -g -march=i386 -mcpu=i686 -c 1221.c -o 1221.o
> 1221.c: In function `Matrix_A_12':
> 1221.c:773: warning: passing arg 3 of `dpotrf_' from incompatible pointer type
> 1221.c:774: warning: passing arg 4 of `dpotrs_' from incompatible pointer type
> 1221.c: In function `Matrix_A_1':
> 1221.c:1037: warning: passing arg 3 of `dpotrf_' from incompatible pointer type
> 1221.c:1038: warning: passing arg 4 of `dpotrs_' from incompatible pointer type
> 1221.c: In function `Matrix_A_2':
> 1221.c:1289: warning: passing arg 3 of `dpotrf_' from incompatible pointer type
> 1221.c:1290: warning: passing arg 4 of `dpotrs_' from incompatible pointer type
> gcc -shared -L/usr/local/lib -o WXT.so 1221.o -L/usr/lib/R/bin -lRlapack
> -L/usr/local/lib -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2
> -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../.. -lfrtbegin -lg2c -lm
> -lgcc_s
> /usr/bin/ld: cannot find -lfrtbegin
> collect2: ld returned 1 exit status
> make: *** [WXT.so] Error 1
> ERROR: compilation failed for package 'WXT'
> ** Removing '/home/credsim/src/var.Rcheck/WXT'
> ERROR
> Installation failed.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] about R CMD check
Prof Brian Ripley