From owner-freebsd-ports@freebsd.org Tue Sep 20 07:04:18 2016 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 9AFD4BE259E for ; Tue, 20 Sep 2016 07:04:18 +0000 (UTC) (envelope-from mazhe@alkumuna.eu) Received: from smtp1-g21.free.fr (smtp1-g21.free.fr [IPv6:2a01:e0c:1:1599::10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5478DC1F for ; Tue, 20 Sep 2016 07:04:18 +0000 (UTC) (envelope-from mazhe@alkumuna.eu) Received: from yggdrasil.alkumuna.eu (unknown [IPv6:2a01:e35:8a74:6e70:232:36ff:fe5c:3a87]) by smtp1-g21.free.fr (Postfix) with ESMTPS id C7BC7B00553 for ; Tue, 20 Sep 2016 09:04:15 +0200 (CEST) Received: from freedom.alkumuna.eu ([IPv6:2a01:e35:8a74:6e70:62a4:4cff:fe54:b212]) (authenticated bits=0) by yggdrasil.alkumuna.eu (8.15.2/8.15.2) with ESMTPSA id u8K74BY9025433 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Sep 2016 09:04:14 +0200 (CEST) (envelope-from mazhe@alkumuna.eu) Date: Tue, 20 Sep 2016 09:04:05 +0200 From: Matthieu Volat To: freebsd-ports@freebsd.org Subject: Re: Patch to cmake detect OpenMP Message-ID: <20160920090405.221a4611@freedom.alkumuna.eu> In-Reply-To: <029185d0-d810-247d-d0c5-cdd8bc4a53ac@bsd.com.br> References: <029185d0-d810-247d-d0c5-cdd8bc4a53ac@bsd.com.br> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/+oS+Ac1V8lQfdWb8N29w8FN"; protocol="application/pgp-signature" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alkumuna.eu; s=dkim; t=1474355055; bh=zXGW1DrHtfXxOazd57ixOQWcAvMoIBKmqGx99rg+0gM=; h=Date:From:To:Subject:Message-ID:In-Reply-To:References:MIME-Version:Content-Type; b=Ub9+tEn0BjQLA1A8pg6+uBw9P3JJ9mOizwzfqNMwUoD/H41135orIb2iMLi2/0UHlq4ennSoAx3Xmx6bYb/siRiB1kAClQxTEjQKkEVdKoPtjsjoYR+cpC1+xQ+mFWy8fqMWwjBMUiFOrhIDswTZ67zmsF/KCzQrbdzCH/OABl8= 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: Tue, 20 Sep 2016 07:04:18 -0000 --Sig_/+oS+Ac1V8lQfdWb8N29w8FN Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 20 Sep 2016 00:55:44 -0300 Otac=C3=ADlio wrote: > I'm trying to port flann (http://www.cs.ubc.ca/research/flann/) to=20 > FreeBSD, but I need that cmake detects OpenMP. Unhappy, cmake do not=20 > detects OpenMP even when devel/openmp is installed, so I did this patch= =20 > to cmake port. What you guys think about? Can I open a bug report with=20 > patch? >=20 > []'s >=20 Hi, are you planning to submit this patch for cmake in ports or the upstrea= m project? This is not a really good idea to hardcode /usr/local like that, for there = can be may more providers for libomp (lang/clangXY ports, if you need a spe= cific to workaround bugs for example... or even maybe base in the future?).= Also, it would break cmake with GCC. Without changing any upstream code in either cmake or flann, for FreeBSD 11= +, you can just set : USES+=3D compiler:openmp=20 CFLAGS+=3D -I${LOCALBASE}/include LDFLAGS+=3D -L${LOCALBASE}/lib -lomp -lm I did not test how this behave on older release yet... And if you need to b= uild cmake-based projects outside ports, here's the flags I use: -DCMAKE_REQUIRED_INCLUDES=3D"/usr/local/include" \ -DCMAKE_REQUIRED_LIBRARIES=3D"-L/usr/local/lib -lomp -lm" \ -DCMAKE_EXE_LINKER_FLAGS=3D"-L/usr/local/lib -lomp -lm" \ -DCMAKE_MODULE_LINKER_FLAGS=3D"-L/usr/local/lib -lomp -lm" \ -DCMAKE_SHARED_LINKER_FLAGS=3D"-L/usr/local/lib -lomp -lm" -- Matthieu Volat --Sig_/+oS+Ac1V8lQfdWb8N29w8FN Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlfg32YACgkQ+ENDeYKZi35A5gCfdJ0zTyUN+bEtE+FlMwxgN2J9 ZNgAn2SwpURaxWwfzS5+0YpaNsPlfTwE =aHwX -----END PGP SIGNATURE----- --Sig_/+oS+Ac1V8lQfdWb8N29w8FN--