Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-08

Compliments

14 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alfred

Hello to all,

I do not know if this is the right place, but I would like to express my gratitude and respect for the Lazarus and FPC developers and all other contributing volunteers.
Main reason for this message is the fact that my GUI / mORMot data collection systems run flawless 24/7 for many months/years now on various RPi , BBB and Odroid-C2 !! And that latest FPC trunk has so many very useful added features.
It is so nice to be able to develop and debug on Windows, followed by an easy cross-compile towards ARM V6/V7 and aarch64.
I do not know of any other development environment that is able to do so with such an ease.

So, thanks again to you all !
With respect, Alfred.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160806/3a8ea26a/attachment.html>

Reply by email

Bo Berglund
to Alfred: I do not know if this is the right place, but I would like to express my gratitude and…
Alfred wrote
It is so nice to be able to develop and debug on Windows, followed by an easy cross-compile towards ARM V6/V7 and aarch64.

I would be interested in knowing how this is done. I use FPC/Lazarus on an RPi3 as development platform via TightVNC to be able to do it on my Win7 PC. It has flaws in the editor keyboard area so I have installed FPC/Lazarus also on the Win7 machine to write the code, but for testing I have copied over the sources to RPi and built it there. Tedious...

In other cases where I use only generic non-Pi stuff like Indy and such I have moved the entire project to Windows and can both build and execute the programs there, then copy sources over to the RPi and build there, doable but maybe overkill if the build could be done on Windows.

So can I use RPi specific stuff in my programs (like GPIO access) and still develop on Windows, compile the binary and just transfer that to the RPi to run it there?

It would be marvellous if it could be done.

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to alfred: Here you go: http://synopse.info/forum/viewtopic.php?pid=21005#p21005 Hope it works for…
alfred wrote 5 lines
Here you go: http://synopse.info/forum/viewtopic.php?pid=21005#p21005 Hope it works for you as it does for me !

Trying to find a way to install into D:\Devel\NewPascal or similar instead of the mandatory C:\NewPascal...

Not keen on putting stuff on C:\ which rightfully instead should be on the data drive. Or at least in C:\Programs where all of my other development tools live.

Bo Berglund Developer in Sweden

Reply by email

Unknown author
to Bo Berglund
Bo Berglund wrote 14 lines
On Sat, 06 Aug 2016 17:19:01 +0200, alfred wrote: > Here you go: > > http://synopse.info/forum/viewtopic.php?pid=21005#p21005 > > Hope it works for you as it does for me ! Trying to find a way to install into D:\Devel\NewPascal or similar instead of the mandatory C:\NewPascal... Not keen on putting stuff on C:\ which rightfully instead should be on the data drive. Or at least in C:\Programs where all of my other development tools live.

i thought he was just talking about using FPCUP to get and set up everything for cross-platform compiling... the message alfred pointed to contains a link to https://github.com/LongDirtyAnimAlf/fpctrunkrtti/releases which i didn't fully read until just now... due to that forum visually shortening URLs and knowing that LongDirtyAnimAlf is handling FPCUP now, i only saw the part up to "fpc" and assumed it was pointing to fpcup...

maybe some clarification is necessary as to what, exactly, alfred was pointing to??

NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list* unless private contact is specifically requested and granted.

Reply by email

Dennis
to alfred: Here you go: http://synopse.info/forum/viewtopic.php?pid=21005#p21005 Hope it works for…
alfred wrote 7 lines
Here you go: http://synopse.info/forum/viewtopic.php?pid=21005#p21005 Hope it works for you as it does for me !

Alfred,
I followed this link which points me to
https://github.com/LongDirtyAnimAlf/fpc … i/releases <https://github.com/LongDirtyAnimAlf/fpctrunkrtti/releases> which in turn, told me to download
https://github.com/LongDirtyAnimAlf/fpctrunkrtti/releases/download/1/FPCLazBaseWin32.rar and
https://github.com/LongDirtyAnimAlf/fpctrunkrtti/releases/download/1/CrossFPCAndroidARM.rar

I did and install Lazarus and fpc under c:\NewPascal.

Compiling some example projects to win32 worked but when I change the Project Options-> Config and target
Target OS(-T) to linux
Target CPU family (-P) to arm
Target processor (-Cp) to (default)

for the few projects I tried, all had "Error: Error while linking".

No more details of the error is given.

please help.

I want to cross compile from win32 to raspbian on raspberry Pi 3. p.s. I am running the IDE on windows 10 (64 bit)

Dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160809/72dfce80/attachment.html>

Reply by email

Dennis
to Alfred
Alfred wrote
@Dennis: You have downloaded the setup for Android ARM. But you are compiling for Linux ARM. https://github.com/LongDirtyAnimAlf/fpctrunkrtti/releases/download/1/CrossFPCLinuxARM.rar

My mistake. I pasted the wrong link. I actually downloaded the correct LinuxARM.rar and got that error :-(

Dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160809/bda936fb/attachment.html>

Reply by email

Alfred
to Dennis: I followed this link which points me to https://github.com/LongDirtyAnimAlf/fpc ……

@Dennis

I am sorry, but I cannot reproduce your problem.
I did a fresh install, and all (including cross) runs out-of-the-box !

However, do you know that you do have to add the following into your lpr-file ?

program MyCrossProg;
{$mode objfpc}{$H+}
{$ifdef Linux}
   {$ifdef FPC_CROSSCOMPILING}
   {$ifdef CPUARM}
     {$linklib GLESv2}
   {$endif}
   {$linklib libc_nonshared.a}
   {$endif}
{$endif}

uses
........

Reply by email

Dennis
to Alfred
Alfred wrote 24 lines
@Dennis I am sorry, but I cannot reproduce your problem. I did a fresh install, and all (including cross) runs out-of-the-box ! However, do you know that you do have to add the following into your lpr-file ? program MyCrossProg; {$mode objfpc}{$H+} {$ifdef Linux} {$ifdef FPC_CROSSCOMPILING} {$ifdef CPUARM} {$linklib GLESv2} {$endif} {$linklib libc_nonshared.a} {$endif} {$endif} uses ........

Thank you so much. After I added the above, cross linking now works and the executable can run on Pi.
By the way, I could not find the above in the git or in any readme file in the rar files. It would be easier for laymen like me to have that instruction in a crosscompile.readme file.

If I want to cross compile to another platform like Linux64, what should the "defines" be like?

What does {$linklib GLESv2} mean?
Does it exists on ubuntu for odroid? It is because the same executable can run on raspbian+Pi but when run on ubuntu+Odroid, it reported "bash: ./hello Permission denied".
I already login as root and chmod +x hello
but still get the permission denied error.

In the past, when I compile an ARM execuatable on odroid, i can run it on both ubuntu+odroid or raspbian+Pi. Is it because of the GLESv2?

Many thanks.
Dennis

Reply by email

Alfred

@Dennis.

That is good news !

But, to be honest, I do not know the exact answer to your other questions.

******************************
{$ifdef Linux}
{$ifdef FPC_CROSSCOMPILING}
{$ifdef CPUARM}
{$linklib GLESv2}
{$endif}
{$linklib libc_nonshared.a}
{$endif}
{$endif}
******************************
These link-additions are based on trail-and error.
Using an Arch Linux distro on RPi, BBB and Odroid-C2 (64bit).
It could be that they are Arch Linux distro specific.

I suppose, the best you can do, is simply use your own libs. So, copy your own /lib directory from your RPi to the suitable cross-directory of FPC.
(remember: softlinks to not work, so make hard copies !) And go through the trial-and-error yourself for your distro.

Regarding Linux64. See: http://bugs.freepascal.org/view.php?id=30112 So, a single linklib seems to solve the problem.

There are no general instructions available, due to the above. I do not know if these "defines" are needed for everybody out there.

Also, the NewPascal cross binaries are bloated at the moment (due to huge library additions that are not always necessary). They more or less serve as a proof-of-concept. And are work-in-progress.

About your "raspbian+Pi / ubuntu+Odroid" problem, I have no clue. 32 vs 64 bit ?
hardfloat vs softfloat ?
ARMV6 vs ARMV7 ?

Fpclazup is included. You can always build your own cross-compiler ! ARM possibilities (original):
fpclazup.exe --installdir="c:\NewPascal\" --fpcURL="newpascal" --lazURL="trunk" --ostarget="linux" --cputarget="arm" --fpcOPT="-dFPC_ARMHF" --crossOPT="-CpARMV7A -CfVFPV3 -OoFASTMATH -CaEABIHF" --only="FPCCleanOnly,FPCBuildOnly"

The above options show you your choices ! And there are many !!

Reply by email