From owner-freebsd-ports@freebsd.org Tue Sep 20 03:55:58 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 E05D9BDF3E3 for ; Tue, 20 Sep 2016 03:55:58 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) (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 98FDCB3D for ; Tue, 20 Sep 2016 03:55:57 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: by mail-qt0-x241.google.com with SMTP id 11so184171qtc.3 for ; Mon, 19 Sep 2016 20:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=GgTgqf4ZAg3wcW2HK1UA+3CMaJyarBQdTyotBsckNqo=; b=VQvmvWD0hDPhBGXLjgBXun3zggmU65LLiZvCBTUYbmgxqLczYIz4vahV0J6a5e4buK UZWVPXK7qZUlRZGWv3HixxM1kYekO9tOjXcbJrFJFd2QaAzb0i4NyeHRSUtUexxD+8O+ NZ6+PQ8K5bHf2CO1o3miA19ggM9npeshyKveU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=GgTgqf4ZAg3wcW2HK1UA+3CMaJyarBQdTyotBsckNqo=; b=h66ZjxJUgNiooxsunHEytjzqD+wJKyeukzMPQ3DHVp/78QRJDa24IHP98p8JNS7Jky 25sVemjk8eQ7WGws4WVED1rVFSogGOWhlDIEkhOMB+LG6gatHv4YikykKYbqIFQ3jI1W ffUpCbkNx5k3kKE/MtwRu49pw65Vw2CoDYbnpBPrfzZddUEaXUk+BkhgjDqy61p6cLmd TqMkAoJfNOaaK9fvAy9ZFrd8yNFpvPeS9PiU5l69A+0AgEEk4k0ld83kxt3OzWt0RTnM femdTnVzpqYycVAfiWR1AfFoX9liBIlqkXlD1UaDVCy1OeWP3j45v1XPUnJogao+IlY+ lM/A== X-Gm-Message-State: AE9vXwNKx+mob8XPNqDiyZvfPdo2DLqJNvr9/zRjX5R843meW8JqwyDdDI2dKbxZBV6l7g== X-Received: by 10.200.33.183 with SMTP id 52mr33364463qty.128.1474343756955; Mon, 19 Sep 2016 20:55:56 -0700 (PDT) Received: from [192.168.0.11] ([187.60.94.34]) by smtp.googlemail.com with ESMTPSA id q68sm15005393qka.1.2016.09.19.20.55.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Sep 2016 20:55:56 -0700 (PDT) To: freebsd-ports@freebsd.org From: =?UTF-8?B?T3RhY8OtbGlv?= Subject: Patch to cmake detect OpenMP Message-ID: <029185d0-d810-247d-d0c5-cdd8bc4a53ac@bsd.com.br> Date: Tue, 20 Sep 2016 00:55:44 -0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 03:55:59 -0000 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 patch to cmake port. What you guys think about? Can I open a bug report with patch? []'s -Otacilio --- Modules/FindOpenMP.cmake.orig 2016-09-20 03:52:10 UTC +++ Modules/FindOpenMP.cmake @@ -134,8 +134,8 @@ if(CMAKE_C_COMPILER_LOADED) endif() foreach(FLAG IN LISTS OpenMP_C_FLAG_CANDIDATES) - set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") - set(CMAKE_REQUIRED_FLAGS "${FLAG}") + set(SAFE_CMAKE_REQUIRED_FLAGS "-I/usr/local/include -L/usr/local/lib -lm ${CMAKE_REQUIRED_FLAGS}") + set(CMAKE_REQUIRED_FLAGS "-I/usr/local/include -L/usr/local/lib -lm ${FLAG}") unset(OpenMP_FLAG_DETECTED CACHE) if(NOT CMAKE_REQUIRED_QUIET) message(STATUS "Try OpenMP C flag = [${FLAG}]") @@ -148,7 +148,7 @@ if(CMAKE_C_COMPILER_LOADED) endif() endforeach() - set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}" + set(OpenMP_C_FLAGS "-I/usr/local/include ${OpenMP_C_FLAGS_INTERNAL}" CACHE STRING "C compiler flags for OpenMP parallization") list(APPEND _OPENMP_REQUIRED_VARS OpenMP_C_FLAGS) @@ -170,8 +170,8 @@ if(CMAKE_CXX_COMPILER_LOADED) endif() foreach(FLAG IN LISTS OpenMP_CXX_FLAG_CANDIDATES) - set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") - set(CMAKE_REQUIRED_FLAGS "${FLAG}") + set(SAFE_CMAKE_REQUIRED_FLAGS "-I/usr/local/include -L/usr/local/lib ${CMAKE_REQUIRED_FLAGS}") + set(CMAKE_REQUIRED_FLAGS "-I/usr/local/include -L/usr/local/lib ${FLAG}") unset(OpenMP_FLAG_DETECTED CACHE) if(NOT CMAKE_REQUIRED_QUIET) message(STATUS "Try OpenMP CXX flag = [${FLAG}]") @@ -184,7 +184,7 @@ if(CMAKE_CXX_COMPILER_LOADED) endif() endforeach() - set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}" + set(OpenMP_CXX_FLAGS "-I/usr/local/include ${OpenMP_CXX_FLAGS_INTERNAL}" CACHE STRING "C++ compiler flags for OpenMP parallization") list(APPEND _OPENMP_REQUIRED_VARS OpenMP_CXX_FLAGS)