Displaying 20 results from an estimated 31 matches for "pkg_cxxflag".
Did you mean:
pkg_cxxflags
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
..., _1 = 1);
boost::thread t(thread);
t.join();
return wrap(a);
}
-------------------------------
Makevars.win (try 1: try to find if there is a file called libboost_thread*)
-------------------------------
## Use the R_HOME indirection to support installations of multiple R version
## PKG_CXXFLAGS = `$(R_HOME)/bin/Rscript -e "Rcpp:::CxxFlags()"`
PKG_CPPFLAGS = -I${BOOSTLIB}
PKG_LIBS = $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::LdFlags()") ${BOOSTLIB}/lib/libboost_thread*
-------------------------------
Makevars.win (try 2: try to find somethin...
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
2013 May 24
0
Rcpp with OpenMP - Need example Makevars
..., I am unsure what to write
into it. Currently I have:
## Use the R_HOME indirection to support installations of multiple R version
PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`
KG_CFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS)
## -- compiling for OpenMP
PKG_CXXFLAGS=-fopenmp
##
## -- linking for OpenMP
PKG_LIBS= -fopenmp -lgomp
Obviously compilation fails with error:
R CMD INSTALL OpenMPTest
Symbol not found: __ZTIN4Rcpp19index_out_of_boundsE
With standard setup of the above Makevars I get the
Symbol not found: omp_set_num_threads
Inline also does not wor...
2020 Oct 08
1
Installing package fails at "testing if installed package can be loaded from temporary location"
...d, 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
Best,
Sam
On Thu, Oct 8, 2020 at 3:39 PM Dirk Eddelbuettel <edd at debian.org> wrote:
>
> Sam,
>
> PS It could of course also be something else: Is you src/Makevars for your
> test package correct? Did you use `RcppArmadillo.pac...
2013 Feb 01
2
Armadillo error in R extension
...with some experience in using armadillo in R C++ extensions?
My problem is the following:
I programmed a function in a header looking like
#include <armadillo>
inline arma::vec foo(input) {
... do something
return an arma::vec object
}
compiling this via R CMD INSTALL packagename (PKG_CXXFLAGS = -I/folder/of/armadillo and armadillo_bits in my package)
I get the following error
"error: expected initializer before 'foo' "
The exact line and word is where inline arma::vec ends.
Does anyone know what this error could be?
Best
Simon
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
2009 Sep 03
1
Turn of -O2 during package build
Hello,
I'm using a Makevars.in file and running my code through gdb. I
understand i should turn of -O2, but R's makeconf overrides my
settings
/ln/meraki/custom/lib64/R/etc/Makeconf:112: warning: overriding
commands for target `.cc.o'
in Makevars.in
.cc.o:
g++ -g ${PKG_CXXFLAGS} ${PKG_LIBS} ${RINC} ${RLIB} -c $< -o $@
Thank you
S.
2017 Dec 03
5
Rcpp, dyn.load and C++ problems
...n_plus_one = xn*cos(angle)*radius;
yn_plus_one = xn*sin(angle)*radius;
angle += angle_increment;
xn = grow*xn*(1-xn);
x[i] = xn_plus_one;
y[i] = yn_plus_one;
}
return List::create(Rcpp::Named("x") = x, Rcpp::Named("y") = y);
}
And I compile it like this:
PKG_CXXFLAGS=$(Rscript -e 'Rcpp:::CxxFlags()') \
PKG_LIBS=$(Rscript -e 'Rcpp:::LdFlags()') \
R CMD SHLIB logistic_map.cpp
without problems and I get a logistic_map.so file as expected.
However in R:
R> dyn.load("logistic_map.so")
R> compute_values_cpp()
Error in compute_values...
2014 Sep 26
1
Why is my R package still compiling with the O2 flag?
...stall my own package via CRAN it is compiled with the -o2 flag.
My questions are what is causing my package's cpp code to be compiled in
-o2 and how to fix this?
Here is the content of the src/Makeconf file of my package (it is fairly
standard I believe for a package using RcppEigen):
PKG_CXXFLAGS = -I../inst/include -DEIGEN_DONT_PARALLELIZE
$(SHLIB_OPENMP_CXXFLAGS)
PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`
$(SHLIB_OPENMP_CXXFLAGS)
CXX_STD = CXX11
and that of rrcov (which I m using for illustration's sake):
PKG_LIBS=$(LAPACK_LIBS) $(BLAS_LIBS...
2002 Jul 24
1
loading compiled C++ code as shared library
...efinitions in an
extern "C" block. I still get the same error. Since I don't really
understand what the extern "C" is supposed be doing here, I'm being pretty
brainless about this.
Note of course I'm compiling with a C++ compiler (g++)
MAKEFLAGS='CXX=\ g++-3.1 PKG_CXXFLAGS=\ -Wall\ -pedantic\ -Werror\
-Wshadow ' R CMD SHLIB ms.cc -o ms.so
Would someone be kind enough to tell me what the correct syntax is? It
might also be helpful if someone could point to R code that uses
compiled C++ code.
Addendum: I looked at the file svm.h in the e1071 package source, and...
2008 Apr 18
1
problem customizing CXXFLAGS in Windows
...e
a shared library in Windows with customized level of optimization.
Specifically, I would like to have "-O3 -funroll-loops" as flags when I run
"R CMD SHLIB ***.cc" to speed the program for my simulations.
I have read through the documentation and have tried adding the line
PKG_CXXFLAGS = -O3 -funroll-loops
in my Makevars in my package's src directory. However, this places the
flags before the -O2 flag, thereby overriding it. I have also tried
creating a config.site file in R_HOME/etc, but that seems to be ignored.
I found a possible solution at
http://tolstoy.newcastle.e...
2001 Sep 10
1
problems linking c++ code
...n undefined
symbol in the *.so file. Is there something I can link in to resolve
this problem? Is there another obvious solution?
The system is FreeBSD 4.x-stable. The R version is 1.3.1. The gcc/g++
version is 2.95.3. I compile with R CMD INSTALL and my MAkevars file
has the following lines:
PKG_CXXFLAGS = -fPIC -I./ -I../../
PKG_CFLAGS = -fPIC -I./ -I../../
PKG_LIBS = -L/usr/local/lib
The error I get when loading the library in R is:
> library(rmetasim)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library "/usr/local/lib/R/library/rmetasi...
2017 Dec 03
0
Rcpp, dyn.load and C++ problems
...e = xn*sin(angle)*radius;
> angle += angle_increment;
> xn = grow*xn*(1-xn);
> x[i] = xn_plus_one;
> y[i] = yn_plus_one;
> }
> return List::create(Rcpp::Named("x") = x, Rcpp::Named("y") = y);
> }
>
> And I compile it like this:
> PKG_CXXFLAGS=$(Rscript -e 'Rcpp:::CxxFlags()') \
> PKG_LIBS=$(Rscript -e 'Rcpp:::LdFlags()') \
> R CMD SHLIB logistic_map.cpp
> without problems and I get a logistic_map.so file as expected.
>
> However in R:
> R> dyn.load("logistic_map.so")
> R> compute_va...
2017 Apr 19
2
Default R-3.4.0 RC CXXFLAGS without -O2 on x86_64-linux-gnu with g++-5.4.0 causes WARNING from stl_list.h
...ommit.?
3) I thought about cheating the system and add -O2?
? ?in the package CXXFLAGS, but Martin Morgan?
? ?recommends packages shouldn't mess and override system build defaults
? ?to mask and paper over the actual issue having a nasty abort()?
? ?lurking somewhere.
? ?But I couldn't add PKG_CXXFLAGS=-O2 in first place, since that?
? ?triggers the different WARNING that -O2 is not portable.?
=> Any help and input would be highly appreciated.?
Thanks in advance,?
yours,
Steffen
tmp.cpp by Martin Morgan (also in above linked mail thread)
-------
#include <list>
int foo(int argc, co...
2023 Aug 06
3
A demonstrated shortcoming of the R package management system
...o speed things up we first install the binary
install.packages("SeuratObject") # in this container via bspm/r2u as binary
## and then force a source installation (turning bspm off) _while Matrix is at 1.5.1_
if (requireNamespace("bspm", quietly=TRUE) bspm::disable()
Sys.setenv(PKG_CXXFLAGS='-Wno-ignored-attributes') # Eigen compilation noise silencer
install.packages('SeuratObject')
## we now remove the Matrix package version 1.5.1 we installed into /usr/local leaving 1.6.0
remove.packages("Matrix")
packageVersion("Matrix")
## and we now run a...
2020 Oct 08
3
Installing package fails at "testing if installed package can be loaded from temporary location"
Hi,
I can not install packages from source which links to RcppArmadillo on
Ubuntu 20.04 (after upgrading from 18.04). The following problem occurs:
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for 'myPackage' in
dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object
2012 Apr 21
1
R CMD check -- non S3 method warning
...manual.
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking for portable compilation flags in Makevars ... WARNING
Non-portable flags in variable ?PKG_CXXFLAGS?:
-Wall -std=c++0x
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking compiled code ... OK
* checking examples ... OK
* checking PDF version of manual ... OK
WARNING: There were 2 warnings.
NOTE: There were 2 notes.
See
?/home/warmstrong/dvl/R.packages/rcppbugs.R...
2016 Oct 11
0
PKG_LIBS in make child processes
...if
(Sys.info()['sysname'] == 'Darwin') cat('-Wl,-all_load ./libgc.a
./libClustalW.a ./libClustalOmega.a ./libMuscle.a') else
cat('-Wl,--whole-archive ./libgc.a ./libClustalW.a
./libClustalOmega.a ./libMuscle.a -Wl,--no-whole-archive')"`
PKG_CXXFLAGS=-I"./gc-7.2/include" -I"./Muscle/" -I"./ClustalW/src"
-I"./ClustalOmega/src"
.PHONY: all mylibs
all: $(SHLIB)
$(SHLIB): mylibs
mylibs: build_gc build_muscle build_clustalw build_clustalomega
build_gc:
make --file=m...
2008 Nov 21
2
Windows version of package "Ratings"?
Hello,
Does anyone know whether a Windows version of the Ratings package will
be available?
Thank you, Paul Prew
CONFIDENTIALITY NOTICE: \ This e-mail communication an...{{dropped:11}}