Skip site navigation (1)Skip section navigation (2)
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>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigD4E7CD31FFDFB764121CBF17
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

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.
>=20
> Yes, it is currently not supported.  I am not sure if there are serious=

> attempts to add it.
>=20
>=20
>> Using clang++ requisites the usage of the
>> new libc++ (CXXFLAGS+=3D -stdlib=3Dlibc++). But this fails with this e=
rror:
> ...
>> /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 =3D in.get(c);
>>                                     ^    ~~~~~~~~~
>=20
> This is a bug in FreeOCL.  The istream::get() function returns an
> istream reference, which can't be cast directly to bool.  However, ther=
e
> is a negation operator defined for istream, so the line can be changed
> to:
>=20
>                          const bool ok =3D !!in.get(c);
>=20
> I have attached a patch for the port as I have built it here with clang=
=2E
> I didn't add the dependency on atomic_ops yet, but it should be fairly
> trivial.
>=20
> 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 woul=
d
> 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 =3D (blocking_read =3D=3D 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 =3D 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 =3D CL_COMMAND_READ_IMAG=
E;
                                  ^
/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


--------------enigD4E7CD31FFDFB764121CBF17
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----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-----

--------------enigD4E7CD31FFDFB764121CBF17--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5048EB56.2070402>