From owner-freebsd-ports@freebsd.org Thu Jun 1 02:45:30 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A20CDBF1FC2 for ; Thu, 1 Jun 2017 02:45:30 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 870F876DA0; Thu, 1 Jun 2017 02:45:27 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id v512jQkI053373 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 31 May 2017 19:45:26 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id v512jQ2g053372; Wed, 31 May 2017 19:45:26 -0700 (PDT) (envelope-from sgk) Date: Wed, 31 May 2017 19:45:26 -0700 From: Steve Kargl To: Pedro Giffuni Cc: freebsd-ports@freeBSD.org Subject: Re: Problems using OpenMP Message-ID: <20170601024526.GA53333@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 02:45:30 -0000 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 > ^~~~~~~ > --- 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