Date: Mon, 24 Dec 2012 22:32:35 +0100 From: "O. Hartmann" <ohartman@zedat.fu-berlin.de> To: Dimitry Andric <dim@FreeBSD.org> Cc: Ports FreeBSD <freebsd-ports@freebsd.org> Subject: Re: clang/llvm: /usr/local/include in port base system not standard? (port devel/freeocl) Message-ID: <50D8C9F3.7020308@zedat.fu-berlin.de> In-Reply-To: <50D8BC7F.2070207@FreeBSD.org> References: <50D88C9C.6030308@zedat.fu-berlin.de> <50D8BC7F.2070207@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) --------------enig4B2639F42E5F5AA19D02F5D6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Am 12/24/12 21:35, schrieb Dimitry Andric: > On 2012-12-24 18:10, O. Hartmann wrote: >> Some ports (devel/freeocl for instance) won't compile easily with CLAN= G. >> I fugured out that sometimes CLANG is not by default including >> /usr/local/include into the CPP search path - obviously gcc/gcc46 does= ! >=20 > Eh, that is incorrect. The version of gcc in base does *not* have > /usr/local/include in its default include path, and our version of clan= g > in base mimics that behaviour. I know this has been a point of much > discussion, but I don't want to repeat any of it here; just stating the= > facts. Not necessary to repeat, I think I can believe your words. Thank you very much. >=20 > I don't know precisely what the port versions of gcc and clang do, > however. It is a Linuxism to always have /usr/local/include in the > default path, so it may well be that the port versions do this too. >=20 >=20 >> Well, I feel a bit confused, since I do not know how to manage the >> intransparent port framework (intransparent to me) to force the port's= >> Makefile to include via "-I/usr/local/include" the path in question. >=20 > Like it is done in most ports, try adding: >=20 > CPPFLAGS+=3D -I${LOCALBASE}/include > LDFLAGS+=3D -L${LOCALBASE}/lib I already did this. And it didn't work for me. >=20 >=20 >> By the way, the build backend is cmake which I'm completely unfamiliar= >> with. Can someone give a hint? >=20 > CMake has its own logic for searching headers, but I am not sure what > the correct solution is for your specific project. Well, it is the devel/freeocl project. I used the tag USE_GCC=3D4.6+ in the Makefile and realised that with gcc47 it will not compile anymore, so using simply USE_GCC=3D4.6+ seems dangerous and incorrect to = me. I then tried to compile the FreeOCL library with CLANG 3.1 and 3.2. CLANG fails in src/parser/parser.h, line 118. The righthand value needs to be casted to (bool), otherwise CLANG complains and spite fire ... In src/utils/threadpool.cpp, the #include <atomic_ops.h> fails, since it is located in /usr/local/include. By brute-force I set it to the absolute path </usr/local/inlcude/atomic_ops.h>. Then it compiles with CLANG. The port also requires having set CXXFLAGS+=3D -stdlib=3Dlibc++, otherwis= e there is another issue with a header located in tr1 and not found by CLANG by default. If someone do not necessarily need OpenMP, then the port can be compiled with the changes on both FreeBSD 9.1 and 10.0. On 9.1 the new LIBCPLUSPLUS option needs to be available - I do not nknow how to handle this cleanly. Well, I will look for the Cmake thing, it might be possible to solve the problem in a clean way, so I can provide an update for the port devel/freeocl. --------------enig4B2639F42E5F5AA19D02F5D6 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) iQEcBAEBAgAGBQJQ2Mn6AAoJEOgBcD7A/5N890QH/0uODx+jVOcCpDLeoBpiaseq 9VWCWK4EvScgGZZcB7zvfzqSz0CoaGaBmDn0PjG+YltOO7ykvbr6hbQAyJutcLjw j7lvyWjK5RWfNef+x2cZ4r/by1gZfNFTfr6DlL2jkMjPANNcRlYIz/gDfCnrrfm/ IyK2yfrGozojLfjzQswcx6RGfD4idyQRd1RkFnfMbBdUiitfAmSEcS2pJnzeX4iF RFWZdGVseaLoqUvDkeiu8+RgftpghdxQg3yiB+6wr9zscPuAa4NtFcTRF3fouvx3 ttlA0DXI0QEPBZQyzeUUwJmGQ3doxeJu3U8iVLjUVK4m4bTpJhq5pdJBqcqlc1g= =VSIK -----END PGP SIGNATURE----- --------------enig4B2639F42E5F5AA19D02F5D6--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50D8C9F3.7020308>