Displaying 20 results from an estimated 500 matches similar to: "Detecting compilation under R"
2001 Jul 14
1
Calling rand_unif() from fortran
What is the necesary incantation to call rand_unif() from a fortran
routine?
Just inserting rand_unif() into the fortran code compiles OK, but won't
dyn.load():
> dyn.load("forest.so")
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library "/home/warnes/R/forest/forest.so":
/home/warnes/R/forest/forest.so: undefined symbol:
2001 Feb 23
1
using the .C interface to call compiled C code
Dear People,
I have been trying to learn how to use the .C interface. A friend gave me
a toy example, and I have been playing with it. It is
(C code)
#ifdef USING_R
typedef int Sint;
#else
typedef long Sint;
#endif
void kosum(double *a, double *b, Sint *na)
{
int i, j, nab;
double temp;
nab=*na;
temp=0.0;
for(i=0;i < nab; i++)
{
temp=temp+a[i];
}
*b=temp;
}
And
2006 Mar 04
1
xyplot/levelplot: thickness of tickmarks
Hi,
if I use the xyplot (or levelplot) function (lattice library) with
the option axs="i", I have the problem that the tickmarks lie a bit
outside the "plot-box". Consider for example:
library(lattice)
x<-seq(0,1,by=0.01)
y<-seq(0,1,by=0.01)
xyplot(y~x,type="l",xlim=c(0,1),ylim=c(0,1),scales=list
2011 Sep 23
1
Adding weights to optim
I realize this may be more of a math question. I have the following optim:
optim(c(0.0,1.0),logis.op,x=d1_all$SOA,y=as.numeric(md1[,i]))
which uses the following function:
logis.op <- function(p,x,y) {
ypred <- 1.0 / (1.0 + exp((p[1] - x) / p[2]));
res <- sum((y-ypred)^2)
return(res)
}
I would like to add weights to the optim. Do I have to alter the logis.op
function by
2010 Jan 22
2
R CMD check error with the GNU Scientific Library
I have been working on an R package that calls C code using .C(). I recently
started including some functions from the GNU Scientific Library in my code.
The code runs fine on my machine when not wrapped in the package. But I get the
following error from "R CMD check"
* checking whether the package can be loaded ... ERROR
Loading required package: splancs
Loading required package: sp
2005 Mar 09
1
Trouble with mixreg
Dear All
I am trying to estimate a mixture of regression and get the
following error using the mixreg package:
Error in y - yhat : non-conformable arrays
The instruction I used were:
x <- as.matrix(LRHUN)
y <- as.matrix(LRINTER)
TS <- list(list(beta=c(3.0,1.0),sigsq=1,lambda=0.4),
list(beta=c(0.0,1.0),sigsq=1,lambda=0.6))
prova <- mixreg(x,y, ncomp=2, theta.start=TS)
2008 Feb 15
1
ggplot2 used in a function - variable scope/environment
Hi everybody!
I'm trying to use ggplot2 to return a plot from a function (so I can add
something or alter it then). Unfortunately, if I add a mapping to a
layer in the function, the variable *name* is stored in the layer,
rather than the variable's *value* - so that after the function returns
the ggplot2-object, it doesn't plot because the variable don't exist in
the
2015 Feb 11
0
CRAN check fails on Solaris, any hints why?
Dear all,
I recently uploaded a new package Rlibeemd to CRAN (http://cran.r-project.org/web/packages/Rlibeemd/index.html, and in github: https://github.com/helske/Rlibeemd), and simple example in help files seems to throw an error on Solaris:
Version: 1.3.1
Check: examples
Result: ERROR
Running examples in ?Rlibeemd-Ex.R? failed
The error most likely occurred in:
> ### Name:
2007 Mar 20
2
PKG_CFLAGS/CFLAGS and PKG_CXXFLAGS/CXXFLAGS
Why is it that R places CFLAGS after PKG_CFLAGS and not before when
compiling a package (e.g. through R CMD build pkg)? This can be
problematic if, for instance, you want to use -O3, but -O2 is in
R_HOME/etc/Makeconf. If -O2 (in CFLAGS) appears after -O3 (in
PKG_CFLAGS), you are left with what you didn't want: -O2.
In R-exts, it says that "Flags which are set in file etc/Makeconf
2005 Feb 09
1
Compiler-specific flags with PKG_CFLAGS
On Tue, 8 Feb 2005, Kurt Hornik wrote:
> This concerns the packages...
> for which current versions of r-devel now report problems with
> non-portable compilation flags in Makevars[.in] files:
>
> Problems in package 'rwt':
> Non-portable flags in variable 'PKG_CFLAGS':
> -Wall -ansi -pedantic
>
> These flags are mostly GCC specific and not
2000 Jul 17
1
Makevars, PKG_CFLAGS, ...
Hi,
I'm searching for a way to override the default CFLAGS/FFLAGS (-g -02 in
my case) per package (e.g with "-g" for packages under development).
PKG_CFLAGS/PKG_FFLAGS is prepended to the remaining flags, so it can't
delete a globally set "-O2" flag.
Of course I can edit the global Makeconf file, but I was wondering if
there is a possibility to override variables from
2020 Sep 28
3
Specifying C Standard in Package's Makevars File
Hi,
what is the correct way to specify a C standard in a package's Makevars file?
Building a package with e.g. PKG_CFLAGS = -std=gnu11 does work but R CMD check issues a warning:
* checking compilation flags in Makevars ... WARNING
Non-portable flags in variable 'PKG_CFLAGS':
-std=gnu11
(Same for -std=c11.)
Thanks! Regards,
Andreas Kersting
2002 Jun 13
1
using MAKEFLAGS in compiling C code as a shared library using R CMD SHLIB
Dear R People,
in the R FAQ (in the R Programming section) it says
**********************************************************************
How can I change compilation flags?
===================================
Suppose you have C code file for dynloading into R, but you want to
use `R CMD SHLIB' with compilation flags other than the default ones
(which were determined when R was built).
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
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],
2020 Jul 15
2
Openblas?
Hello,
I thought that I should try openblas when building a CRAN package
containing lots of old (twentieth century) C-code with frequent calls to
blas and lapack routines. I have the following options on my Ubuntu
20.04 machine:
Selection Path Priority Status
------------------------------------------------------------
* 0
2006 Dec 10
1
Linking Fortran code to BLAS in Ubuntu
Hello!
I have some Fortran code that uses BLAS calls, and would like to compile it
into a shared object to call it from R as per the "Writing R Extensions"
manual. What needs to go into the "Makevars" file, so that running the R CMD
SHLIB will work in Ubuntu?
The code compiles properly on the Mac, with the Makevars line
PKG_CFLAGS=-Wl,-framework -Wl,vecLib
but of course
2007 Jan 26
1
Makevars PKG_LIBS ignored by SHLIB (PR#9473)
Full_Name: Rick Sayre
Version: 2.4.0
OS: Windows
Submission from: (NULL) (138.72.27.164)
PKG_LIBS works fine on *nix
on windows, it seems to be ignored by the "SHLIB" script
so, R CMD SHLIB blah
properly uses PKG_CPPFLAGS and PKG_CFLAGS from Makevars, but PKG_LIBS is
ignored
2008 Jun 06
1
Makevars or congiure for multi platforms
Dear all,
As previously submitted, I wrote an extending pdf device to embed
pop up text and web links.
(Patches are available at http://pdf2.r-forge.r-project.org/patches)
Now, I'm making a library version of the pdf device.
However, with my skill, I'm not sure about writing Makevars or configure file
for multi platforms. A following line in Makevars works on my mac,
-----
2012 Dec 24
1
How to ensure -O3 on Win64
Hi,
Similar questions have come up before on the list and elsewhere but I
haven't found a solution yet.
winbuilder's install.out shows data.table's .c files compiled with -O3
on Win32 but -O2 on Win64. The same happens on R-Forge. I gather that
some packages don't work with -O3 so the default is -O2.
I've tried this in data.table's Makevars (entire contents) :
====