From owner-freebsd-performance@FreeBSD.ORG Thu Sep 6 19:19:15 2012 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 892BC1065672; Thu, 6 Sep 2012 19:19:15 +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 41BCF8FC15; Thu, 6 Sep 2012 19:19:15 +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 D88F55C37; Thu, 6 Sep 2012 21:19:13 +0200 (CEST) Message-ID: <5048F733.3090301@FreeBSD.org> Date: Thu, 06 Sep 2012 21:19:15 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20120905 Thunderbird/16.0 MIME-Version: 1.0 To: "O. Hartmann" References: <5047659D.8000107@mail.zedat.fu-berlin.de> <50489C47.4040101@FreeBSD.org> <5048EB56.2070402@zedat.fu-berlin.de> In-Reply-To: <5048EB56.2070402@zedat.fu-berlin.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Thu, 06 Sep 2012 19:27:26 +0000 Cc: "freebsd-performance@freebsd.org" , Ports FreeBSD Subject: Re: Help. Porting "FreeOCL" fails (atomic_ops.h missing, CLANG++ libc++ issues ...) X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 19:19:15 -0000 On 2012-09-06 20:28, O. Hartmann wrote: ... > With the patch for Mk/bsd.cmake.mk attached, I can not compile the port > with CLANG, compilation results in > > [ 15%] Building CXX object src/CMakeFiles/FreeOCL.dir/image.cpp.o > /usr/ports/devel/freeocl/work/FreeOCL-0.3.6-Source/src/image.cpp:442:27: > error: member access into incomplete type 'struct _cl_event' > if (event_wait_list[i]->status < 0) > ^ > /usr/local/include/CL/cl.h:46:16: note: forward declaration of '_cl_event' > typedef struct _cl_event * cl_event; > ^ Which package installed that /usr/local/include/CL/cl.h file? It looks like it should take this header from the source package, not from whatever is installed into /usr/local. In the top-level CMakeLists.txt, there is this fragment: include_directories(.) include_directories(include) include_directories(src) which indicates to CMake it should add -I flags for each of those directories. However, it seems -I/usr/local/include is placed earlier in the arguments of the actual clang++ invocations: /usr/bin/clang++ -DFreeOCL_EXPORTS -O2 -pipe -I/usr/local/include -fno-strict-aliasing -I/usr/local/include -stdlib=libc++ -std=c++0x -DFREEOCL_USE_CXX0X -DFREEOCL_ARCH_amd64 -O3 -ffast-math -fPIC -I/usr/work/share/dim/ports/devel/freeocl/work/FreeOCL-0.3.6-Source/. -I/usr/work/share/dim/ports/devel/freeocl/work/FreeOCL-0.3.6-Source/include -I/usr/work/share/dim/ports/devel/freeocl/work/FreeOCL-0.3.6-Source/src -o CMakeFiles/FreeOCL.dir/image.cpp.o -c /usr/work/share/dim/ports/devel/freeocl/work/FreeOCL-0.3.6-Source/src/image.cpp So it will take /usr/local/include/CL/cl.h before the cl.h under ${WRKSRC}. Now, as to how we can convince CMake to put the -I/usr/local/include at the end... Maybe we should just patch the CMakeLists.txt, but that is a rather ugly solution. :)