Help. Porting "FreeOCL" fails (atomic_ops.h missing, CLANG++ libc++ issues ...)

Dimitry Andric dim at FreeBSD.org
Thu Sep 6 12:51:19 UTC 2012


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clangports-devel-freeocl-1.diff
Type: text/x-diff
Size: 2562 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-performance/attachments/20120906/46cd0c96/clangports-devel-freeocl-1.bin


More information about the freebsd-performance mailing list