Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jul 2015 18:29:56 -0700
From:      Dennis Glatting <freebsd@pki2.com>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        ports@freebsd.org
Subject:   Re: Does OpenMP (iomp5) work for clang-devel?
Message-ID:  <1437442196.57135.13.camel@pki2.com>
In-Reply-To: <20150721010727.GA64147@spindle.one-eyed-alien.net>
References:  <1437439738.57135.5.camel@pki2.com> <20150721010727.GA64147@spindle.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2015-07-21 at 01:07 +0000, Brooks Davis wrote:
> On Mon, Jul 20, 2015 at 05:48:58PM -0700, Dennis Glatting wrote:
> > I can't seem to get this working and it appears not to emit code. I have
> > libiomp5 installed and I compile specifying:
> > 
> >  clang++-devel -fopenmp=libiomp5 ...
> > 
> > And the compiler says:
> > 
> >  clang: warning: argument unused during compilation: '-fopenmp=libiomp5'
> 
> The most recent clang-devel port doesn't include the bits to make iomp
> support automatic (it came not long after the update).  I'm working on
> a update, but the ability to build clang and llvm separately appears to
> have been broken quite badly so it's taking a while and the only port to
> install will be devel/llvm-devel.
> 
> Simple programs to work if you link with -liomp5 manually.
> 

They link but aren't OpenMP:

root@Tasha# cat foo.cc

#include <omp.h>
#include <stdio.h>

int
main( void ) {

  printf( "max=%d\n", omp_get_max_threads());

#pragma omp parallel for
  for( int i = 0; i < 5; ++i ) {

    printf( "tid=%d\n", omp_get_thread_num());
    
  }

  
  return 0;
}


root@Tasha# clang++-devel -fopenmp -liomp5 foo.cc
-L /usr/local/llvm-devel/lib/
root@Tasha# ./a.out 
max=8
tid=0
tid=0
tid=0
tid=0
tid=0


I have a couple of blocks under GNURadio (3.7.7.1) that need OpenMP, and
run under Ubuntu. I'd like to get them running on the minnowboard
(FreeBSD10) and they already run on the Cubieboard4 (some version of
Ubuntu gunk). Unfortunately not all of GNURadio's dependencies compile
with using GCC49/5 under FreeBSD.


> > Is there a compile-time test involved somewhere, perhaps in llvm build?
> 
> Assuming I manage to include the openmp runtime in the next update, I think
> it will work and I plan to configure the 
> 

Kewlness. Thanks.


> > Should /usr/local/llvm-devel/lib/ be in /etc/ld.so.conf? (That doesn't
> > seem to help).
> 
> ldconfig should be handled correctly by the ports infrastructure.
> 
> -- Brooks





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1437442196.57135.13.camel>