Date: Thu, 06 Sep 2012 21:19:15 +0200 From: Dimitry Andric <dim@FreeBSD.org> To: "O. Hartmann" <ohartman@zedat.fu-berlin.de> Cc: "freebsd-performance@freebsd.org" <freebsd-performance@freebsd.org>, Ports FreeBSD <freebsd-ports@FreeBSD.org> Subject: Re: Help. Porting "FreeOCL" fails (atomic_ops.h missing, CLANG++ libc++ issues ...) Message-ID: <5048F733.3090301@FreeBSD.org> In-Reply-To: <5048EB56.2070402@zedat.fu-berlin.de> References: <5047659D.8000107@mail.zedat.fu-berlin.de> <50489C47.4040101@FreeBSD.org> <5048EB56.2070402@zedat.fu-berlin.de>
index | next in thread | previous in thread | raw e-mail
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. :)
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5048F733.3090301>
