[R-pkg-devel] First time CRAN package submission

Filippo Monari |ng||mo @end|ng |rom gm@||@com
Sat Dec 12 18:04:49 CET 2020


Hi all,
I am trying to submit my first CRAN package, but I am having problems to
reproduce and correct all the issues that have been been reported by the
first failed attempt.
The package has quite a significant amount of Fortran 2003 code, and few
lines of C to link with R.
I hope some of you might give me some insight on how to correct them. I
will list the errors here below.

Relatively to the Windows test it has been reported to the following.

* installing *source* package 'modello' ...
> ** using staged installation
> ** libs *** arch - i386
> d:/Compiler/rtools40/mingw32/bin/gcc -I"D:/RCompile/recent/R/include"
> -DNDEBUG -I"d:/Compiler/gcc-4.9.3/local330/include" -pedantic -O2 -Wall
> -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c Rfuns.c -o Rfuns.o
> Rfuns.c: In function 'r__gamma':
> Rfuns.c:87:9: warning: implicit declaration of function 'gamma'
> [-Wimplicit-function-declaration]
> return(gamma(a[0]));
> ^~~~~
> Rfuns.c:87:9: warning: incompatible implicit declaration of built-in
> function 'gamma'
> d:/Compiler/rtools40/mingw32/bin/gcc -I"D:/RCompile/recent/R/include"
> -DNDEBUG -I"d:/Compiler/gcc-4.9.3/local330/include" -pedantic -O2 -Wall
> -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c Rinterfaces.c -o
> Rinterfaces.o
> d:/Compiler/rtools40/mingw32/bin/gfortran -fno-optimize-sibling-calls
> -fopenmp -L"D:/RCompile/recent/R/bin/i386" -lRlapack
> -L"D:/RCompile/recent/R/bin/i386" -lRblas -lgfortran -lm -lquadmath
> -pedantic -O2 -mfpmath=sse -msse2 -mstackrealign -c dataio.f95 -o dataio.o
> dataio.f95:2:6: use env
> 1
> Fatal Error: Can't open module file 'env.mod' for reading at (1): No such
> file or directory
> compilation terminated.
> make: *** [D:/RCompile/recent/R/etc/i386/Makeconf:263: dataio.o] Error 1
> ERROR: compilation failed for package 'modello'
> * removing 'd:/RCompile/CRANincoming/R-devel/lib/modello'

The warning "implicit declaration of function 'gamma'
[-Wimplicit-function-declaration]", refers to the fact that I am
calling the "gamma" function from Rmath.h in the following code block.

#include <R.h>
> #include <Rmath.h>
> ...
> //** Gamma function
> double r__gamma (double *a) {
> /*
> * DOC
> * Wrapper to rhe R function gamma, calculationg the gamma function of a
> real number.
> * VARIABLES
> * in/out
> * a: a real number
> */
> //_MAIN_
> return(gamma(a[0]));
> }

The fatal error, refers to the fact the compiler cannot find the
env.mod module, but the Makefile is correctly defined.

Relatively to the Debian test, the following warning is what is making
to fail the submission.

* checking whether package ‘modello’ can be installed ... [32s/32s] WARNING
> Found the following significant warnings:
>   Warning: Type specified for intrinsic function ‘size’ at (1) is ignored [-Wsurprising]
>   Warning: ‘__var_1_fcn.offset’ is used uninitialized in this function [-Wuninitialized]
>   Warning: ‘__var_2_fcn.offset’ is used uninitialized in this function [-Wuninitialized]

I have fixed the two warning due to uninitialized variables. However I
cannot reproduce the  warning "Type specified for intrinsic function
‘size’ at (1) is ignored [-Wsurprising]" and I do not know how to fix
it. Googling a bit I understand it could be false positive (e.g.
https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg537501.html)

I would be very glad if anyone could give me advice on how to fix
these issues. Thanks in advance.

Regards,

Filippo

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list