[fpc-devel] Programming in Pascal .

Carsten Bager carsten at beas.dk
Wed Mar 27 11:08:57 CET 2019


Hi
If you download FPC and source, then I think it can be done.
I have tried to do this test program on my Pi.
Below is a description of the installation of Lazarus, you can skip the lazarus part.
Carsten


Program Test1;
{$RANGECHECKS ON}
{$OVERFLOWCHECKS ON}
{$S+ STACK CHECKING ON}
{$SMARTLINK ON}
{$TYPEINFO ON}
{$LONGSTRINGS ON}
{$VARSTRINGCHECKS Off}

Uses
  cthreads,
  classes,
  sysutils,
  PtcMouse,
  PtcCrt,
  PtcGraph;

Begin
  Writeln('Test');
End.

Compiled with
/pp/Fpc/bin/fpc -gl -XX -FU"Ppu" -Fu"/pp/fpcsrc/packages/graph/src/ptcgraph" -Fi"/pp/fpcsrc/packages/graph/src/inc" Test1.pp

This is done on a Pi
Free Pascal Compiler version 3.0.4 [2017/10/11] for arm
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for ARMHF
Compiling Test1.pp
Assembling test1
Linking Test1
Test1.pp(19,17) Warning: "crtbegin.o" not found, this will probably cause a linking failure
Test1.pp(19,17) Warning: "crtend.o" not found, this will probably cause a linking failure
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
19 lines compiled, 3.4 sec
2 warning(s) issued



If you want the newest Lazarus IDE on a PI, do the following (I use Midnight Commander on the Pi (sudo apt-get -y install mc) when unpacking tgz files etc).



  1.  Download FPC for Pi (Everything in 1 big package for eabihf ABI for raspberry)<ftp://ftp.hu.freepascal.org/pub/fpc/dist/3.0.4/arm-linux/fpc-3.0.4.arm-linux-eabihf-raspberry.tar>
  2.  Download FPC source (fpc-3.0.4.source.tar.gz)<ftp://ftp.hu.freepascal.org/pub/fpc/dist/3.0.4/source/fpc-3.0.4.source.tar.gz>
  3.  Download Lazarus source (lazarus-1.8.4.tar.gz) or (lazarus-2.0.0.tar.gz)<https://sourceforge.net/projects/lazarus/files/Lazarus%20Zip%20_%20GZip/Lazarus%202.0.0/lazarus-2.0.0.tar.gz/download>
  4.  Create a folder /pp that belongs to the pi user and the pi group. (sudo install -d -o pi -g pi -m 0770 /pp)
Install Fpc in /pp/fpc folder
Create a /pp/fpcsrc folder
Place the downloaded fpc source in /pp/fpcsrc
Create a /pp/lazarus
Place the downloaded lazarus source /pp/lazarus
  5.  Place the make-lazarus-first.sh script in /pp/lazarus
  6.  Run the make-lazarus-first.sh script
  7.  Place the make-lazarus.sh script in /pp/lazarus
  8.  Run the make-lazarus.sh script
  9.  Create link in /bin to fpcres (sudo ln -sf /pp/fpc/bin/fpcres /bin/fpcres).
  10. To create a Menu Programming short cut, go to
Menu -> Preferences-> Main Menu Editor
  11. To create a Desktop short cut, place the text file "Lazarus" in the folder "/home/pi/Desktop/"



  *   Filename = "Lazarus"
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Lazarus
Comment=Pascal IDE
Icon=/pp/lazarus/ide/lazarus.ico
Exec=/pp/lazarus/startlazarus
Terminal=false
Categories=X-Debian-Applications-Editors;



  *   Filename = "make-lazarus-first.sh"
#!/bin/sh
#sudo apt-get update
sudo apt-get install -y libx11-dev libgdk-pixbuf2.0-dev libcairo2-dev gir1.2-coglpango-1.0 libpangox-1.0-dev xorg-dev libgtk2.0-dev libpango1.0-dev



  *   Filename = "make-lazarus.sh"
#!/bin/sh
export PATH=/pp/fpc/bin:$PATH
make all OPT=-dFPC_ARMHF
sleep 60
make install OPT=-dFPC_ARMHF PREFIX=/pp/lazarus



  *   Links
Lazarus on Raspberry Pi<http://wiki.freepascal.org/Lazarus_on_Raspberry_Pi>




On 26 Mar 2019 at 9:07, Yves Boudeville wrote:

> Bonjour.
> I am asking questions on the art of scientific computing from 1966.
> After Algol and Modula,
> the U.C.S.D. Pascal system has been the touchstone of the scientific
> computing. This has
> been devoted by Niklaus Wirth book and applied in Borland TP7 software.
> The only thing
> scientists need is a strongly typed language with pixel access on a
> single graphical windows.
>   This is needed, for instance, by Monte-Carlo simulations. We need the
> full power of the
> computer with the pixel definition of the result because the eyes are
> the  best investigators
> for scientific bugs. TP7 with graph was the best tool for that. For less
> mathematical
> approaches, like 3D models it was sufficient to use Borland Delphi-7.
> Now, in 2019, it was
> possible to use FPC compiler with Fp-IDE to make in laboratories good
> simulations of
> scientific equations, very clean in FPC Pascal, with the Graphical tools
> PtcGraph, PtcCrt, etc
> ... It is far more useful than old Seymour Cray Fortran or C// on
> Connection Machines CM1 / CM2
> of Hillis : Theses need M.I.T. gourous in big National Laboratories.
> Some years ago, it was possible with the good job of Nikolay Nikolov on
> Ptc Pascal Units, to do
> clean-proof use of computer to visualize physics in HDMI 1920 x 1080 x
> 65536c under Windows.
> With lesser resolution, a work in Pascal was running without
> adding/changing a word under
> Windows_Intel / Ubuntu_Linux / or Raspbian_Raspberry Rpi3. Now, for
> scientific use, it is not
> possible because  ptcgraph etc... are not included in latest versions,
> for instance of Raspbian.
> So, in order to use software in Physics, we are compelled use old
> versions of OS  2.6.4 Fpc
> systems instead of 3.0.0 on /usr/lib/fpc to use our programs. It is a
> big problem for us because
> we are interested by easy Pascal simulations of physics and we are
> newbie in systems. Will it be
> an hope to have again under Fpc : PtcGraph, PtcCrt, PtcMouse... to do
> good job in physics ?
>
> Friendly Yours.
>
> P.S. I beg your pardon for my desesperately rusty English language
> because Classrooms are very
>
> far from me in time ... ( I am 73 ) .
>
> --
> +-------------------------------------------+
> I Mr ou Mme BOUDEVILLE, Yves & Nicole ;     I
> I "Le Jardin des Arts", 28, Rue Leon FABRE  I
> I 69100, VILLEURBANNE. FRANCE.              I
> I Tel Domicile : 04.78.93.67.95 (Repondeur) I
> I Courriel: Yves.Boudeville at free.fr         I
> +-------------------------------------------+
>
>
> ---
> L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
> https://www.avast.com/antivirus
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190327/ad0b7367/attachment.html>


More information about the fpc-devel mailing list