From ripley at stats.ox.ac.uk  Sun Jun 18 17:54:08 2006
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sun, 18 Jun 2006 16:54:08 +0100 (BST)
Subject: [Rd] Mathlib help
In-Reply-To: <002401c6924f$b1346330$0100000a@bszklgtab>
References: <002401c6924f$b1346330$0100000a@bszklgtab>
Message-ID: <Pine.LNX.4.64.0606181645400.8963@gannet.stats.ox.ac.uk>

On Sat, 17 Jun 2006, Bill Szkotnicki wrote:

> Hello,
>
> I am trying to make use of the R standalone library in mu own c and fortran
> code. ( fedora core linux )
>
> Unfortunately I am unable to link and create an executable.
> See below.
> It is the example file in "src/nmath/standalone"

There is no such file in current R:
/users/ripley/R/svn/R-devel/src/nmath/standalone
gannet% ls
Makefile.in   Makefile.win* README        sunif.c       test.c

and README contains (correct) information on how to use it.

> Does anyone see what I might be missing?
>
> % R CMD COMPILE tr.c
> gcc -I/usr/local/lib64/R/include -I/usr/local/lib64/R/include
> -I/usr/local/include   -fpic  -g -O2 -std=gnu99 -c tr.c -o tr.o
>
> % R CMD LINK tr.o
> libtool: link: unable to infer tagged configuration
> libtool: link: specify a tag with `--tag'

Where exactly did you see that recommended?  See R CMD LINK --help for how 
to use it (and not for this purpose).  I suspect you want

% gcc -o tr tr.o -L/path/to/libRmath -lRmath -lm

-- 
Brian D. Ripley,                  ripley at 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] Mathlib help
Prof Brian Ripley