[R-pkg-devel] Making adjustments to the R CMD check/install commands
Erin Hodgess
erinm@hodge@@ @ending from gm@il@com
Mon Aug 27 23:32:53 CEST 2018
Thank you, Kevin!
I put together the Makevars file:
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS)
FC=c:/progra~1/PGICE/win64/18.4/bin/pgf90
SAFE_FFLAGS="-Lc:/progra~1/PGICE/win64/18.4/lib/pgf90.dll
-Lc:/progra~1/PGICE/win64/18.4/lib/pgc14.dll"
rmpiFort.obj: rmpiFort.f90
$(FC) $(SAFE_FFLAGS) -Mmpi=msmpi -c rmpiFort.f90 -o rmpiFort.obj
rmpiFort.dll: rmpiFort.obj
$(FC) $(SAFE_FFLAGS) rmpiFort.obj -Mmpi=msmpi -Mmakedll -o
rmpiFort.dll
But when I run R CMD check, the 00install file shows that the gfortran
compile is used, rather than the PGI compiler:
* installing *source* package 'rmpiFort' ...^M
** libs^M
^M
*** arch - i386^M
C:/progra~1/R/R-35~1.1/share/make/winshlib.mk:13: warning: overriding
commands for target `rmpiFort.dll'
Makevars:10: warning: ignoring old commands for target `rmpiFort.dll'
c:/Rtools/mingw_32/bin/gfortran -O2 -msse2 -mfpmath=sse -Mmpi=msmpi -c
rmpiFort.f90 -o rmpiFort.obj
gfortran.exe: error: unrecognized command line option '-Mmpi=msmpi'^M
make: *** [rmpiFort.obj] Error 1
ERROR: compilation failed for package 'rmpiFort'^M
* removing 'C:/Users/erinm/rmpiFort.Rcheck/rmpiFort'^M
In R CMD INSTALL^M
So I'm still puzzled.
Any help much appreciated.
Sincerely,
Erin
Erin Hodgess, PhD
mailto: erinm.hodgess using gmail.com
On Mon, Aug 27, 2018 at 2:29 PM Kevin Ushey <kevinushey using gmail.com> wrote:
> Hi Erin,
>
> The R extensions manual should be helpful here -- in particular, see the
> sections on the 'src/Makevars' file and configuration of the Fortran
> compiler:
>
> https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Using-Makevars
>
> In particular, in your 'src/Makevars' file, you'll likely want to set the
> FC variable to choose the Fortran compiler, and FCFLAGS to choose the
> appropriate compilation flags. As an example, you can see how one might set
> these flags to compile code with the address sanitizer active:
>
>
> https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Using-Address-Sanitizer
>
> (Note that this example uses the user-level '~/.R/Makevars' file rather
> than the package-level 'src/Makevars' file, but the crux is the same)
>
> Hope this gets you on the right track,
> Kevin
>
> On Mon, Aug 27, 2018 at 1:15 PM Erin Hodgess <erinm.hodgess using gmail.com>
> wrote:
>
>> Hello!
>>
>> I'm building a package on Windows 10 which uses the PGI Fortran compiler.
>> I have a Makefile set up in the src directory, and when I run "make all",
>> the subroutines compile beautifully.
>>
>> Now I want to create my package. When I run R CMD check, naturally,
>> gfortran is called. Is there a way that I can direct the check function
>> to
>> just use the make/Makefile, please?
>>
>> Or am I out of luck, please? (highly probable)
>>
>> Thanks,
>> Erin
>>
>> Erin Hodgess, PhD
>> mailto: erinm.hodgess using gmail.com
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-package-devel using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>
>
[[alternative HTML version deleted]]
More information about the R-package-devel
mailing list