Discussion:
GDC & Pandaboard/QEMU & Framebuffer
John A via Digitalmars-d
2014-10-06 04:39:01 UTC
Permalink
Not sure where to post this; it's not a question, just some info.

I have created a set of pages here:

http://arrizza.org/wiki/index.php/Dlang

with instructions which include:
- how to create a GDC cross-compiler using crosstool-ng
- how to create some sample applications to test out GDC
- how to create a sample app that writes to the framebuffer via
GDC
- how to set up and run these apps on QEMU
- how to run the same apps on a Pandaboard

There is nothing new here. Others have written it already, some
of which worked as advertised for me, some didn't. I've just
gathered it up, tried it out and wrote down very specific
instructions about what I needed to do to get it to work.
Hopefully it works well for you.

Note I use Ubuntu 12.04 for everything, so these pages won't help
Windows folks.

John
Joakim via Digitalmars-d
2014-10-06 10:11:10 UTC
Permalink
Post by John A via Digitalmars-d
Not sure where to post this; it's not a question, just some
info.
http://arrizza.org/wiki/index.php/Dlang
- how to create a GDC cross-compiler using crosstool-ng
- how to create some sample applications to test out GDC
- how to create a sample app that writes to the framebuffer
via GDC
- how to set up and run these apps on QEMU
- how to run the same apps on a Pandaboard
There is nothing new here. Others have written it already, some
of which worked as advertised for me, some didn't. I've just
gathered it up, tried it out and wrote down very specific
instructions about what I needed to do to get it to work.
Hopefully it works well for you.
Note I use Ubuntu 12.04 for everything, so these pages won't
help Windows folks.
John
Nice, I have ldc working at pretty much the same level on
linux/arm, tested on a Cubieboard2. Have you tried running any
of the druntime/phobos unit tests? All but two modules of
druntime, as of the dmd 2.066 release, pass for me, while only
three modules pass from phobos. I'll put up instructions for
cross-compiling with ldc once I have more of it working, as
cross-compiling with ldc is easier.
John A via Digitalmars-d
2014-10-11 05:27:07 UTC
Permalink
Post by Joakim via Digitalmars-d
Nice, I have ldc working at pretty much the same level on
linux/arm, tested on a Cubieboard2. Have you tried running any
of the druntime/phobos unit tests?
No, it's on my todo list.

One thing I'll do first is see if I can modify Derelict3 to be
Phobos free. If so the opengl3 library will probably be more
useful to me. There might even be a mid-point where only a
portion of Phobos needs porting.
Post by Joakim via Digitalmars-d
All but two modules of druntime, as of the dmd 2.066 release,
pass for me, while only three modules pass from phobos. I'll
put up instructions for cross-compiling with ldc once I have
more of it working, as cross-compiling with ldc is easier.
Cool. All useful work in the end...
Mike Parker via Digitalmars-d
2014-10-11 07:32:31 UTC
Permalink
One thing I'll do first is see if I can modify Derelict3 to be Phobos
free. If so the opengl3 library will probably be more useful to me.
There might even be a mid-point where only a portion of Phobos needs
porting.
I would recommended using the packages from DerelictOrg [1] rather than
Derelict 3, as the latter is no longer maintained.


[1] https://github.com/DerelictOrg

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
John A via Digitalmars-d
2014-10-12 11:08:47 UTC
Permalink
Post by Mike Parker via Digitalmars-d
I would recommended using the packages from DerelictOrg [1]
rather than Derelict 3, as the latter is no longer maintained.
I did get Derelict3 to compile. I had to use a Makefile instead
of dub but all the files compiled cleanly with no warnings. I did
not add any unit tests as of yet, so I don't know if anything
runs.

I took your recommendation and cloned from DerelictOrg. It failed
to compile in a couple of files: arb.d and ext.d. All the
failures were due to the same error, e.g.:

source/derelict/opengl3/arb.d:933: error: user defined attributes
cannot appear as postfixes

The original line in Derelict3 is:
private __gshared bool _ARB_depth_buffer_float;
bool ARB_depth_buffer_float() @property { return
_ARB_depth_buffer_float; }

The line in DerelictOrg is:
private __gshared bool _ARB_depth_buffer_float;
bool ARB_depth_buffer_float() @nogc nothrow @property { return
_ARB_depth_buffer_float; }
Mike Parker via Digitalmars-d
2014-10-12 12:45:21 UTC
Permalink
I took your recommendation and cloned from DerelictOrg. It failed to
compile in a couple of files: arb.d and ext.d. All the failures were due
source/derelict/opengl3/arb.d:933: error: user defined attributes cannot
appear as postfixes
private __gshared bool _ARB_depth_buffer_float;
_ARB_depth_buffer_float; }
private __gshared bool _ARB_depth_buffer_float;
_ARB_depth_buffer_float; }
That means you're using an older version of the D frontend and I didn't
take that into account when I added @nogc to the extension modules. A
bugfix release is imminent.

For the curious, to get backward-compatible nogc support into Derelict,
I've implemented it as a UDA for versions less than 2.066 of the D
frontend (see derelict.util.system). Until recently, it compiled fine on
pre-2.066, but when I applied it to the property functions in the
extension modules, I had no idea that UDAs could not be postfixes and
that it would break on pre-2.066.

I'm curious about the rationale behind allowing built-in attributes as
postfixes but not UDAs. I'll see if it's in the docs, but if not, I'd
like to know what it is. On the surface, it seems unintuitive to
distinguish between the two.

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
Mike Parker via Digitalmars-d
2014-10-12 12:57:36 UTC
Permalink
I took your recommendation and cloned from DerelictOrg. It failed to
compile in a couple of files: arb.d and ext.d. All the failures were due
source/derelict/opengl3/arb.d:933: error: user defined attributes cannot
appear as postfixes
private __gshared bool _ARB_depth_buffer_float;
_ARB_depth_buffer_float; }
private __gshared bool _ARB_depth_buffer_float;
_ARB_depth_buffer_float; }
Fixed in master. Tag 1.0.10 for those using DUB.


---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
John A via Digitalmars-d
2014-10-12 15:04:29 UTC
Permalink
Post by Mike Parker via Digitalmars-d
Fixed in master. Tag 1.0.10 for those using DUB.
Just did a git pull and recompile. It built clean. Mike thanks
for the very quick response!

Next step for me, is to create a small opengl test app:
- does it cross-compile (on Ubunutu)?
- does it run in QEMU?
- does it run on a Pandaboard?

After that, I'll try the derelict gflw and see how that goes...


John

Iain Buclaw via Digitalmars-d
2014-10-11 05:35:50 UTC
Permalink
On 6 Oct 2014 11:15, "Joakim via Digitalmars-d" <digitalmars-d at puremagic.com>
Post by John A via Digitalmars-d
Not sure where to post this; it's not a question, just some info.
http://arrizza.org/wiki/index.php/Dlang
- how to create a GDC cross-compiler using crosstool-ng
- how to create some sample applications to test out GDC
- how to create a sample app that writes to the framebuffer via GDC
- how to set up and run these apps on QEMU
- how to run the same apps on a Pandaboard
There is nothing new here. Others have written it already, some of which
worked as advertised for me, some didn't. I've just gathered it up, tried
it out and wrote down very specific instructions about what I needed to do
to get it to work. Hopefully it works well for you.
Post by John A via Digitalmars-d
Note I use Ubuntu 12.04 for everything, so these pages won't help
Windows folks.
Post by John A via Digitalmars-d
John
Nice, I have ldc working at pretty much the same level on linux/arm,
tested on a Cubieboard2. Have you tried running any of the druntime/phobos
unit tests? All but two modules of druntime, as of the dmd 2.066 release,
pass for me, while only three modules pass from phobos. I'll put up
instructions for cross-compiling with ldc once I have more of it working,
as cross-compiling with ldc is easier.

At the last time I tested, all unittests and testsuite had been passing on
ARM. There were a number of forward ported tests. And a few disabled (ie:
evaluation order of array operations differ between x86 and every other
architecture).

Iain.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141011/f73984cd/attachment.html>
John A via Digitalmars-d
2014-10-12 11:42:07 UTC
Permalink
Post by Iain Buclaw via Digitalmars-d
At the last time I tested, all unittests and testsuite had been
passing on ARM.
Very nice. I'd like to replicate what you did. I haven't looked
at Phobos at all yet, I'm working on getting opengl up and going
first.

Any chance you can post instructions on exactly how you did that?
Or point me to a url with those instructions? That would be
fantastic!

Example of some things I think are relevant:
- I'm assuming gdc or did you use ldc instead? Which version of
gdc+gcc?
- Was Phobos cross-compiled or did you compile on the devkit
itself?
- If cross-compiled, for which ARM architecture (cortex a8, a9,
M3, other)?
- What was the Host environment and it's configuration (linux vs
Win)? If Linux, which version and did you have to install
additional packages?
- Which repository and revision of Phobos did you use?
- Did you make any changes to the Phobos source to get it to
compile?
- What were the exact command lines you used to compile Phobos?
Can you supply a Makefile?
- What environment and configuration did you use to run the tests
(Bare-metal, linux, qemu, etc.)? If not qemu, which devkit/board
did you use (beagleboard, pandaboard, Raspberry PI, etc.)?
- What was the OS and configuration of the devkit?
- Did you have to update or install any additional libraries (.a
or .so) onto the board?

Thanks in advance!
John
Loading...