Lazarus

Free Pascal => Beginners => Topic started by: Hopestation on October 21, 2019, 07:40:47 pm

Title: fpc.cfg is missing
Post by: Hopestation on October 21, 2019, 07:40:47 pm
Hi.

I have just downloaded

fpc-3.0.4-1.x86_64.rpm
fpc-src-3.0.4-1.x86_64.rpm
lazarus-2.0.4-0.x86_64.rpm

and extracted them into .home/myfiles/usr.

I ran /home/myfiles/usr/lib64/lazarus/startlazarus

I got the "Welcome to Lazarus IDE 2.3.4", Configure Lazarus IDE window.

This shows that the file fpc.cfg is missing.

I have searched the  .home/myfiles/usr directory and I can't find this file.

Have I done something wrong?

When I downloaded and ran the Windows 10 version it ran "straight out of the box".
Title: Re: fpc.cfg is missing
Post by: Thaddy on October 21, 2019, 07:47:25 pm
look in and point to /etc/fpc.cfg
Title: Re: fpc.cfg is missing
Post by: Handoko on October 21, 2019, 07:49:21 pm
@Hopestation

Which Linux distro did you use?

Instead of manually extract the rpm files, have you tried to install the rpm packages by using the rpm command? Maybe this can help you:

https://access.redhat.com/solutions/1189 (https://access.redhat.com/solutions/1189)
Title: Re: fpc.cfg is missing
Post by: Thaddy on October 21, 2019, 09:50:27 pm
You can also create a new fpc.cfg with fpcmkcfg
Title: Re: fpc.cfg is missing
Post by: Hopestation on October 21, 2019, 11:24:27 pm
Thanks Thaddy.
I've got 2 etc directories:
/etc doesn't contain it.
/home/userfiles/etc/lazarus only contains environmentoptions.xml

Handoko, I'm using Mint 18.2. Does that make any difference?

Thaddy. Sorry for a silly question. How do I run fpcmkcfg?
Title: Re: fpc.cfg is missing
Post by: dbannon on October 22, 2019, 12:22:10 am
Hopestation, Linux Mint is a deb based system isn't it ?

You need to download the deb files, not the rpm. Install gdebi first. Hmm, I think Mint may install it by default, check anyway, you MUST use gdebi to install FPC and Lazarus. The built in 'Software Installer' they all get from Gnome does not resolve dependancies if you are installing a package that has been downloaded.

When you have gdebi installed, you can use it from command line or get a pretty and informative GUI if you click an already download deb file. Install in this order -

fpc
fpc-src
lazarus

Good luck !

Davo
Title: Re: fpc.cfg is missing
Post by: Thaddy on October 22, 2019, 07:59:41 am
steps to create a valid fpc.cfg the easy way:
find out where your fpc executable is:
Code: Bash  [Select]
  1. whereis fpc
Take note of the bin directory path, in my case /usr/local/bin/ (leave out fpc part, that's the binary)
find out where samplecfg is:
Code: Bash  [Select]
  1. whereis samplecfg
in my case in /usr/local
Now create /etc/fpc.cfg as follows:
Code: Bash  [Select]
  1. sudo /usr/local/samplecfg /usr/local/bin
Note I used the bin directory!
Now you should be fine. a fpc.cfg in the right place (/etc) and with all the correct paths to the libraries and tools expanded.
Title: Re: fpc.cfg is missing
Post by: Hopestation on October 22, 2019, 11:02:34 am
Thanks for your replies.

I've downloaded:

fpc-laz_3.0.4-1_amd64.deb

fpc-src_3.0.4-2_amd64.deb

lazarus-project_2.0.4-0_amd64.deb

I installed fpc-laz and fpc-src succesfully, using GDebi Package Installer, but when I tried to install lazarus I got a red backed message saying:

Error: Dependency is not satisfiable: fpc-laz(=3.04)

If dbannon is correct that I shouldn't have used the rpm files, can I still generate the fpc.cfg as Thaddy suggested?
Title: Re: fpc.cfg is missing
Post by: marcov on October 22, 2019, 11:04:19 am
(fpc.cfg is generated by scripts, so if you extract RPMs, manually, probably the scripts won't run and no file will be generated)
Title: Re: fpc.cfg is missing
Post by: Thaddy on October 22, 2019, 11:19:24 am
If dbannon is correct that I shouldn't have used the rpm files, can I still generate the fpc.cfg as Thaddy suggested?
Yes, you can. make sure however it ends up in /etc like I explained. samplecfg has a small help that explains it, not very verbose. samplecfg -h
If fpc.cfg is really missing from official rpm's file a bug report against the rpm owner from the linux distribution.
Note: I have only a rusty bit of knowledge about rpm's since I exclusively use Debian based distributions nowadays. But they also should install fpc.cfg in /etc. That should not be changed, unless /home/<user>/etc is available.
Title: Re: fpc.cfg is missing
Post by: Handoko on October 22, 2019, 11:43:10 am
Error: Dependency is not satisfiable: fpc-laz(=3.04)

I had this issue, but it can be easily solved. Not remember correctly but you can try:
- Simply ignore it, continue the installation and everything just works
- Disconnect the internet connection and perform the whole installation process again
- Use Synaptic Package Manager to inspect the cause of the installation problem
- Install Lazarus using the software manager provided by the OS

Certain versions of Ubuntu based distros have issue installing Lazarus. Nothing serious, I always made it works. But each version usually had different issue, I can't remember exactly how I solved them. You can try to search the forum for the answer.
Title: Re: fpc.cfg is missing
Post by: MarkMLl on October 22, 2019, 11:50:58 am
Alternatively do as I do and install FPC from https://www.freepascal.org/download.var then install the sources, get Lazarus from https://www.lazarus-ide.org/index.php?page=downloads and build in situ.

There's a couple of prerequisites that you have to install on Debian, but I did that just a few days ago for an i386 Docker container.

MarkMLl
Title: Re: fpc.cfg is missing
Post by: marcov on October 22, 2019, 12:00:49 pm
samplecfg is one option, fpmkcfg is the other.
Title: Re: fpc.cfg is missing
Post by: Thaddy on October 22, 2019, 12:05:17 pm
samplecfg is one option, fpmkcfg is the other.
I explained both. The latter is more complex to handle paths correctly, but has more features. That is true. A beginner is better helped with samplecfg in my opinion.
Title: Re: fpc.cfg is missing
Post by: Hopestation on October 22, 2019, 03:00:00 pm
I've opened a terminal, here is the result:

 ~ $ whereis fpc
fpc:
 ~ $ whereis samplecfg
samplecfg:

I don't get a result, should I be running this in a particular directory?

I know that samplecfg is in /home/roger/usr/lib64/fpc/3.0.4

I  moved to that directory and tried:

 ~ $ cd /home/userfiles/usr/lib64/fpc/3.0.4 ~/usr/lib64/fpc/3.0.4
 ~ $ ls
fpc.cfg  fpmkinst  msg  ppcx64  samplecfg  units

~/usr/lib64/fpc/3.0.4 $ sudo /home/userfiles/usr/lib64/fpc/3.0.4/samplecfg /usr/local/bin
[sudo] password for Hopestation:
Running on linux
/home/userfiles/usr/lib64/fpc/3.0.4/samplecfg: 1: /home/userfiles/usr/lib64/fpc/3.0.4/samplecfg: /usr/local/../../bin/fpc: not found
Write permission in /etc.
Writing sample configuration file to /etc/fpc.cfg
/home/userfiles/usr/lib64/fpc/3.0.4/samplecfg: 77: /home/userfiles/usr/lib64/fpc/3.0.4/samplecfg: fpcmkcfg: not found
 ~/usr/lib64/fpc/3.0.4 $

I've now got fpc.cfg in /home/userfiles/usr/local/bin.

All my lazarus files are in /home/userfiles/usr. Where should I move fpc.cfg to?
Title: Re: fpc.cfg is missing
Post by: Thaddy on October 22, 2019, 03:08:29 pm
You do not have a proper installation if both return nothing. Start from scratch. Use fpcdeluxe if you do not have sufficient linux knowledge.
Title: Re: fpc.cfg is missing
Post by: Hopestation on October 22, 2019, 03:26:18 pm
I've moved fpc.cfg to /etc and tried startlazarus again.

There is a new error now. Error: system.ppu not found. check your fpc.cfg

So I opened fpc.cfg in Text Editor and searched for system.ppu.

It wasn't found.
Title: Re: fpc.cfg is missing
Post by: MarkMLl on October 22, 2019, 03:28:51 pm
Try installing FPC.
Title: Re: fpc.cfg is missing
Post by: dbannon on October 23, 2019, 09:36:19 am
Wow Hopestation, you really are having some problems.

I just fired up my VM of Linux Mint 19.2 and installed fpc-laz, as expected. And yes, at the end of the process I had an appropriate fpc.cfg in /etc

So, I really don't understand what is going wrong in your case. I guess I have to wonder if your DEB install of fpc-laz went wrong as a result of your previous attempts to install via rpm or manually generate a fpc.cfg file. I really recommend you try and clean out all the existing attempts and start again. gdebi, if you point it again at your fpc-laz deb file will 'remove' everything it installed (but maybe leave the dependencies, if so, thats good).

Then repeat the gdebi install of fpc-laz and then, as soon as its finished, look for /etc/fpc.cfg, no point in proceeding if something failed. We need to find out what that 'something' is first.

I do wonder a bit about what you mean by having files in /home/userfiles/...    Just what is that ?  Only thing that should be in /home is user home directories.   Are you trying to avoid installing fpc-laz in /usr/ ?

(Good reasons to install Lazarus in user space but I suggest fpc is fine were its intended to be)

Davo
Title: Re: fpc.cfg is missing
Post by: Hopestation on October 24, 2019, 11:39:58 am
I've copied fpc.cfg to /etc and now the error message says:

 Error: system.ppu not found. Check your fpc.cfg.

I've opened it in Text Editor and searched for system.ppu and it isn't there.

Title: Re: fpc.cfg is missing
Post by: dbannon on October 24, 2019, 11:50:49 am
Honestly mate, install it properly !  Otherwise, every time you have a problem, you will wonder if its a coding issue or 'something' wrong with your install. 

There is no intrinsic reason why you cannot install it as its meant to be installed. As I said, I had no issues installing it on Linux Mint here.

Instead of using the GUI based GDebi, perhaps you can use the command line version, capture the on screen report for us to see.

Davo
Title: Re: fpc.cfg is missing
Post by: Hopestation on October 24, 2019, 01:48:40 pm
I've deleted the usr directory in /home/userfiles, that was created when I extracted the rpm files. Deleted the fpc-laz_3.0.4-1_amd64.deb file from downloads and used Software Manager to uninstall fpc.

I've downloaded the fpc-laz_3.0.4-1_amd64.deb file again and run GDebi to install fpc-laz_3.0.4-1_amd64.deb.

This is the result that I got:

dpkg: regarding .../fpc-laz_3.0.4-1_amd64.deb containing fpc-laz:
 fpc-laz conflicts with fp-compiler
  fp-compiler-3.0.0 provides fp-compiler and is present and installed.

dpkg: error processing archive /home/userfiles/DOWNLOADS/fpc-laz_3.0.4-1_amd64.deb (--install):
 conflicting packages - not installing fpc-laz

It appears that I need to remove other files.

Where should I look?

Title: Re: fpc.cfg is missing
Post by: MarkMLl on October 24, 2019, 02:48:18 pm
sudo find / fp-compiler

or

locate fp-compiler etc.

As I've already said: start off with the binaries from the FPC download page, which have an install script. That will put fpc (the main "frontend" program) in e.g. /usr/local/bin, the "backend" programs and libraries in a tree off /usr/local/lib, and will create /etc/fpc.cfg.

I presume that when you started with rpms that you didn't use  alien  to convert them to Debian format, and it sounds as though there's something odd in the .deb that you've tried more recently.

Title: Re: fpc.cfg is missing
Post by: Akira1364 on October 24, 2019, 08:14:33 pm
Do you know what directory your actual "fpc" compiler binary is located in? If so, put fpc.cfg in that directory.

Or more broadly, put fpc.cfg in any directory that is on your system's global path and thus visible from everywhere.
Title: Re: fpc.cfg is missing
Post by: dbannon on October 25, 2019, 04:28:09 am
Actually, I think its more likely your problem is that the OS Package Manager thinks you still have the Package Manager's repo fp-compiler installed. I guess you don't have synaptic package manager installed ?  Its a far more powerfull tool than the things they ship called "software Install" and the like.  Either way, maybe its time for some command line work ?

At a terminal,  try -

dpkg -l | grep fp <enter>

The the '|' symbol, a pipe, its usually to the right of keyboard, shown as a vertical line, its not an alpha numeric.  The command firstly lists all installed packages and that is piped to the grep that filters out all except a line that has fp somewhere in it.  So, there will be lots of hits !  Look to see if what you interested in is listed. If it is, it must be removed with package manager, don't be tempted to remove the files, the package manager will still believe they are there !

Davo
Title: Re: fpc.cfg is missing
Post by: zoltanleo on October 25, 2019, 09:19:39 am
Where should I look?
Hi Hopestation

Maybe you should repeat the installation from scratch?
Here is the correct way to install fpc and Lazarus from standard packages for Debian (Mint is its clone)
https://forum.lazarus.freepascal.org/index.php/topic,47149.msg337054.html#msg337054
Title: Re: fpc.cfg is missing
Post by: MarkMLl on October 25, 2019, 09:31:03 am
Do you know what directory your actual "fpc" compiler binary is located in? If so, put fpc.cfg in that directory.

Or more broadly, put fpc.cfg in any directory that is on your system's global path and thus visible from everywhere.

I'm not sure that's good advice in the general case.

It would certainly be unconventional to put fpc.cfg in /bin on a unix system.
Title: Re: fpc.cfg is missing
Post by: Akira1364 on October 31, 2019, 06:02:00 am
Do you know what directory your actual "fpc" compiler binary is located in? If so, put fpc.cfg in that directory.

Or more broadly, put fpc.cfg in any directory that is on your system's global path and thus visible from everywhere.

I'm not sure that's good advice in the general case.

It would certainly be unconventional to put fpc.cfg in /bin on a unix system.

AFAIK the directory of itself is the first place FPC looks for the cfg in all cases, though.
Title: Re: fpc.cfg is missing
Post by: dbannon on October 31, 2019, 06:54:57 am
Folks, I don't think anyone is helping Hopestation by suggesting hacks to make a botched install work. His problem is that his package manager thinks it has a better compiler installed already, whether thats true or not is unimportant, the issue is that the package manager thinks its there. 

All he needs do is convince the package manager its not, simply by doing a package manager uninstall. 

Wow, what a saga !  As an aside, I strongly believe that every Linux user build Lazarus from source as documented on the wiki page about installing Lazarus on Linux. Dead easy to build from either the SourceForge compiler or one from the Package manager's repo (as long as its 3.0.4).

Sigh ....

Davo
Title: Re: fpc.cfg is missing
Post by: MarkMLl on October 31, 2019, 09:44:33 am
I agree with Davo. Also, leaving aside OP's initial attempt to unpack (but not install) RPMs, it looks as though at some point something has got badly confused and decided that because package management thinks that it's installed it doesn't have to check for the fpc.cfg file, or even that whoever built the fpc package for the distro has made a mistake.

One caveat: I notice than when building Lazarus on current Debian ("Buster", stable) I have to go back to the previous release to get the libqt4pas-dev package.

MarkMLl