Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Sep 2012 13:14:50 +0200
From:      "O. Hartmann" <ohartman@mail.zedat.fu-berlin.de>
To:        Matthieu Volat <mazhe@alkumuna.eu>
Cc:        "freebsd >> Current FreeBSD" <freebsd-current@freebsd.org>, freebsd-ports@freebsd.org
Subject:   Re: Help. Porting "FreeOCL" fails (atomic_ops.h missing, CLANG++ libc++ issues ...)
Message-ID:  <504885AA.1000300@mail.zedat.fu-berlin.de>
In-Reply-To: <20120906121639.4b7d894d089b2ddeb42f31b4@alkumuna.eu>
References:  <5047659D.8000107@mail.zedat.fu-berlin.de> <20120906121639.4b7d894d089b2ddeb42f31b4@alkumuna.eu>

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

On 09/06/12 12:16, Matthieu Volat wrote:
> On Wed, 05 Sep 2012 16:45:49 +0200
> "O. Hartmann" <ohartman@mail.zedat.fu-berlin.de> wrote:
>=20
>> Hello.
>>
>> FreeBSD has fallen back far behind the standards of modern scientific
>> computing and I dsperately look for solutions having OpenCL support on=

>> FreeBSD anyway.
>>
>> I stumbled into this project recently:
>>
>> FreeOCL at
>> http://code.google.com/p/freeocl/
>>
>> or the sources located at
>>
>> http://code.google.com/p/freeocl/downloads/detail?name=3DFreeOCL-0.3.6=
-src.tar.gz&can=3D2&q=3D
>>
>> For your convenience, please find my naive attempt of a port attached =
to
>> this email.
>>
>> Well, I tried LLVM/CLANG, but Cmake of the sources fairly fails many
>> checks especuially for OpenMP. Using clang++ requisites the usage of t=
he
>> new libc++ (CXXFLAGS+=3D -stdlib=3Dlibc++). But this fails with this e=
rror:
>>
>>
>> [...]
>> [ 17%] Building CXX object src/CMakeFiles/FreeOCL.dir/codebuilder.cpp.=
o
>> In file included from
>> /usr/ports/devel/freeocl/work/FreeOCL-0.3.6-Source/src/codebuilder.cpp=
:26:
>> /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);
>>                                    ^    ~~~~~~~~~
>> /usr/ports/devel/freeocl/work/FreeOCL-0.3.6-Source/src/codebuilder.cpp=
:444:13:
>> warning: 70 enumeration values not handled in switch: 'VOID', 'BOOL',
>> 'HALF'... [-Wswitch]
>>                                         switch(native->get_type_id())
>>                                                ^
>> 1 warning and 1 error generated.
>> *** [src/CMakeFiles/FreeOCL.dir/codebuilder.cpp.o] Error code 1
>> [..]
>>
>>
>> I tried also setting USE_GCC=3D 4.7+ using gcc-4.7 I installed, but th=
at
>> fails with
>>
>> [...]
>> -- Build files have been written to:
>> /usr/ports/devel/freeocl/work/FreeOCL-0.3.6-Source
>> =3D=3D=3D>  Building for freeocl-0.3.6
>> Scanning dependencies of target FreeOCL
>> [  1%] Building CXX object src/CMakeFiles/FreeOCL.dir/freeocl.cpp.o
>> In file included from
>> /usr/ports/devel/freeocl/work/FreeOCL-0.3.6-Source/src/freeocl.cpp:18:=
0:
>> /usr/ports/devel/freeocl/work/FreeOCL-0.3.6-Source/src/freeocl.h:71:2:=

>> error: 'u_int64_t' does not name a type
>> *** [src/CMakeFiles/FreeOCL.dir/freeocl.cpp.o] Error code 1
>> [...]
>>
>> I think patches are required.
>>
>> More disturbing is the use of gcc-4.6 via
>>
>> USE_GCC=3D 4.6+
>>
>> The error is then a compalin about a missing include file
>>
>> atomic_ops.h
>>
>> which is located in the abandoned KSE facility of the kernel, so the
>> includes seem not to be installed anymore - but since I'm not involved=

>> in the development, I can only guess and ask the people here.
>>
>> Maybe some experienced freeBSD developers with the same need for OpenC=
l
>> is willing to pick up this and help a bit.
>>
>> Well, as far as I see, the FreeOCL project of Roland Borchard is a
>> OpenCL library for CPU usage. As far as I can understand, if we on
>> FreeBSd could have a library "libOpenCL" as this is usually installed =
by
>> the nVidia BLOB drivers on Linux for the use of OpenCL/GPGPU support
>> with their GPUs, this would fill a still painfull open gap in FreeBSD =
as
>> a scientific development platform.
>>
>> There is still no suitable compiler for OpenCL out here for freeBSD, b=
ut
>> I have still the hope that LLVM can provide such a thing in the near f=
uture.
>>
>> I cross post this posting also to "performance" in the hope finding so=
me
>> people attracted and "lurd" into this subject.
>>
>> Regards,
>>
>> O. Hartmann
>=20
> Hello,
>=20
> I've taken a quick look in that implementation : it seems to depends on=
 devel/libatomic_ops even if the devs did not write any CMake checks for =
that (grrr).
>=20
> After installing it, I was able to build the port with gcc-46 without p=
roblems, if I find some time, I will try to test it later.
>=20
> Btw, did you had a look to poCL too (http://sourceforge.net/apps/mediaw=
iki/pocl/index.php?title=3DMain_Page)? I know the Debian people were cons=
idering it for a base implementation, but I'm a bit clueless about all th=
ose foss versions coming. A comparison could be helpful ^^
>=20

I tried to add

RUN_DEPENDS=3D
${LOCALBASE}/lib/libatomic_ops.a:${PORTSDIR}/devel/libatomic_ops

to my provided Makefile, but this doesn't install the port
devel/libatomic_ops.
This is weird and inconsistent. I follow exact the steps suggested in
the Porter's handbook, the _DEPENDS=3D section. The above RUN_DEPENDS=3D =
tag
should ensure a check for the existence of the static library

/usr/local/lib/libatomic_ops.a

and if not existent, then install it. It doesn't work. Unfortunately,
LIB_DEPENDS is considered for "shared libraries", so it isn't suitable.
But LIB_DEPENDS get recognized, even if it fails, while RUN_DEPENDS
seems not to be touched by the build process anyway ...



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

iQEcBAEBAgAGBQJQSIWvAAoJEOgBcD7A/5N8r90H/3kWR9sJ+qQ7mGRhUuehDjJS
gtpIxE441nJeS/vCj45Pf+1ZyD8QSkGt7VYn0VI3BVBGIe54FY5Wblri3NZ6+BK2
YAofAxLZY2nvI52Gb6CBrJ2WiHAGZ+FTHgcFJrGk8LBzyHMfEpzhhf2nk/z97K46
kUUAOTR5Vex1XGjrbjAQ3JbOvPhdQlcWgL2UtCeZ34S42Cw9J0nQU3MoitcCZOc2
HLpTXoUxhOuTaWRUzjW3BySLyiq/mdd/sOHNBvmpcj0ffFASpCbnyCjwsvfxgbsc
U5s37+hFnIg2CJ7/zAgTPYW8BaiHyyOWs4gHODyXulFSRTw9UhROa6KVgadLB28=
=yMvA
-----END PGP SIGNATURE-----

--------------enig36C883B3731B9F0E75AEB96A--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?504885AA.1000300>