Date: Thu, 06 Sep 2012 20:28:38 +0200 From: "O. Hartmann" <ohartman@zedat.fu-berlin.de> To: Dimitry Andric <dim@FreeBSD.org> Cc: "O. Hartmann" <ohartman@mail.zedat.fu-berlin.de>, "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: <5048EB56.2070402@zedat.fu-berlin.de> In-Reply-To: <50489C47.4040101@FreeBSD.org> References: <5047659D.8000107@mail.zedat.fu-berlin.de> <50489C47.4040101@FreeBSD.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On 09/06/12 14:51, Dimitry Andric wrote:
> 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<char>' 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.
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;
^
/usr/ports/devel/freeocl/work/FreeOCL-0.3.6-Source/src/image.cpp:449:58:
error: allocation of incomplete type '_cl_event'
cmd->event = (blocking_read == CL_TRUE || event) ? new
_cl_event(command_queue->context) : NULL;
^~~~~~~~~
/usr/local/include/CL/cl.h:46:16: note: forward declaration of '_cl_event'
typedef struct _cl_event * cl_event;
^
/usr/ports/devel/freeocl/work/FreeOCL-0.3.6-Source/src/image.cpp:463:14:
error: member access into incomplete type '_cl_event'
cmd->event->command_queue = command_queue;
^
/usr/local/include/CL/cl.h:46:16: note: forward declaration of '_cl_event'
typedef struct _cl_event * cl_event;
^
/usr/ports/devel/freeocl/work/FreeOCL-0.3.6-Source/src/image.cpp:464:14:
error: member access into incomplete type '_cl_event'
cmd->event->command_type = CL_COMMAND_READ_IMAGE;
^
/usr/local/include/CL/cl.h:46:16: note: forward declaration of '_cl_event'
typedef struct _cl_event * cl_event;
Without the patch, CLANG++ doesn't find the atomic_ops.h header as you
wrote.
Oliver
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)
iQEcBAEBAgAGBQJQSOtbAAoJEOgBcD7A/5N8GYMIAMcRzFu0/Mc8a1Jke+tO6gT4
QsPTDGUPJo+K8irt/tPXtMnV6jwYGpgSVlOt4QehZiwV822Y9IepXTT4snl2lVcc
OhjfWnLhiljTJF9fSlw6j4/4PP4L82oPXfGJKMhb4mv6XF7v2ySIk1qVvaTtXZSM
Rg4ToiYeD4/5xNf6GDTTU2cRWFDwV2g551jf9htH/WqJPYq51WjJ7BIeaklEmqds
rMg0l+e33jSBY9/qNdVVZrUlrS47QvLMBkc69TttwxGIAOAX13YdBSNuGdhB/yDo
/IpVbToGewqDKk7EAIbq1nWQUQ1drtzbkoLmpC+T3NvLwRPJf+4V3SG+SklWo3w=
=ixdR
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5048EB56.2070402>
