<br><br>On Monday, July 6, 2015, Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 6 July 2015 at 17:24, Peng Yu wrote:<br>
| BTW, I checked all the packages that depend on Rcpp one way or<br>
| another. All the packages which use FORTRAN only have .f files but not<br>
| .f90 files. Is it an coincident or it is known that R does not support<br>
| .f90 well?<br>
<br>
A _15 second_ search of Writing R Extensions reveals this in Section 1.1.5:</blockquote><div><br></div><div>Thanks. <span></span>I also saw it. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
      The sources and headers for the compiled code are in 'src', plus<br>
   optionally a file 'Makevars' or 'Makefile'.  When a package is installed<br>
   using 'R CMD INSTALL', 'make' is used to control compilation and linking<br>
   into a shared object for loading into R. There are default 'make'<br>
   variables and rules for this (determined when R is configured and<br>
   recorded in 'R_HOME/etcR_ARCH/Makeconf'), providing support for C, C++,<br>
   FORTRAN 77, Fortran 9x(5), Objective C and Objective C++(6) with<br>
   associated extensions '.c', '.cc' or '.cpp', '.f', '.f90' or '.f95',<br>
   '.m', and '.mm', respectively.  We recommend using '.h' for headers,<br>
   also for C++(7) or Fortran 9x include files.  (Use of extension '.C' for<br>
   C++ is no longer supported.)  Files in the 'src' directory should not be<br>
   hidden (start with a dot), and hidden files will under some versions of<br>
   R be ignored.<br>
<br>
      It is not portable (and may not be possible at all) to mix all these<br>
   languages in a single package, and we do not support using both C++ and<br>
   Fortran 9x. </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote><div><br></div><div>The funny thing of the manual is that actually my package can be compiled on Mac. It is defintitely possible to mix fortran 90 and C++ (at least with some subset features of both).</div><div><br></div><div>It seems that this is just another problem of R's documention and some idiosyncratic decision made by the R core team members in charge of this aspect.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Because R itself uses it, we know that C and FORTRAN 77 can<br>
   be used together and mixing C and C++ seems to be widely successful.<br>
<br>
Note the second paragraph:  So f90 and C++ do NOT go together.<br>
<br>
Dirk<br>
<br>
--<br>
<a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="javascript:;" onclick="_e(event, 'cvml', 'edd@debian.org')">edd@debian.org</a><br>
</blockquote><br><br>-- <br>Regards,<br>Peng<br>