Does OpenMP (iomp5) work for clang-devel?

Dennis Glatting freebsd at pki2.com
Tue Jul 21 01:30:10 UTC 2015


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 at 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 at Tasha# clang++-devel -fopenmp -liomp5 foo.cc
-L /usr/local/llvm-devel/lib/
root at 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




More information about the freebsd-ports mailing list