Recent

Author Topic: aarch64 installation of fpc fails with:- fpmake: No such file or directory  (Read 7062 times)

dswood

  • Newbie
  • Posts: 3
Hi All
I am trying to install free pascal onto a linux based aarch computer (RPi4).  I have installed the binary of fpc from fpc.3.2.2.aarch64-linux.tar using the provided install.sh.  I chose to install into /usr/local so I could remove it easily afterwards. 
Next I extracted the fpcbuild-3.2.2.tar.gz.  I ran make clean.  Then make all.

After some time the build fails with:-
Quote
make[4]: Entering directory '/tmp/fpc/fpcbuild/fpcsrc/packages/fpmkunit'
/usr/bin/rm -rf units_bs
make[4]: Leaving directory '/tmp/fpc/fpcbuild/fpcsrc/packages/fpmkunit'
./fpmake clean --localunitdir=. --os=linux --cpu=aarch64 -o -Ur -o -Xs -o -O2 -o -n -o -daarch64 -o -dRELEASE --compiler=/tmp/fpc/fpcbuild/fpcsrc/compile
r/ppca64 -bu
make[3]: ./fpmake: No such file or directory
make[3]: *** [Makefile:1732: clean] Error 127
make[3]: Leaving directory '/tmp/fpc/fpcbuild/fpcsrc/packages'
make[2]: *** [Makefile:2708: packages_clean] Error 2
make[2]: Leaving directory '/tmp/fpc/fpcbuild/fpcsrc'
make[1]: *** [Makefile:2834: build-stamp.aarch64-linux] Error 2
make[1]: Leaving directory '/tmp/fpc/fpcbuild/fpcsrc'
make: *** [Makefile:2569: fpcsrc/build-stamp.aarch64-linux] Error 2
I have tried version 3.2.0 which failed in a different way. I have tried the snapshot which is just the same.

I would appreciate some help.  Thanks.

Duncan.

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: aarch64 installation of fpc fails with:- fpmake: No such file or directory
« Reply #1 on: December 01, 2021, 05:06:24 pm »
Hello.

If you want to install binaries of unzipped fpc.3.2.2.aarch64-linux.tar, just do in terminal:
(Nothing more is needed to install the compiler).

Code: Bash  [Select][+][-]
  1. $ cd /directory/of/fpcbinary/
  2. $ bash install.sh

If, for some reason, you want to recompile fpc source using the unzipped fpcbuild-3.2.2.tar.gz. file, do this:

Code: Bash  [Select][+][-]
  1. $ cd /directory/of/fpcsource/
  2. $ make clean
  3. $ make all OPT="-Fl/usr/local/lib"
  4. $ make install INSTALL_PREFIX=/usr/
« Last Edit: December 01, 2021, 05:20:42 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

dswood

  • Newbie
  • Posts: 3
Re: aarch64 installation of fpc fails with:- fpmake: No such file or directory
« Reply #2 on: December 02, 2021, 01:08:20 pm »
Thanks for your clear guidance.  However I am no further on. 
Code: Bash  [Select][+][-]
  1. make all OPT="-Fl/usr/local/lib"
This still fails in the exact same way.  It got me thinking. I added /usr/local/lib to my ld.so.conf.  That changes nothing.  I copied the library files to /usr/local/lib/lib64,  probably the most correct place on this system. 

You say I should be able to use the binary compiler but that does not seem to have installed correctly.  I can't compile lazarus with the binary fpc because it can't find unit db.  I bet it can't find any of the units. 

Do I need a config file in /etc for fpc to work?


Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: aarch64 installation of fpc fails with:- fpmake: No such file or directory
« Reply #3 on: December 02, 2021, 04:02:23 pm »
Thanks for your clear guidance.  However I am no further on. 
Code: Bash  [Select][+][-]
  1. make all OPT="-Fl/usr/local/lib"
This still fails in the exact same way.  It got me thinking. I added /usr/local/lib to my ld.so.conf.  That changes nothing.  I copied the library files to /usr/local/lib/lib64,  probably the most correct place on this system. 

You say I should be able to use the binary compiler but that does not seem to have installed correctly.  I can't compile lazarus with the binary fpc because it can't find unit db.  I bet it can't find any of the units. 

Do I need a config file in /etc for fpc to work?

Hello.

I dont understand why you need to re-compile all fpc source.
Here, on my Rpi, installation of fpc ARM aarch64 is out-of-the-box,.

fpc was installed via the install.sh script, with /usr/lib/ as target, nothing more.

I dont use Lazarus on Rpi, only fpc + MSEgui so I did not try to compile Lazarus apps but it should work too.
If it does not work, maybe you should ask it to LCL/Lazarus forum section.

Fre;D
« Last Edit: December 02, 2021, 04:10:44 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: aarch64 installation of fpc fails with:- fpmake: No such file or directory
« Reply #4 on: December 02, 2021, 04:25:15 pm »
Do I need a config file in /etc for fpc to work?

If you have installed fpc in /usr/lib or /usr/local/lib, afaik, yes, fpc.cfg is needed in /etc/.

Otherwise, if fpc was installed in a home directory, fpc.cfg is in /home/you/.fpc.cfg (note the dot a begin, to set it as hidden).

But all this is done by the install.sh script.
[EDIT] Note that the script must be run with root right if you want to install it in /usr/...

Code: Pascal  [Select][+][-]
  1. $ sudo install.sh
« Last Edit: December 02, 2021, 04:46:56 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

dswood

  • Newbie
  • Posts: 3
Re: aarch64 installation of fpc fails with:- fpmake: No such file or directory
« Reply #5 on: December 02, 2021, 10:04:36 pm »
I have cracked it with some ugly hacks.  fpmake was not linked to libraries correctly.  The libraries not being where it wanted produced "No such file or directory" If you do
Code: Bash  [Select][+][-]
  1. strings fpmake | grep lib
It will put out a lot of stuff but in there is hard coded libraries it tries to link to. They are:-
/lib/ld-linux-aarch64.so.1
/usr/lib/aarch64-linux-gnu/crti.o
/usr/lib/aarch64-linux-gnu/crtn.o

On my system the files are located :-
/lib64/ld-linux-aarch64.so.1
/usr/lib64/crti.o
/usr/lib64/crtn.o

The ugly hack is to sym link them so they are found.
I did not have any config files because install.sh call another script that calls fpmkcfg which did the same as fpmake.  My hack fixes this too.  The binary install of fpc works now too.  I would like to know the correct way to point fpc to the original library versions so that programs compiled on one machine run on another.  However first I shall install lazarus, tomorrow - it has been a long day.

Thanks for your help.
King regards
Duncan.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: aarch64 installation of fpc fails with:- fpmake: No such file or directory
« Reply #6 on: December 02, 2021, 11:04:14 pm »
Duncan, when you build/install Lazaras (today?tomorrow) don't try to install it in /usr/ - you will end up with a far more flexible install in user space.  So, put the source somewhere in your own area (I use $HOME/bin/Lazarus/$LAZ_Ver), build it there and do not install, just use it from there.  Lazarus does not need to be on your PATH, just cd to that dir to start it up.

Incidently, FPC is similar, you can install it in userspaces, just set a path where you install the binaries.

Having FPC and Lazarus in user space lets you have multiple versions and easily install and change without root permission.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018