Displaying 20 results from an estimated 10000 matches similar to: "Including multiple third party libraries in an extension"
2011 Nov 11
1
Building a statically-linked extension?
Hi there,
I'm writing an R extension that has a C component that relies on two third
party libraries that I'm bundling
with the extension.
I'd like to statically link my resulting extension so that I can rely on
the bundled versions of the libraries I'm
distributing, so there's two questions -
1, does R allow statically linked C extensions to be used at runtime?
2, are there
2005 Oct 05
1
Problems with autoconf example from r-ext.
Dear R-developers,
I am trying to reproduce the autoconf.ac example from R-ext and fail.
My autoconf file looks like this
[autoconf.ac]
# original by Friedrich Leisch, much changed by BDR
AC_INIT([SBMLodeSolveR])
dnl Select an optional include path, from a configure option
dnl or from an environment variable.
AC_ARG_WITH([sbmlode-include],
2011 Oct 18
2
Remote environments, calling functions
Hi there,
I'm trying to do something like a migration of an R program. I've got a
function and some variables
in an interactive-session:
r <- .5
## estimatePi references r
estimatePi <- function(seed) {
set.seed(seed)
numDraws <- 1e+05
x <- runif(numDraws, min = -r, max = r)
y <- runif(numDraws, min = -r, max = r)
inCircle <- ifelse((x^2 + y^2)^0.5
2013 May 24
0
Rcpp with OpenMP - Need example Makevars
Dear R experts,
recently I started developing a Rcpp package "OpenMPTest".
Within that package I want to use OpenMP, as in the following code example:
// header file
#include <omp.h>
using namespace Rcpp ;
RcppExport SEXP testOpenMP( SEXP nThreads ) ;
// cpp file
SEXP testOpenMP( SEXP nThreads ) {
BEGIN_RCPP
NumericVector numberThreads = NumericVector( nThreads );
2000 Oct 22
1
How to pass
HI!
Have somebody an expample how the syntax is for passing the path of
include files to:
"If a package needs to specify additional directories for search-
ing header les (`-I' options) or additional libraries for linking (`-l'
and `-L' options), it
should do this by setting the variables PKG_CPPFLAGS and PKG_LIBS in
`src/Makevars'." But no examples. :-(
src/Makevars.
2000 Oct 23
1
How To compile RMySQL on Windows?
Hallo!
Thanks for the answers that I received.
I had downloaded the last distribution of RMySQL from
/R/CRAN/src/contrib/Devel..
Its the first package that I am trying to compile under Windows.
>From the Compiler I am getting the following error message.
In file included from RMySQL.c:1:
RMySQL.h:24: mysql.h: No such file or directory
RMySQL.h:25: mysql_com.h: No such file or directory
2004 Dec 29
2
Makefile vs Makevars vs configure
Apologies in advance for the long post.
I'm currently using a Makefile to build my shared library. Pursuant to the
R-exts manual, I'd like to switch to a Makevars file or a configure file if
necessary.
Having never used these types of make utilities before, I'm a bit lost.
My package is quite simple. It only has one source file and one header:
excelpoi.cpp
excelpoi.h
The reason I
2020 Oct 08
1
Installing package fails at "testing if installed package can be loaded from temporary location"
Dirk, thank you a thousand times.
Indeed, src/Makevars was wrong. I modified Makevars so that now looks like
the below and the package now compiled and linked properly.
CXX_STD = CXX11
PKG_LIBS += $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
$(shell ${R_HOME}/bin/Rscript -e "RcppParallel::RcppParallelLibs()")
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -I../inst/include
2015 May 13
4
Alternative for wildcard gnu extension in Makevars
One other solution that's only a little crazy: you could have a R
function within your package that generates the appropriate (portable)
Makevars, and within the package `configure` script call that
function. For example"
R --vanilla --slave -e "source('R/makevars.R'); makevars()"
And that 'makevars()' function could generate portable
2015 May 15
1
Alternative for wildcard gnu extension in Makevars
On May 13, 2015, at 2:28 PM, Henrik Bengtsson <henrik.bengtsson at ucsf.edu> wrote:
> While at it: 'Makevars' is an R invention (i.e. documentation of it
> is only available through the R docs), correct? /Henrik
>
Well, it's just a Makefile fragment that gets included along with the rest of the Makefiles, so for all practical purposes it's just a Makefile which
2009 Jan 11
1
Makevars
Hi
I have sent a previous email "Error in dyn.load()" for which, shame on
me, I later found a partial answer.
I have been trying to look into what I exactly need to include into
Makevars and where
it needs to be located and have not found a satisfying answer yet.
Maybe the following questions
are helpful for other people as well.
Again, I am trying to include a C function tools.c into
2011 Dec 06
1
unserialize and eager execution
Hi,
While debugging a network server I'm developing I noticed something unusual
- call to unserialize() resulted in
an error about loading a namespace.
I was a bit taken back by this - why should unserializing an object cause a
namespace lookup?
Are there any other side-effects of unserialize() that I should be cautious
about? I've been
digging through the R_Unserialize() call, I
2013 Nov 03
1
How to make an R package that uses Boost.Thread, qualified to be published on CRAN or shared by the most
Hi,
Recently, I made an R package that used the C++ library Boost.Thread (http://www.boost.org/doc/libs/1_54_0/doc/html/thread.html) for multithreading. Previously, I have posted a question at stackoverflow (http://stackoverflow.com/questions/19651954/is-it-possible-to-build-an-r-package-which-use-rcpp-and-boost-thread-on-http), and I also asked at rcpp-devel
2011 May 20
2
Calling Rscript from Makevars
Hi,
I am trying to package some code to use with R and wanted to call
Rscript from within the Makevars file (I am trying to automate the
setting of the location of a third party library depending on what is
available / the system the package is being installed on).
If I just have a simple Makevars containing
PKG_LIBS= -lnag_nag -L/fserver/nagprod/FL22/fll6a22df/lib
the package is built
2010 Oct 04
1
source package build/installation with subdirectory-lib
hi all - i have a source package i'm writing that i'd like to be able
to install with a special library that my R src files rely on.
to be more precise, i have a normal R package directory structure
(i.e. src/ R/ man/ DESCRIPTION NAMESPACE etc.).
i also have another directory here called depPkg, and it has it's own
configure file for the canonical './configure && make
2004 Sep 09
3
Dyn.load of sharing object with GSL library
Following the recommendation of Prof. Ripley, I have created the Makevars
file with the line:
PKG_LIBS="-L/usr/lib/libm -lm -L/usr/local/lib/libgsl -lgsl -L/usr/local/lib
/libgslcblas -lgslcblas"
in the working directory.
Now I have the code file Example3.c which computes the Bessel function value
(the example is taken from the GSL reference book).
I am running:
R CMD SHLIB Example3.c
2005 Feb 20
2
minus I and minus L flags
I have been RTFM/doc/www, but I'm still lost.
How does one tell R CMD INSTALL and R CMD check (both) that libraries
are installed in non-usual places and so -I/APPS/include (or whatever)
is necessary in CPPFLAGS and -L/APPS/lib (similarly) is necessary
in LDFLAGS?
I know I can hardwire them in pkg/src/Makevars, but this requires hand
editing of that file by each installer (yuck!)
rgentlem
2005 Feb 20
2
minus I and minus L flags
I have been RTFM/doc/www, but I'm still lost.
How does one tell R CMD INSTALL and R CMD check (both) that libraries
are installed in non-usual places and so -I/APPS/include (or whatever)
is necessary in CPPFLAGS and -L/APPS/lib (similarly) is necessary
in LDFLAGS?
I know I can hardwire them in pkg/src/Makevars, but this requires hand
editing of that file by each installer (yuck!)
rgentlem
2008 Nov 20
3
Turning off compiler optimization
Hi. I am writing some code in C that I would like to link into R.
My Makevars file is:
PKG_CPPFLAGS=-I/usr/local/include
PKG_LIBS=-L/usr/local/lib -lgsl
PKG_CFLAGS = -Wall -O0 -g -p -pg
The source file is core.c,. and I am compiling using R CMD SHLIB
core.c The output is
gcc -arch x86_64 -O3 -g -p -std=gnu99 -I/Library/Frameworks/
R.framework/Resources/include
2009 Oct 29
2
Makevars, cc files in multiple directories
Hello,
In the src folder of my R package I have
a.cc
b.cc
f/g/x.cc
my Makevars.in has
all: $(SHLIB)
upon installing only, a.o and b.o is build and the final dll is
comprised of a.o and b.o
How can I instruct $(SHLIB) to pick up its source files from all
subdirectories (or maybe a subset, though here it will be all)
in src ?
Much thanks
Saptarshi