[R-SIG-Mac] unable to install from source packages needing compiled C code

Adrian Dușa du@@@@dr|@n @end|ng |rom gm@||@com
Fri Dec 3 01:05:40 CET 2021


Thanks again, problem solved.
Removing llvm from /usr/local/opt does the trick.

Kevin's suggestion to have a Makevars file pointing to the system clang
also worked, although I have no idea which headers from /usr/local/include
are masking and which are not. I've removed all and get no more errors or
warnings.

Best wishes,
Adrian



On Fri, 3 Dec 2021 at 01:32, Kevin Ushey <kevinushey using gmail.com> wrote:

> This may also make your life challenging:
>
> /usr/local/include/sys/_types.h:33:10: fatal error: 'machine/_types.h' file
> not found
> #include <machine/_types.h>
>          ^~~~~~~~~~~~~~~~~~
> 1 error generated.
>
> You have some headers installed in /usr/local/include that are
> shadowing the default macOS toolchain's headers, and those appear to
> be incompatible with the system toolchain. You'll likely need to
> remove those as well.
>
> To be complete, x86_64 builds of R usually have something like:
>
> CPPFLAGS = -I/usr/local/include
>
> within their Makeconf; if you've placed headers there that shadow the
> default system headers, they'll be used instead.
>
> tl;dr: you probably need to do a couple things.
>
> (1) Remove /usr/local/opt/llvm/bin from your PATH so llvm clang stops
> shadowing the system clang;
> (2) Remove the system headers in /usr/local/include that are masking
> your system header includes.
>
> You could also probably force the use of system clang in R by setting
> CC = /usr/bin/clang and CXX = /usr/bin/clang++ in (say) ~/.R/Makevars,
> but I haven't tried that.
>
> Best,
> Kevin
>
> On Thu, Dec 2, 2021 at 1:29 PM Simon Urbanek
> <simon.urbanek using r-project.org> wrote:
> >
> >
> > Adrian,
> >
> >
> > > On Dec 3, 2021, at 10:12 AM, Adrian Dușa <dusa.adrian using gmail.com>
> wrote:
> > >
> > > Thank you Simon,
> > >
> > > I have the official Apple CLT, but not the full Xcode. If needed I can
> install that as well, with a difference of about 10GB more space getting
> used.
> > > This is what I get:
> > >
> > > $ xcode-select -p
> > > /Library/Developer/CommandLineTools
> > >
> > > $ xcrun --show-sdk-path
> > > /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
> > >
> > > $ which clang
> > > /usr/local/opt/llvm/bin/clang
> > >
> >
> >
> > ^^^-- this is your problem. You're not using Xcode so that's exactly
> what I said, you have a broken compiler. Remove /usr/local/opt and it
> should work.
> >
> > Cheers,
> > Simon
> >
> > _______________________________________________
> > R-SIG-Mac mailing list
> > R-SIG-Mac using r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>

	[[alternative HTML version deleted]]



More information about the R-SIG-Mac mailing list