[fpc-pascal] Help: New install problems

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Apr 2 16:27:57 CEST 2012

Anthony Walter wrote on Mon, 02 Apr 2012:

> Thanks. Yes I wanted to get fpc (the compiler) installed from sources
> rather than lazarus. Your advice somewhat got me there, but now when I
> compile the source/units are not found.
> cd /home/myusername
> sudo apt-get install fpc
> mkdir fpc

> svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus

Here you are again checking out the lazarus sources?

> make FPC=`pwd`/compiler/ppc386 -C compiler installsymlink INSTALL_PREFIX=
> make install INSTALL_PREFIX=/home/myusername

It's probably better to switch the order of those two commands.

> Free Pascal Compiler version 2.7.1 [2012/04/02] for i386
> Copyright (c) 1993-2012 by Florian Klaempfl and others
> Target OS: Linux for i386
> Compiling Hello.pas
> Fatal: Can't find unit system used by Hello
> Fatal: Compilation aborted
> Error: /home/delluser/bin/ppc386 returned an error exitcode

The default FPC configuration file is /etc/fpc.cfg and it includes  
information for units installed globally. If you install them  
elsewhere, you have to create an alternate configuration file that  
tells the compiler where to find them.

The easiest way is probably to copy /etc/fpc.cfg to ~/.fpc.cfg (notice  
the leading dot) and then replace all /usr/lib/fpc with  
/home/myusername/fpc. This means however that every compiler  
invocation will use this alternate configuration file, so also when  
using the globally installed 2.4.4 (which in turn will then complain  
that it can't find /its/ units).

If you also want to be able to use the globally installed FPC (by e.g.  
explicitly calling /usr/bin/ppc386), it's probably best to put the  
above in ~/.fpc-trunk.cfg, and then create a ~/.fpc.cfg with the  
following contents:

#ifdef VER2_7
#include /home/myusername/.fpc-trunk.cfg
#include /etc/fpc.cfg

You will have to replace the VER2_7 with newer version numbers when  
the version number in svn trunk is changed though. Alternatively, you  
can switch around the then/else branches and use VER2_4 instead, but  
then you'll have the same problem when the version number of the  
globally installed version changes.


This message was sent using IMP, the Internet Messaging Program.

More information about the fpc-pascal mailing list