Dear R Developers,
For package seriation I use Fortran code. I recently got a request to add
#if defined(__ICC) || defined(__INTEL_COMPILER)
USE IFPORT
#endif
to the code since the Intel Fortran compiler otherwise has problems with
rand(). However, to enable the FPP preprocessor I have to either add a
compiler flag (-cpp for gFortran) which is possibly not portable or
change the extension to .F, .fpp, .FPP (and a few others) which
automatically invokes the preprocessor (hopefully on all platforms). I
tried .fpp and added the following to Makevars:
OBJECTS=arsa.o bburcg.o bbwrcg.o bea.o criterion.o dist.o fprintf.o
greedy.o optimal.o stress.o
%.o: %.fpp
$(F77) $(ALL_FFLAGS) -c $< -o $@
It seems to work (I tried Linux and Windows) but R CMD check gives me:
* checking if this is a source package ... WARNING
Subdirectory ?src? contains:
arsa.fpp bburcg.fpp
Is there a different preferred method to do this? Is it possible to add
support for Fortran with the fpp preprocessor (.fpp files) to the R
package building process?
Thanks,
Michael
--
Michael Hahsler, Assistant Professor
Department of Engineering Management, Information, and Systems
Department of Computer Science and Engineering (by courtesy)
Bobby B. Lyle School of Engineering
Southern Methodist University, Dallas, Texas
office: Caruth Hall, suite 337, room 311
email: mhahsler at lyle.smu.edu
web: http://lyle.smu.edu/~mhahsler
On 30/11/2014 06:46, Michael Hahsler wrote:> Dear R Developers, > > For package seriation I use Fortran code. I recently got a request to add > > #if defined(__ICC) || defined(__INTEL_COMPILER) > USE IFPORT > #endif > > to the code since the Intel Fortran compiler otherwise has problems with > rand(). However, to enable the FPP preprocessor I have to either add a'Writing R Extensions' advises you not to use system RNGs, so this is a good time to comply. ?6.6 of 'Writing R Extensions' describes how to use the R RNG from Fortran.> compiler flag (-cpp for gFortran) which is possibly not portable or > change the extension to .F, .fpp, .FPP (and a few others) which > automatically invokes the preprocessor (hopefully on all platforms). IMany compilers do not know about .fpp or .FPP, and .F is not portable to case-independent file systems.> tried .fpp and added the following to Makevars: > > OBJECTS=arsa.o bburcg.o bbwrcg.o bea.o criterion.o dist.o fprintf.o > greedy.o optimal.o stress.o > > %.o: %.fpp > $(F77) $(ALL_FFLAGS) -c $< -o $@ > > It seems to work (I tried Linux and Windows) but R CMD check gives me: > > * checking if this is a source package ... WARNING > Subdirectory ?src? contains: > arsa.fpp bburcg.fpp > > Is there a different preferred method to do this? Is it possible to add > support for Fortran with the fpp preprocessor (.fpp files) to the R > package building process?The support is as described in 'Writing R Extensions' ?1.1.5. You could add flags in PKG_FFLAGS, but you would have to use a configure script to find the right one (-xpp=fpp is also used). -- Brian D. Ripley, ripley at stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford 1 South Parks Road, Oxford OX1 3TG, UK
Maybe Matching Threads
- Default value of the option initial in the ses function in the forecast package.
- cannot create .hosts.b0WX1x : File exists
- Column name expansion in data.frame()
- Default value of the option initial in the ses function in the forecast package.
- [LLVMdev] Unnamed pass in on the fly pass manager