www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Raspberry PI needs some love

reply Jonas Minnberg <sasq64 gmail.com> writes:
I am currently using D on my Raspberry PI, but two things that 
makes it harder are;

1. There is no way to detect that I am running on the PI. This is 
needed in my case to use the special OpenGL ES version on that 
machine.

2. Profiling does not seem to work. You can build a profiling 
build but it does not output any trace.log.

Anyone know how to work around these issues or even dig into why, 
that would be great.

-- Jonas Minnberg
Aug 12
parent WebFreak001 <d.forum webfreak.org> writes:
On Saturday, 12 August 2017 at 11:43:32 UTC, Jonas Minnberg wrote:
 I am currently using D on my Raspberry PI, but two things that 
 makes it harder are;

 1. There is no way to detect that I am running on the PI. This 
 is needed in my case to use the special OpenGL ES version on 
 that machine.

 2. Profiling does not seem to work. You can build a profiling 
 build but it does not output any trace.log.

 Anyone know how to work around these issues or even dig into 
 why, that would be great.

 -- Jonas Minnberg
1. compile time: version(ARM) (while not exactly only PI, it will be enough to differentiate between PC and Pi), if you really want to be sure you can read /proc/cpuinfo at runtime or before the build and check if the string BCM2708 is in there (raspberry pi 1) or BCM2709 (raspberry pi 2/3) 2. Thats a bug if the exact same code & command outputs profiling on PC. I suppose you are using LDC? You should search if there is a issue and post an issue with code & commands you can use to test it otherwise. https://raspberrypi.stackexchange.com/questions/754/how-can-i-detect-that-im-compiling-for-raspberry-pi
Aug 12