Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 May 2017 19:45:26 -0700
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Pedro Giffuni <pfg@FreeBSD.org>
Cc:        freebsd-ports@freeBSD.org
Subject:   Re: Problems using OpenMP
Message-ID:  <20170601024526.GA53333@troutmask.apl.washington.edu>
In-Reply-To: <d0b35d5d-05a1-0445-476d-2c638d687fab@FreeBSD.org>
References:  <d0b35d5d-05a1-0445-476d-2c638d687fab@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 31, 2017 at 08:56:18PM -0500, Pedro Giffuni wrote:
> 
> FWIW, I tried using OpenMP in a port (hypre) and I thought the option 
> would be something as simple as this:
> 
> OPENMP_CONFIGURE_WITH=    openmp
> OPENMP_CONFIGURE_USES=    compiler:openmp
> 
> Unfortunately that is not enough:
> 
> ...
> 
> In file included from ./_hypre_utilities.h:16:
> ./HYPRE_utilities.h:29:10: fatal error: 'omp.h' file not found
> #include <omp.h>
>           ^~~~~~~
> --- amg_linklist.o ---
> ...
> 
> And the file is here:
> 
> /usr/local/lib/gcc5/gcc/x86_64-portbld-freebsd11.0/5.4.0/include/omp.h
> /usr/local/llvm39/lib/clang/3.9.1/include/omp.h
> 
> Which is not really clean to include :(. Any suggestion?
> 

This is similar to the problem with having to find -Wl,-L/usr/local/... to 
find gfortran's shared libraries.  For gfortran you can do

#! /bin/sh
LD_LIBRARY_PATH=$HOME/work/lib
export LD_LIBRARY_PATH
LD_RUN_PATH=$HOME/work/lib
export LD_RUN_PATH
PATH=$HOME/work/bin:$PATH
gfortran $@

gcc has a C_INCLUDE_PATH environmental variable.  Don't know if this
works with gfortran or if there is a GFORTRAN_INCLUDE_PATH.


This does not work with flang as she does not support LD_LIBRARY_PATH or
LD_RUN_PATH.  For openmp, and in particularly for the old fashion omp.h
file, you'll need to add an appropriate -I/path/to/omp... stuff to your
FFLAGS.  You can add -I/usr/local/flang/include to /usr/local/bin/flang
as it is a simple Bourne shell script.

-- 
Steve
20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4
20161221 https://www.youtube.com/watch?v=IbCHE-hONow



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