From owner-freebsd-ports@freebsd.org Tue Sep 20 10:01:59 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 B574BBE1697 for ; Tue, 20 Sep 2016 10:01:59 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A0F8946 for ; Tue, 20 Sep 2016 10:01:59 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: by mail-it0-x231.google.com with SMTP id o3so93140510ita.1 for ; Tue, 20 Sep 2016 03:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=TscOlm4g+E9G8eZLDee/4TvI/7F3Ts3wfN0GgOYVZ+s=; b=DUq+mJiT3SsXnKLDQPa0m4oUQq3v8JF6lgU6UoaCzma35HaZKnrMF9idBFA3K9ijdZ CTAGrK0OFVHNWfZgipPDyZngEiMm8yEk9GIPSbttt1+vGMvaf8q77Y9D1bs/oCmIldgM GDrX5MyeRROCPaG3rX7u4/dmEIDkQgzUQ2FcU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=TscOlm4g+E9G8eZLDee/4TvI/7F3Ts3wfN0GgOYVZ+s=; b=bFgyZBf02PmGndJt5nc/TxcgAwSYRcmbTIcMWHKG7C/rTqFSFsJWdpbFLHNdz+pORM 8xDlptHV6yzxhDvDCMvgDeDo0oVmCEmx9/FxRbIAHXE/iZ83g7aB8hhL/Ped6ZNWENMC 944zTepEFgoaPC4ETHLC2Bm4I/yrYdOw0M+XIhhGksFAPM9fclZ1J/uvfkSkioFdi0Xn uq25QVa4TlLPISDA5FkY/tKB7hVMfVN/x72fS0wkWpUiicHw6Ftb2VAn2V/svFJXY0iq x7F9GoFvxyOElkNT+WapgDY2RbdB8e60VnIQ/iDW1cQNrkKYRKE7IO+TABCGZkTbuyu9 el+Q== X-Gm-Message-State: AE9vXwOHKL5v+WdH6p/HpTpzAkOyi+16mXJCaaRcqEflsxvGwtjwXViJTS9kDWmU7T0RjvGnkWhHR4WJhLmDHw== X-Received: by 10.36.249.194 with SMTP id l185mr2909320ith.102.1474365718737; Tue, 20 Sep 2016 03:01:58 -0700 (PDT) MIME-Version: 1.0 References: <029185d0-d810-247d-d0c5-cdd8bc4a53ac@bsd.com.br> <20160920090405.221a4611@freedom.alkumuna.eu> In-Reply-To: <20160920090405.221a4611@freedom.alkumuna.eu> From: =?UTF-8?Q?Otac=C3=ADlio_de_Ara=C3=BAjo_Ramos_Neto?= Date: Tue, 20 Sep 2016 10:01:47 +0000 Message-ID: Subject: Re: Patch to cmake detect OpenMP To: Matthieu Volat , freebsd-ports@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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 10:01:59 -0000 Em ter, 20 de set de 2016 04:04, Matthieu Volat escreveu: > 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 > > FreeBSD, but I need that cmake detects OpenMP. Unhappy, cmake do not > > detects OpenMP even when devel/openmp is installed, so I did this patc= h > > to cmake port. What you guys think about? Can I open a bug report with > > patch? > > > > []'s > > > > Hi, are you planning to submit this patch for cmake in ports or the > upstream project? > > This is not a really good idea to hardcode /usr/local like that, for ther= e > can be may more providers for libomp (lang/clangXY ports, if you need a > specific 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 > 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 > build 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 > Hi Matthieu. I was planning to submit this patch in ports but, after yours appointments, I have declined from the idea. My motivation was that if cmake proposes find OpenMP it must find OpenMP. But, my patch is not the right procedure to do it. []'s -Otacilio >