Recent

Author Topic: Raspberry Pi bundles now available  (Read 21668 times)

sysrpl

  • Sr. Member
  • ****
  • Posts: 315
    • Get Lazarus
Raspberry Pi bundles now available
« on: December 07, 2015, 04:19:59 am »
I've uploaded a few Raspberry Pi files and scripts at http://www.getlazarus.org

Below is a minimal fpc 3.0.0 compiler. It's stripped down to be small and only includes the compiler, the text mode IDE, and the run time library. It's a good starting point on the Raspberry Pi if you want to do command line compiling using only the rtl or if you want to use it as a starting point for building the fpc trunk or other compiler branches on your Raspberry Pi. Total install size will be 45MB for those of you conscious about using up the limited space on your Pi's SD card.

http://cache.getlazarus.org/archives/fpc-3.0.0.raspberry-min.tar.gz

Just download the above then "tar xvf fpc-3.0.0.raspberry-min.tar.gz" then run "./setup.sh". The setup does not need super user rights. It will let you choose a fpc compiler installation location, somewhere under your $HOME, and give you the option to create a shortcut to a terminal where the fpc environment is ready for you. That is with the minimal fpc 3.0 in your path and fpc.cfg environment variable configured.

Another, possibly more useful bundle I've created is Free Pascal 3.0 with Lazarus for the Raspberry Pi. I've taken great care to reduce the install size of both fpc and Lazarus with this bundle for the Pi.

I've eliminated a lot of fpc packages which don't make sense to have on a Pi. All cross platform package and runtime files have been removed (I don't imagine people cross compiling from the Pi to say Windows for example). I've also eliminates the lazarus tool sources, source images files (res files remain), and quite a few components which are very unlikely to be used on the Pi. Basically I've gotten the install size from a full fpc and lazarus from 1.5GB down to around 216MB.

If you're interested in trying this version of Free Pascal 3.0 with Lazarus, here is where you can get it:

http://www.getlazarus.org/setup/?download#raspberry_pi

If you have a Pi, just follow the instructions in the setup script. You can choose your install folder and have the option to create a application shortcut you can pin to the Pi menu.

In the next week I'll be working on updating the other platform installers to include minimal versions, as well as updated install scripts where you can choose you install folder and create more shortcuts, be they fpc terminal shortcuts or application desktop shortcuts.

Pi users, if your interested I am developing an SDL 2 installer along with a few bare demos which should work with either the minimal or the more complete compilers mentioned above. Let me know if you're inerested in using the SDL 2 on the Pi and I may setup a forum for it.
« Last Edit: December 07, 2015, 05:00:51 am by sysrpl »

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Raspberry Pi bundles now available
« Reply #1 on: December 07, 2015, 03:52:28 pm »
Very nice!  :D

Could you please provide some more details? Will your script produce HF compiler if distro supports it? Will script produce different compiler for old ARMv6 Pi and different for newer ARMv7 Pi? Or is it always the same ARMv6 NonHF compiler which runs on all platforms?
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

sysrpl

  • Sr. Member
  • ****
  • Posts: 315
    • Get Lazarus
Re: Raspberry Pi bundles now available
« Reply #2 on: December 07, 2015, 05:27:15 pm »
Right now the I am using the following command to create the compiler:

make all OPT="-dFPC_ARMHF"

Which should support both the ARMv7 on the newer Pi 2 and ARMv6 on the older versions. I am trying for maximum compatibility while also reducing the overall install size of both FPC and Lazarus. I think most people probably are running a Pi with an 8GB SD card so in my opinion taking up over 1GB of space when the OS already eats up 4GB of space is a "no go".

The minimal 3.0.0 compiler with the same FPC_ARMHF define weighs in at around 45MB, and is capable of command line compiling both complex program (rtl support only) and other compilers. If someone wants to get the fpc sources and build their own compiler, I think my minimal 3.0.0 would be a good starting point. As I stated, it also includes the option for a terminal shortcut with fpc in the path while reading the proper config file making it even easier to use.

Regarding the compiler config file (fpc.cfg), I never place it in ~/.fpc.cfg, that is just rude. Each fpc.cfg (all my scripts across platforms) put the config in $(CompPath)/fpc.cfg, and then for command line compiler the shortcut tells fpc where that is through the PPC_CONFIG_PATH environment variable.

Now to the part about specific ARM core optimization, that is ARMv5/ARMv6/ARMv7, I don't believe you need cross compiler support for this. With my builds if you type "fpc -ic", this will be the result:

ARMV3
ARMV4
ARMV4T
ARMV5
ARMV5T
ARMV5TE
ARMV5TEJ
ARMV6
ARMV6K
ARMV6T2
ARMV6Z
ARMV6M
ARMV7
ARMV7A
ARMV7R
ARMV7M
ARMV7EM

Which means the user can then add any arm specific architecture optimization to his programs by simply adding -CpARMV7 (or anything from the list above) when compiling, either on the command line or from within lazarus.

Let me know if you have and questions or comments.
« Last Edit: December 07, 2015, 08:49:46 pm by sysrpl »

eric

  • Sr. Member
  • ****
  • Posts: 267
Re: Raspberry Pi bundles now available
« Reply #3 on: December 11, 2015, 11:48:05 am »
Thank you for these scripts. Unfortunately the openssl package has been stripped from the Raspberry Pi FPC3+Lazarus script, and this package is needed for use with lNet. I have a copy of the package from an installation on a Linux machine, but I'm not sure how to add it to the RPi installation.

sysrpl

  • Sr. Member
  • ****
  • Posts: 315
    • Get Lazarus
Re: Raspberry Pi bundles now available
« Reply #4 on: December 11, 2015, 08:45:00 pm »
Eric, I was planning on shipping my own SSL units when I finish my Pi demos.

See:

https://github.com/sysrpl/Cross.Codebot/blob/master/source/codebot.interop.openssl.pas

- and -

https://github.com/sysrpl/Cross.Codebot/blob/master/source/codebot.networking.pas

Which leads to raw sockets, web client, ftp client, and web storage implementations ... all under the "Codebot.Networking" namespace.

For now you should be able to get the ssl which comes with fpc using this command:

svn co http://svn.freepascal.org/svn/fpc/tags/release_3_0_0/packages/openssl openssl

Then put the openssl/src folder in your include path.

eric

  • Sr. Member
  • ****
  • Posts: 267
Re: Raspberry Pi bundles now available
« Reply #5 on: December 12, 2015, 12:03:50 am »
Thank you, I'll try that shortly.

sysrpl

  • Sr. Member
  • ****
  • Posts: 315
    • Get Lazarus
Re: Raspberry Pi bundles now available
« Reply #6 on: December 12, 2015, 02:35:54 am »
Thank you, I'll try that shortly.
eric, I just posted a new Raspberry Lazarus which may work a bit better. It's roughly the same install size, but with more components and it should rebuild easier. The fpc folder was left unchanged.

http://www.getlazarus.org/setup/?download#raspberry_pi

hosune7845

  • Full Member
  • ***
  • Posts: 159
Re: Raspberry Pi bundles now available
« Reply #7 on: December 14, 2015, 07:11:47 am »
Thank you. it's what i need!

I installed lazarus with your script on my arm-linux board.

But when i start lazarus, the ide cannot find fpc.cfg (Error: fpc.cfg is missing).

------------

Also, i need to install on windows for cross-compile (arm-linux)

Can i do that with your script
« Last Edit: December 14, 2015, 07:13:18 am by hosune7845 »

sysrpl

  • Sr. Member
  • ****
  • Posts: 315
    • Get Lazarus
Re: Raspberry Pi bundles now available
« Reply #8 on: December 15, 2015, 06:03:35 am »
There is a file in the install folder with a orange cheetah icon inside a gear labeled Lazarus. Use that to run the Lazarus IDE. Do not run the "lazarus" executable in the lazarus folder directly.

Reason being, I set both the compiler configuration path (where to find fpc.cfg) and the lazarus config folder in a script which then launches lazarus.

In lazarus.sh (paths are populated during install):

export PPC_CONFIG_PATH=/home/pi/your/install/folder/fpc/bin
export PATH=$PPC_CONFIG_PATH:$PATH
/home/pi/your/install/folder/lazarus/lazarus -pcp=/home/pi/your/install/folder/lazarus/config

What does this do and why?

It sets up the compiler and lazarus configuration upon launch, allowing you (or anyone else) to have multiple installations of fpc or lazarus that do not interfere with each other. In other words, I am being nice and not just dumping a fpc configuration in ~/.fpc.cfg, potentially screwing up some other configuration you may have had.

Regarding Linux arm cross compile on Windows, it was in there previously and it will be in there again, I just can't say when.
« Last Edit: December 15, 2015, 06:06:10 am by sysrpl »

hosune7845

  • Full Member
  • ***
  • Posts: 159
Re: Raspberry Pi bundles now available
« Reply #9 on: December 15, 2015, 09:22:52 am »
There is a file in the install folder with a orange cheetah icon inside a gear labeled Lazarus. Use that to run the Lazarus IDE. Do not run the "lazarus" executable in the lazarus folder directly.

Reason being, I set both the compiler configuration path (where to find fpc.cfg) and the lazarus config folder in a script which then launches lazarus.

In lazarus.sh (paths are populated during install):

export PPC_CONFIG_PATH=/home/pi/your/install/folder/fpc/bin
export PATH=$PPC_CONFIG_PATH:$PATH
/home/pi/your/install/folder/lazarus/lazarus -pcp=/home/pi/your/install/folder/lazarus/config

What does this do and why?

It sets up the compiler and lazarus configuration upon launch, allowing you (or anyone else) to have multiple installations of fpc or lazarus that do not interfere with each other. In other words, I am being nice and not just dumping a fpc configuration in ~/.fpc.cfg, potentially screwing up some other configuration you may have had.

Regarding Linux arm cross compile on Windows, it was in there previously and it will be in there again, I just can't say when.

Thank you!

Is The path what you said "Development/"? there's no a orange cheetah icon cheetah...
« Last Edit: December 15, 2015, 09:43:38 am by hosune7845 »

sysrpl

  • Sr. Member
  • ****
  • Posts: 315
    • Get Lazarus
Re: Raspberry Pi bundles now available
« Reply #10 on: December 16, 2015, 10:05:09 pm »
Whatever folder you choose to install.

The default is /home/pi/Development/FreePascal

hosune7845

  • Full Member
  • ***
  • Posts: 159
Re: Raspberry Pi bundles now available
« Reply #11 on: December 17, 2015, 09:04:48 am »
Whatever folder you choose to install.

The default is /home/pi/Development/FreePascal

In /home/pi/Development/FreePascal/Lazarus, there is only folder labeld "config".

I've chosen "/home/odroid/ folder to install. And there is  "Development/" folder.

sysrpl

  • Sr. Member
  • ****
  • Posts: 315
    • Get Lazarus
Re: Raspberry Pi bundles now available
« Reply #12 on: December 17, 2015, 04:27:36 pm »
Can you try to download and run the setup.sh again? I had an error inthe script where people input the install path with a trailing slash. e.g. $HOME/pascal/

Also, install to a folder below $HOME, not at $HOME e.g. $HOME/pascal/

Or just choose use the default.


jmverdi

  • Newbie
  • Posts: 4
Re: Raspberry Pi bundles now available
« Reply #13 on: December 29, 2015, 07:41:37 pm »
Hi,
Today i download and install your script, choosing all by default. The first ime i launch lazarus, i had the same problem (fpc.cfg missing). So i install it again and it works.

I do not find orange cheetah icon but i launch "lazarus.sh" which is in folder:
/home/pi/Development/FreePascal/lazarus
and it works.

Thank you sysrpl!
jm

hansotten

  • Jr. Member
  • **
  • Posts: 88
Re: Raspberry Pi bundles now available
« Reply #14 on: January 06, 2016, 09:45:10 am »

Pi users, if your interested I am developing an SDL 2 installer along with a few bare demos which should work with either the minimal or the more complete compilers mentioned above. Let me know if you're inerested in using the SDL 2 on the Pi and I may setup a forum for it.

Yes, I would be interested in SDL 2 on RPi with Freepascal! Cant get it to work due to my limited skills.

Hans

 

TinyPortal © 2005-2018