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

Dimitry Andric <[email protected]>
Newsgroups gmane.os.freebsd.devel.ports,gmane.os.freebsd.performance
Organization The FreeBSD Project
Message-ID <[email protected]>
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. :)
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.