Date: Wed, 31 May 2017 23:46:26 -0500 From: Pedro Giffuni <pfg@FreeBSD.org> To: sgk@troutmask.apl.washington.edu Cc: freebsd-ports@freeBSD.org Subject: Re: Problems using OpenMP Message-ID: <6e070a28-04f2-0b06-d05e-fa78a4650c38@FreeBSD.org> In-Reply-To: <20170601024526.GA53333@troutmask.apl.washington.edu> References: <d0b35d5d-05a1-0445-476d-2c638d687fab@FreeBSD.org> <20170601024526.GA53333@troutmask.apl.washington.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On 05/31/17 21:45, Steve Kargl wrote: > 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 is C, the fortran interface is used for external libraries. OK.. it's interesting to know that, I didn't want to include it in the CFLAGS. What I am finding is that all these packages are in early stages of OpenMP adoption and generally prefer MPI. For now I am trying to use threads whenever it is an option. > > 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. > The packages I am porting were created by the labs that sponsored flang so I guess they will figure it out ;). Thanks! Pedro.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6e070a28-04f2-0b06-d05e-fa78a4650c38>