pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: FreeBSD 10, clang, and openmp



* On 2014-07-16 at 20:57 BST, Jason Bacon wrote:

> On 07/16/14 14:31, Jonathan Perkin wrote:
> >* On 2014-07-16 at 20:11 BST, Jason Bacon wrote:
> >
> >>Is there an "official" way to force pkgsrc to use GCC on FreeBSD 10?  (
> >>Assuming the pkgsrc gcc packages work on FreeBSD, which I'm trying right
> >>now. )
> >>
> >>I'm going to be converting a lot of FreeBSD ports to pkgsrc in the near
> >>future and the process is much more efficient if I can use FreeBSD to get
> >>the pkg to a working state before testing on other platforms.
> >>
> >>I've run into problems with software that requires openmp, because it's
> >>disabled in FreeBSD's clang base compiler.  In the FreeBSD port, I can
> >>indicate the need for GCC instead of clang with
> >>
> >>     USE_GCC=any
> >>
> >>In pkgsrc, I've tried things like
> >>
> >>     GCC_REQD=4.5
> >>
> >>which has no effect - pkgsrc still uses clang and clang++.
> >PKGSRC_COMPILER is the user variable which tells pkgsrc which compiler
> >you are using.  GCC_REQD is only valid if you have already set this to
> >'gcc'.  You'd normally set PKGSRC_COMPILER at bootstrap time using the
> >--compiler flag.
> >
> >If a package specifically requires clang, then in the package Makefile
> >you can set PKGSRC_COMPILER+= clang, and then ONLY_FOR_COMPILER=clang.
> >
> >Hope that helps,
> >
> Thanks - that is informative.
> 
> It sounds like I would need to bootstrap the whole pkgsrc installation using
> GCC to make this work, which would probably not be difficult using FreeBSD's
> GCC port (/usr/local/bin/gcc47, for example).
> 
> What I was hoping to do, though, was bootstrap from the FreeBSD base clang
> and trigger installation of a pkgsrc gcc package as a dependency if needed.
> 
> This is what FreeBSD's USE_GCC will do if clang is the base compiler
> (FreeBSD 10.0 and later).  FTR, USE_GCC=any allows the use of the base gcc
> compiler in FreeBSD systems prior to 10.0, while USE_GCC=yes forces
> installation of a gcc port on any FreeBSD release, regardless of whether the
> base compiler is gcc or clang.

Right, that is what my second paragraph would achieve, though you
would need to ensure that anywhere you add this is done with something
like:

  .include "../../mk/bsd.prefs.mk"
  .if ${OPSYS} == "FreeBSD"
  PKGSRC_COMPILER+= gcc
  NOT_FOR_COMPILER= clang
  .endif

so as to not break other operating systems which ship with a working
clang.

-- 
Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com


Home | Main Index | Thread Index | Old Index