From boenisch at bgc-jena.mpg.de Tue Jan 28 10:04:22 2020 From: boenisch at bgc-jena.mpg.de (Gerhard Boenisch) Date: Tue, 28 Jan 2020 10:04:22 +0100 Subject: [Rcpp-devel] rcpp compile problem Message-ID: <00ec01d5d5b9$eeae3d00$cc0ab700$@bgc-jena.mpg.de> Hi I am new to rcpp and am unable to compile code I know works. I must be doing something stupid. I am using Windows (10). I have received the cpp source files for the BHPMF package. We want to make the package work on the latest version of R. I am currently using R 3.4.4 (the last version BHPMF works). I have installed rcpp (install.packages("Rcpp")). I have installed RTools. The source files are in J:\TempWork\BHPMF_CRAN_Archive\src I am using the RTools C++ compiler in C:\Progs\Rtools\mingw_64\bin\c++.exe When I try to compile, the compiler cannot find file R.h and ends with error message: J:\TempWork\BHPMF_CRAN_Archive\src>C:\Progs\Rtools\mingw_64\bin\c++.exe HPMF_main.cpp HPMF_main.cpp:11:35: fatal error: R.h: No such file or directory #include // R functions ^ compilation terminated. Can someone please tell me how I can tell the compiler to find R.h and the other files from the rcpp package? I compile from the command prompt. Is this the right way or must I do this in R? Have I missed installing something? Have I installed staff in the wrong order? Thanks in advance. Best wishes Gerhard_________________________boenisch at bgc-jena.mpg.de Scientific Data Manager Dr. Gerhard Boenisch Phone: +49 3641 576277 MPI für Biogeochemie Fax: +49 3641 577200 Hans-Knoell Str. 10, 07745 Jena, Germany http://www.bgc-jena.mpg.de/~boenisch -------------- next part -------------- An HTML attachment was scrubbed... URL: From serguei.sokol at gmail.com Tue Jan 28 10:27:03 2020 From: serguei.sokol at gmail.com (Serguei Sokol) Date: Tue, 28 Jan 2020 10:27:03 +0100 Subject: [Rcpp-devel] rcpp compile problem In-Reply-To: <00ec01d5d5b9$eeae3d00$cc0ab700$@bgc-jena.mpg.de> References: <00ec01d5d5b9$eeae3d00$cc0ab700$@bgc-jena.mpg.de> Message-ID: Le 28/01/2020 à 10:04, Gerhard Boenisch a écrit : > Hi > > I am new to rcpp and am unable to compile code I know works. I must be > doing something stupid. > > I am using Windows (10). > > I have received the cpp source files for the BHPMF package. We want to > make the package work on the latest version of R. > > I am currently using R 3.4.4 (the last version BHPMF works). > > I have installed rcpp (install.packages("Rcpp")). > > I have installed RTools. > > The source files are in J:\TempWork\BHPMF_CRAN_Archive\src > > I am using the RTools C++ compiler in C:\Progs\Rtools\mingw_64\bin\c++.exe > > When I try to compile, the compiler cannot find file R.h and ends with > error message: > > J:\TempWork\BHPMF_CRAN_Archive\src>C:\Progs\Rtools\mingw_64\bin\c++.exe > HPMF_main.cpp > > HPMF_main.cpp:11:35: fatal error: R.h: No such file or directory > > #include       // R functions > >                                    ^ > > compilation terminated. > > Can someone please tell me how I can tell the compiler to find R.h and > the other files from the rcpp package? > > I  compile from the command prompt. Is this the right way or must I do > this in R? > > Have I missed installing something? Have I installed staff in the wrong > order? I see two options for compiling your packages. 1. You do R CMD build J:\TempWork\BHPMF_CRAN_Archive\ which should produce something like BHPMF_1.0.tar.gz (1.0 being an example of package version). Then R CMD check J:\TempWork\BHPMF_1.0.tar.gz (put the true name of the produced tarball here). After that you can see all used flags and options in J:\TempWork\BHPMF.Rcheck\00install.out file. 2. In R session having J:\TempWork\BHPMF_CRAN_Archive\ as working dir you do devtools::load_all() The first option is better suited for final stages of your dev work while the second one is more appropriate for your iterative dev cycles. Best, Serguei. > > Thanks in advance. > > Best wishes > > Gerhard_________________________boenisch at bgc-jena.mpg.de > > > Scientific Data Manager > > Dr. Gerhard Boenisch                     Phone: +49 3641 576277 > > MPI für Biogeochemie                   Fax:        +49 3641 577200 > > Hans-Knoell Str. 10,                         07745 Jena,        Germany > > http://www.bgc-jena.mpg.de/~boenisch > > > _______________________________________________ > Rcpp-devel mailing list > Rcpp-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > From retep.meissner at gmail.com Tue Jan 28 11:10:41 2020 From: retep.meissner at gmail.com (Peter Meissner) Date: Tue, 28 Jan 2020 11:10:41 +0100 Subject: [Rcpp-devel] rcpp compile problem In-Reply-To: References: <00ec01d5d5b9$eeae3d00$cc0ab700$@bgc-jena.mpg.de> Message-ID: Hey, you might consider using RStudio which makes this work pretty much out of the box: https://support.rstudio.com/hc/en-us/articles/200486088-Using-Rcpp-with-RStudio Best, Peter Am Di., 28. Jan. 2020 um 10:27 Uhr schrieb Serguei Sokol < serguei.sokol at gmail.com>: > Le 28/01/2020 à 10:04, Gerhard Boenisch a écrit : > > Hi > > > > I am new to rcpp and am unable to compile code I know works. I must be > > doing something stupid. > > > > I am using Windows (10). > > > > I have received the cpp source files for the BHPMF package. We want to > > make the package work on the latest version of R. > > > > I am currently using R 3.4.4 (the last version BHPMF works). > > > > I have installed rcpp (install.packages("Rcpp")). > > > > I have installed RTools. > > > > The source files are in J:\TempWork\BHPMF_CRAN_Archive\src > > > > I am using the RTools C++ compiler in > C:\Progs\Rtools\mingw_64\bin\c++.exe > > > > When I try to compile, the compiler cannot find file R.h and ends with > > error message: > > > > J:\TempWork\BHPMF_CRAN_Archive\src>C:\Progs\Rtools\mingw_64\bin\c++.exe > > HPMF_main.cpp > > > > HPMF_main.cpp:11:35: fatal error: R.h: No such file or directory > > > > #include // R functions > > > > ^ > > > > compilation terminated. > > > > Can someone please tell me how I can tell the compiler to find R.h and > > the other files from the rcpp package? > > > > I compile from the command prompt. Is this the right way or must I do > > this in R? > > > > Have I missed installing something? Have I installed staff in the wrong > > order? > I see two options for compiling your packages. > 1. You do > > R CMD build J:\TempWork\BHPMF_CRAN_Archive\ > > which should produce something like BHPMF_1.0.tar.gz (1.0 being an > example of package version). Then > R CMD check J:\TempWork\BHPMF_1.0.tar.gz (put the true name of the > produced tarball here). After that you can see all used flags and > options in J:\TempWork\BHPMF.Rcheck\00install.out file. > > 2. In R session having J:\TempWork\BHPMF_CRAN_Archive\ as working dir you > do > > devtools::load_all() > > The first option is better suited for final stages of your dev work > while the second one is more appropriate for your iterative dev cycles. > > Best, > Serguei. > > > > > Thanks in advance. > > > > Best wishes > > > > Gerhard_________________________boenisch at bgc-jena.mpg.de > > > > > > Scientific Data Manager > > > > Dr. Gerhard Boenisch Phone: +49 3641 576277 > > > > MPI für Biogeochemie Fax: +49 3641 577200 > > > > Hans-Knoell Str. 10, 07745 Jena, Germany > > > > http://www.bgc-jena.mpg.de/~boenisch > > > > > > _______________________________________________ > > Rcpp-devel mailing list > > Rcpp-devel at lists.r-forge.r-project.org > > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > > > > _______________________________________________ > Rcpp-devel mailing list > Rcpp-devel at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From ralf.stubner at gmail.com Tue Jan 28 15:28:20 2020 From: ralf.stubner at gmail.com (Ralf Stubner) Date: Tue, 28 Jan 2020 15:28:20 +0100 Subject: [Rcpp-devel] rcpp compile problem In-Reply-To: <00ec01d5d5b9$eeae3d00$cc0ab700$@bgc-jena.mpg.de> References: <00ec01d5d5b9$eeae3d00$cc0ab700$@bgc-jena.mpg.de> Message-ID: On Tue, Jan 28, 2020 at 10:04 AM Gerhard Boenisch wrote: > > Hi > > I am new to rcpp and am unable to compile code I know works. I must be doing something stupid. > > I am using Windows (10). > > I have received the cpp source files for the BHPMF package. We want to make the package work on the latest version of R. I assume this refers to https://cran.r-project.org/src/contrib/Archive/BHPMF/BHPMF_1.0.tar.gz, right? Then this is actually off-topic on this list, since BHPMF does not use Rcpp. The r-pkg-devel mailing list might be more appropriate. > I am currently using R 3.4.4 (the last version BHPMF works). I think you can work with a more recent version right away. Out of curiosity I ran R CMD check BHPMF_1.0.tar.gz using current R 3.6.2. This command compiles and installs the package and runs different checks on it. The result were two warnings: * checking whether package ‘BHPMF’ can be installed ... WARNING Found the following significant warnings: utillity.cpp:293:15: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] [...] * checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... WARNING apparently using $(BLAS_LIBS) without following $(FLIBS) in ‘src/Makevars’ Warnings like this this are sufficient to have a package removed from CRAN. They should be easy enough to fix, though. cheerio ralf From edd at debian.org Tue Jan 28 15:40:23 2020 From: edd at debian.org (Dirk Eddelbuettel) Date: Tue, 28 Jan 2020 08:40:23 -0600 Subject: [Rcpp-devel] rcpp compile problem In-Reply-To: References: <00ec01d5d5b9$eeae3d00$cc0ab700$@bgc-jena.mpg.de> Message-ID: <24112.18391.431964.927849@rob.eddelbuettel.com> On 28 January 2020 at 11:10, Peter Meissner wrote: | you might consider using RStudio which makes this work pretty much out of | the box: | https://support.rstudio.com/hc/en-us/articles/200486088-Using-Rcpp-with-RStudio I am sorry but that needs a qualifier. Otherwise this statement somewhat implies that things do not work out of the box otherwise. Which is of course entirely false. We have been building R packages from compiled source for many years before the IDE made it easier by checking more settings. At the risk of sounding old(-school), I actually still think there is value in knowing why/where things fail. Which is typically path or registry settings on Windows. So I would prefer if we pointed to ways to diagnose this, rather than to blanked it away. That said, the IDE is a fine tool, and double-checks and sets many things. I used it myself the last time I tried to build something on Windows. But please let's not forget the root cause of things which are often faulty installations (which happen on Windows). Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org From edd at debian.org Tue Jan 28 15:51:50 2020 From: edd at debian.org (Dirk Eddelbuettel) Date: Tue, 28 Jan 2020 08:51:50 -0600 Subject: [Rcpp-devel] rcpp compile problem In-Reply-To: References: <00ec01d5d5b9$eeae3d00$cc0ab700$@bgc-jena.mpg.de> Message-ID: <24112.19078.46869.116357@rob.eddelbuettel.com> Gerhard, On 28 January 2020 at 15:28, Ralf Stubner wrote: | On Tue, Jan 28, 2020 at 10:04 AM Gerhard Boenisch | wrote: | > I am new to rcpp and am unable to compile code I know works. I must be doing something stupid. | > | > I am using Windows (10). | > | > I have received the cpp source files for the BHPMF package. We want to make the package work on the latest version of R. | | I assume this refers to | https://cran.r-project.org/src/contrib/Archive/BHPMF/BHPMF_1.0.tar.gz, | right? Then this is actually off-topic on this list, since BHPMF does | not use Rcpp. The r-pkg-devel mailing list might be more appropriate. Uh-oh, please do not abuse the friendly nature of this list for non-related topics. There are r-help, StackOverflow, the excellent r-pkg-devel and more. | > I am currently using R 3.4.4 (the last version BHPMF works). | | I think you can work with a more recent version right away. Out of | curiosity I ran | | R CMD check BHPMF_1.0.tar.gz | | using current R 3.6.2. This command compiles and installs the package | and runs different checks on it. The result were two warnings: | | * checking whether package ‘BHPMF’ can be installed ... WARNING | Found the following significant warnings: | utillity.cpp:293:15: warning: ignoring return value of ‘int | fscanf(FILE*, const char*, ...)’, declared with attribute | warn_unused_result [-Wunused-result] | [...] | * checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... WARNING | apparently using $(BLAS_LIBS) without following $(FLIBS) in ‘src/Makevars’ | | Warnings like this this are sufficient to have a package removed from | CRAN. They should be easy enough to fix, though. r-pkg-devel seems like a good venue for general R package tips. Good luck, Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org