Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Aug 2016 08:19:20 -0500
From:      "Eric A. Borisch" <eborisch@gmail.com>
To:        =?UTF-8?Q?Fernando_Herrero_Carr=C3=B3n?= <elferdo@gmail.com>
Cc:        "K. Macy" <kmacy@freebsd.org>, FreeBSD Stable <freebsd-stable@freebsd.org>
Subject:   Re: Benchmarks results for FreeBSD 11
Message-ID:  <CAASnNnocWuerb-7%2B88AD7y%2BtvRS9cd3KC=8jBFUxp%2BQ1_9x58w@mail.gmail.com>
In-Reply-To: <CAMwkeZyU%2BD3czMujabbHnyO7Q7B1_46zMC9BWTY-3L2WcFsndw@mail.gmail.com>
References:  <CAASnNnqGFJ9bwZ-k3CrobRaPWcOFnxEQJ=crnV-BGAQ_REtZUA@mail.gmail.com> <CAHM0Q_MsPwVMaxgXryO4m_c2-tXAVHbqqi7%2BsCNq5LHVrY30Ow@mail.gmail.com> <CAMwkeZyU%2BD3czMujabbHnyO7Q7B1_46zMC9BWTY-3L2WcFsndw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Plans for usage of LLVM's linker were just discussed on BSDNow
(from toolchain mailing list):

http://www.bsdnow.tv/episodes/2016_08_24-the_fresh_bsd_experience

https://lists.freebsd.org/pipermail/freebsd-toolchain/2016-August/002240.ht=
ml

  - Eric

On Wednesday, August 31, 2016, Fernando Herrero Carr=C3=B3n <elferdo@gmail.=
com>
wrote:

> That's great news! Thanks a lot!
>
> Excuse me if I drift off-topic, how about -flto? LTO requires both
> compiler and linker support, however clang3? from ports still calls the
> system linker 'ld'. LLVM has its own linker, 'lld', but it is not
> straightforward, AFAIK, to make clang3? call it.
>
> My trick up to now is to create a symbolic link in the current directory
> and have '.' in the PATH before anything else.
>
> ln -s /usr/local/llvm37/bin/lld ./ld
> clang37 -flto ...
>
> Am I missing something or is there a chance for improvement here?
>
> 2016-08-31 3:17 GMT+02:00 K. Macy <kmacy@freebsd.org
> <javascript:_e(%7B%7D,'cvml','kmacy@freebsd.org');>>:
>
>> On Tue, Aug 30, 2016 at 10:39 AM, Eric A. Borisch <eborisch@gmail.com
>> <javascript:_e(%7B%7D,'cvml','eborisch@gmail.com');>> wrote:
>> > FWIW, in MacPorts, we patch clang such that it can find the (MacPorts
>> > provided) libomp headers and library. This lets -fopenmp "just work,"
>> > and configure scripts can do their job. The libomp headers and lib in
>> > dedicated sub-directories to minimize the impact of -fopenmp adding
>> > them to the include and link paths.
>> >
>> > It is a fairly minor patch, and shouldn't (tm) have any impact on
>> > clang executions without an openmp flag:
>> > https://trac.macports.org/browser/trunk/dports/lang/llvm-3.
>> 8/files/openmp-locations.patch
>> >
>> > To get a simple OpenMP test script to compile on FreeBSD, I currently
>> > need to pass (note I'm not the one using -lm):
>> >
>> >   clang38 -fopenmp -o test test.c -L /usr/local/llvm38/lib  -lm
>> >
>> > instead of (~ what configure will try)
>> >
>> >   clang38 -fopenmp -o test test.c
>> >
>> > (11.0RC2 w/ llvm38 installed via pkg)
>> >
>> > I'd love to see base include llvm's OpenMP support, but failing that,
>> > the one from ports should be made to work as configure scripts expect.
>> >
>> > And who knows, if it is there, maybe some items in base will start to
>> > use it. We've got a chicken-and-egg problem right now.
>>
>> Thanks for the patch. Johannes Dieterich hacked the llvm38 port in my
>> graphics branch and:
>>
>>
>> mmacy@armageddon [~|18:13|81] clang++ omp.cpp -fopenmp
>> mmacy@armageddon [~|18:13|81] cat omp.cpp
>> #include <string>
>> #include <iostream>
>> using namespace std;
>> int main(int argc, char** argv) {
>>
>>
>> #pragma omp parallel for default(shared)
>> for(int i =3D 0; i < 100; ++i){
>> #ifdef _OPENMP
>> cout << "WITH OPENMP " << i << endl;
>> #else
>> cout << "WITHOUT OPENMP " << i << endl;
>> #endif
>> }
>> return 0;
>> }
>> mmacy@armageddon [~|18:13|82] clang++38 omp.cpp -fopenmp
>> mmacy@armageddon [~|18:13|83] ./a.out| head -5
>> WITH OPENMP WITH OPENMP 84WITH OPENMP 92WITH OPENMP
>> 44
>> WITH OPENMP WITH OPENMP 9352WITH OPENMP
>> 76WITH OPENMP WITH OPENMP 0
>> WITH OPENMP
>>
>>
>>
>> Fingers crossed that this can get propagated to master and the
>> defaults for openblas, FFTW, and others can be made more sensible.
>>
>> -M
>> _______________________________________________
>> freebsd-stable@freebsd.org
>> <javascript:_e(%7B%7D,'cvml','freebsd-stable@freebsd.org');> mailing lis=
t
>> https://lists.freebsd.org/mailman/listinfo/freebsd-stable
>> To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org
>> <javascript:_e(%7B%7D,'cvml','freebsd-stable-unsubscribe@freebsd.org');>=
"
>>
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAASnNnocWuerb-7%2B88AD7y%2BtvRS9cd3KC=8jBFUxp%2BQ1_9x58w>