[R] again question about nmath/standalone
Dirk Eddelbuettel
edd at debian.org
Thu Apr 15 00:35:10 CEST 2004
Maggie,
Are you sure you actually _have_ a library libRmath available to your
linker?
Below is a full log of how this works on any given Debian system for which
we provide the library in a package r-mathlib. Once that is installed, you
should be set.
Hth, Dirk
edd at basebud:/usr/share/doc/r-mathlib/examples> cat test.c
/*
* Mathlib : A C Library of Special Functions
* Copyright (C) 2000 The R Development Core Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#define MATHLIB_STANDALONE 1
#include <Rmath.h>
int
main()
{
/* something to force the library to be included */
qnorm(0.7, 0.0, 1.0, 0, 0);
return 0;
}
edd at basebud:/usr/share/doc/r-mathlib/examples> gcc -Wall -o /tmp/nmath_test test.c -lRmath -lm
edd at basebud:/usr/share/doc/r-mathlib/examples> ldd /tmp/nmath_test
libRmath.so.1 => /usr/lib/libRmath.so.1 (0x40028000)
libm.so.6 => /lib/libm.so.6 (0x40047000)
libc.so.6 => /lib/libc.so.6 (0x40069000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
edd at basebud:/usr/share/doc/r-mathlib/examples>
--
The relationship between the computed price and reality is as yet unknown.
-- From the pac(8) manual page
More information about the R-help
mailing list