From owner-freebsd-ports@FreeBSD.ORG Thu Sep 6 12:51:19 2012 Return-Path: Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 802AF1065670; Thu, 6 Sep 2012 12:51:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id D1BEE8FC14; Thu, 6 Sep 2012 12:51:18 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:f8a2:c245:f52d:c435] (unknown [IPv6:2001:7b8:3a7:0:f8a2:c245:f52d:c435]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 65D0C5C37; Thu, 6 Sep 2012 14:51:16 +0200 (CEST) Message-ID: <50489C47.4040101@FreeBSD.org> Date: Thu, 06 Sep 2012 14:51:19 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20120828 Thunderbird/16.0 MIME-Version: 1.0 To: "O. Hartmann" References: <5047659D.8000107@mail.zedat.fu-berlin.de> In-Reply-To: <5047659D.8000107@mail.zedat.fu-berlin.de> Content-Type: multipart/mixed; boundary="------------090904010800010802030106" Cc: "freebsd-performance@freebsd.org" , Ports FreeBSD Subject: Re: Help. Porting "FreeOCL" fails (atomic_ops.h missing, CLANG++ libc++ issues ...) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 12:51:19 -0000 This is a multi-part message in MIME format. --------------090904010800010802030106 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2012-09-05 16:45, O. Hartmann wrote: ... > Well, I tried LLVM/CLANG, but Cmake of the sources fairly fails many > checks especuially for OpenMP. Yes, it is currently not supported. I am not sure if there are serious attempts to add it. > Using clang++ requisites the usage of the > new libc++ (CXXFLAGS+= -stdlib=libc++). But this fails with this error: ... > /usr/ports/devel/freeocl/work/FreeOCL-0.3.6-Source/src/parser/parser.h:118:15: > error: no viable conversion from 'std::__1::basic_istream' to > 'const bool' > const bool ok = in.get(c); > ^ ~~~~~~~~~ This is a bug in FreeOCL. The istream::get() function returns an istream reference, which can't be cast directly to bool. However, there is a negation operator defined for istream, so the line can be changed to: const bool ok = !!in.get(c); I have attached a patch for the port as I have built it here with clang. I didn't add the dependency on atomic_ops yet, but it should be fairly trivial. Note I also needed a fix for Mk/bsd.cmake.mk, otherwise the required ${CPPFLAGS} would not be passed along to CMake, and then the build would still fail to find the atomic_ops headers in /usr/local/include. --------------090904010800010802030106 Content-Type: text/x-diff; name="clangports-devel-freeocl-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="clangports-devel-freeocl-1.diff" Index: Mk/bsd.cmake.mk =================================================================== --- Mk/bsd.cmake.mk (revision 303593) +++ Mk/bsd.cmake.mk (working copy) @@ -50,12 +50,12 @@ BUILD_DEPENDS+= ${CMAKE_BIN}:${CMAKE_PORT} CMAKE_ENV?= ${CONFIGURE_ENV} CMAKE_ARGS+= -DCMAKE_C_COMPILER:STRING="${CC}" \ -DCMAKE_CXX_COMPILER:STRING="${CXX}" \ - -DCMAKE_C_FLAGS:STRING="${CFLAGS}" \ - -DCMAKE_C_FLAGS_DEBUG:STRING="${CFLAGS}" \ - -DCMAKE_C_FLAGS_RELEASE:STRING="${CFLAGS}" \ - -DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS}" \ - -DCMAKE_CXX_FLAGS_DEBUG:STRING="${CXXFLAGS}" \ - -DCMAKE_CXX_FLAGS_RELEASE:STRING="${CXXFLAGS}" \ + -DCMAKE_C_FLAGS:STRING="${CPPFLAGS} ${CFLAGS}" \ + -DCMAKE_C_FLAGS_DEBUG:STRING="${CPPFLAGS} ${CFLAGS}" \ + -DCMAKE_C_FLAGS_RELEASE:STRING="${CPPFLAGS} ${CFLAGS}" \ + -DCMAKE_CXX_FLAGS:STRING="${CPPFLAGS} ${CXXFLAGS}" \ + -DCMAKE_CXX_FLAGS_DEBUG:STRING="${CPPFLAGS} ${CXXFLAGS}" \ + -DCMAKE_CXX_FLAGS_RELEASE:STRING="${CPPFLAGS} ${CXXFLAGS}" \ -DCMAKE_EXE_LINKER_FLAGS:STRING="${LDFLAGS}" \ -DCMAKE_MODULE_LINKER_FLAGS:STRING="${LDFLAGS}" \ -DCMAKE_SHARED_LINKER_FLAGS:STRING="${LDFLAGS}" \ Index: devel/freeocl/Makefile =================================================================== --- devel/freeocl/Makefile (revision 0) +++ devel/freeocl/Makefile (working copy) @@ -0,0 +1,22 @@ +PORTNAME= freeocl +PORTVERSION= 0.3.6 +CATEGORIES= devel + +MAINTAINER= ports@FreeBSD.org +COMMENT= FreeOCL - a free OpenCL implementation for CPU + +#MASTER_SITES= http://freeocl.googlecode.com/files/FreeOCL-0.3.6-src.tar.gz +MASTER_SITES= http://freeocl.googlecode.com/files/ +DISTNAME= FreeOCL-${PORTVERSION}-src + +WRKSRC= ${WRKDIR}/FreeOCL-${PORTVERSION}-Source + +USE_CMAKE= YES +CMAKE_BUILD_TYPE= Release + +#USE_GCC= 4.7+ + +CPPFLAGS+= -I${LOCALBASE}/include +CXXFLAGS+= -stdlib=libc++ + +.include Index: devel/freeocl/files/patch-src__parser__parser.h =================================================================== --- devel/freeocl/files/patch-src__parser__parser.h (revision 0) +++ devel/freeocl/files/patch-src__parser__parser.h (working copy) @@ -0,0 +1,11 @@ +--- src/parser/parser.h.orig 2012-09-02 19:00:41.000000000 +0200 ++++ src/parser/parser.h 2012-09-06 14:14:01.000000000 +0200 +@@ -115,7 +115,7 @@ namespace FreeOCL + inline std::istream &get(char &c) + { + c = 0; +- const bool ok = in.get(c); ++ const bool ok = !!in.get(c); + if (c == '\n') + ++line; + if (!current_line.empty() && *current_line.rbegin() == '\n') --------------090904010800010802030106--