[Rcpp-devel] Getting different build commands on Linux vs. Mac OS

Evan Biederstedt evan.biederstedt at gmail.com
Mon Apr 30 23:42:53 CEST 2018


@Ralf

> I had not installed the necessary C library, so unsurprisingly the
compilation step already failed. What I find interesting is that in my case
"-std=gnu++11“ and "-I../inst/include/" are present in the command line
options for clang++. These are also missing from what you quoted and are
also a consequence of src/Makevars. It almost looks as if this file got
lost on your macOS box …

Interesting....I'm not sure what to make of this of course, but it would be
interesting if it was only happening on this macbook. Perhaps OS version or
brew could be to blame? I'm not sure what else would be "special" about
this macbook....

On Mon, Apr 30, 2018 at 5:33 PM, Ralf Stubner <ralf.stubner at r-institute.com>
wrote:

>
> > Am 30.04.2018 um 21:01 schrieb Evan Biederstedt <
> evan.biederstedt at gmail.com>:
> > @Ralf
> >
> > > You can change the used compiler for *your* system via ~/.R/Makevars,
> though. From my point of view that is a (short-time) workaround only. You
> have to figure out why clang does not like your package/library.
> >
> > I've yet to test changing the compiler in ~/.R/Makevars. However, it's
> not clear to me why this would be a short-term solution. Could you clarify
> why using g++ instead of clang would be a problem gong forwards?
>
> Because clang is the default compiler for R on MacOS. So you would make it
> difficult for other people (let alone CRAN) to make use of the package.
> However, I think there is something wrong about your macOS machine. I have
> just tried to compile your package on a macOS machine that I have access
> to, and I got quite different results:
>
> $ R CMD INSTALL bambi_1.0.tar.gz
> * installing to library ‘/Library/Frameworks/R.framework/Versions/3.4/
> Resources/library’
> * installing *source* package ‘bambi’ ...
> ** libs
> /usr/local/clang4/bin/clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include
> -DNDEBUG -I../inst/include/ -I"/Library/Frameworks/R.
> framework/Versions/3.4/Resources/library/Rcpp/include"
> -I/usr/local/include   -fPIC  -Wall -g -O2 -c RcppExports.cpp -o
> RcppExports.o
> /usr/local/clang4/bin/clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include
> -DNDEBUG -I../inst/include/ -I"/Library/Frameworks/R.
> framework/Versions/3.4/Resources/library/Rcpp/include"
> -I/usr/local/include   -fPIC  -Wall -g -O2 -c bambi.cpp -o bambi.o
> bambi.cpp:7:14: fatal error: 'bam_lmdb.h' file not found
>     #include "bam_lmdb.h"
>              ^~~~~~~~~~~~
> 1 error generated.
> make: *** [bambi.o] Error 1
> ERROR: compilation failed for package ‘bambi’
> * removing ‘/Library/Frameworks/R.framework/Versions/3.4/
> Resources/library/bambi’
>
> I had not installed the necessary C library, so unsurprisingly the
> compilation step already failed. What I find interesting is that in my case
> "-std=gnu++11“ and "-I../inst/include/" are present in the command line
> options for clang++. These are also missing from what you quoted and are
> also a consequence of src/Makevars. It almost looks as if this file got
> lost on your macOS box …
>
> Greetings
> Ralf
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20180430/4d3b3def/attachment.html>


More information about the Rcpp-devel mailing list