Displaying 20 results from an estimated 4000 matches similar to: "Linking Fortran code to BLAS in Ubuntu"
2011 Feb 20
2
Problem using F77_CALL(dgemm) in a package
Dear R-devel,
I've written a numerical solver for SOCPs (second order cone programs)
in R, and now I want to move most of the solver code into C for speed.
I've written combined R/C packages before, but in this case I need to
do matrix operations in my C code. As I have never done that before,
I'm trying to write some simple examples to make sure I understand the
basics. I am stuck
2009 Jan 13
2
Using fortran code which call LAPACK subroutines
Hello
I'm trying to run a fortran code which use LAPACK subroutines. I think I
should use some points shown in the manual 5.5 Creating shared objects
but it is too technical for me :-(... Could anyone help me for the
procedure to do:
-which part of the manual is relevant for this type of question?
actually I'm speaking from writing R extensions, should I read R admin?
-point 1.2
2004 May 31
1
Question about building library and BLAS
Dear helpers,
I am trying to create a library which uses some Fortran source files and Lapack and Blas
subroutines. The Fortran source files from the original author contain subroutines
isamax.f, sgefa.f and sgesl.f, which are part of BLAS subroutines on my Linux computer,
but maybe different (old) versions. So in addition to these subroutines, there are other
Lapack and Blas subroutines
2007 May 29
1
LAPACK and BLAS libraries
Hi,
I don't know if I'm sending this to the right place but I've looked throught
tens and tens of topics on http://tolstoy.newcastle.edu.au/ and finally
found that email address where I can maybe find some help.
Well my main goal is to get to use the lapack library within my R package
(which can be done using calls from C). But in order to do this I have to
create a file src/Makevars
2007 May 29
1
LAPACK and BLAS libraries
Hi,
I don't know if I'm sending this to the right place but I've looked throught
tens and tens of topics on http://tolstoy.newcastle.edu.au/ and finally
found that email address where I can maybe find some help.
Well my main goal is to get to use the lapack library within my R package
(which can be done using calls from C). But in order to do this I have to
create a file src/Makevars
2009 Sep 04
1
calling Lapack and BLAS routines from C
Hi,
I am working on a UNIX machine and I am interfacing R and C with the .C
function. I am trying to call LAPACK and BLAS routines, but am running
into a problem where, while I am able to run the BLAS routines, I cannot
run the LAPACK routines.
I compile my .c file (at end of email) in the following way:
[mhitczen at jlogin2 ~/Cstuff]$ R CMD SHLIB testmore.c
gcc -std=gnu99
2006 Apr 03
1
Integration of C and Fortran
Dear all,
I am running R : Copyright 2005,
Version 2.2.1 (2005-12-20 r36812)
ISBN 3-900051-07-0
On a mac 10.4.5
I am having trouble with my package.
The trouble is the following:
In my package I have integrated three files in my src folder.
1- simplematch.C a .C file
2- ordering.f a fortran file
3- Makevars : PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
I am not sure if that last file is
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
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
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
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],
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
2015 Jun 03
2
Problem with shared library and lapack under windows
Hi all,
I have a C function, say Cfun, that calls Lapack's DGEMM routine and I need
to create a shared library to use Cfun inside R. The C file is the following
#include<stdio.h>
#include<R.h>
#include<R_ext/Lapack.h>
void Cfun(double *res, double *X, int *n, int *q)
{
char *ptr_TRANSA, TRANSA='T', *ptr_TRANSB, TRANSB='N';
ptr_TRANSA=&TRANSA;
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
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
2007 Jun 14
1
LAPACK Headers
Hey Everyone,
I'm running R 2.4.0 on Debian etch 4.0, and I'm trying to call some
LAPACK functions from the C code in my package. Actually, to be
honest I'm not really having trouble using commands such as La_dgesv
from within my C code, but I do get warning when compiling the package
saying:
***.c: In function '***':
***.c:37: warning: implicit declaration of function
2014 Sep 26
1
Why is my R package still compiling with the O2 flag?
When I install an R package with cpp codes such as rrcov via CRAN (under
R 3.1.1, using no Makevars file and under Ubuntu 14.04 using GCC 4.8),
the cpp code is compiled with the -o3 flag (in fact, looking at the
Makeconf file this seem to again be the default since R 3.1.1) But when
I install my own package via CRAN it is compiled with the -o2 flag.
My questions are what is causing my
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,
-----
2004 Jun 09
2
Building package on Windows: No rule to make target '-llapack'
Dear all,
I have a problem to build a package on Windows XP while there is no problem on Linux. The Makefile is something like:
###########
LIBNAME=cts
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
OBJS=file1.o ... file20.o -llapack -lblas
$(LIBNAME)$(SHLIB_EXT): $(OBJS)
$(SHLIB_LD) $(SHLIB_LDFLAGS) -o $@ $(OBJS) $(FLIBS)
clean:
@rm -f *.o *.$(SHLIB_EXT)
realclean: clean