# Lazarus



## Anonymous (Mar 27, 2014)

doesn't compile on FreeBSD 9.2


```
dividerbevel.pas(19,12) Fatal: Can't find unit LResources used by DividerBevel
Fatal: Compilation aborted
gmake: *** [lazcontrols.ppu] Error 1
*** [do-build] Error code 2
```


----------



## trh411 (Mar 27, 2014)

Try updating your ports tree and then re-try the installation. An update to editors/lazarus was committed yesterday (3/25).


----------



## Anonymous (Mar 27, 2014)

This update doesn't work.


----------



## trh411 (Mar 27, 2014)

talsamon said:
			
		

> This update doesn't work.


I got the same error attempting to install editors/lazarus on FreeBSD-10.0-RELEASE amd64. I suggest you contact the maintainer or open a PR.


----------



## SirDice (Mar 27, 2014)

There are build errors on the official repository too. Somebody already submitted a PR for it.

http://portsmon.freebsd.org/portovervie ... -lcl-units


----------



## trh411 (Mar 29, 2014)

A fix r349582 for this was committed today. Update your ports tree and re-try your installation.


----------



## Anonymous (Mar 29, 2014)

editors/lazarus-lcl-units compiles ok.

editors/lazarus-lcl-gtk2 editors/lazarus-lcl-nogui editors/lazarus-lcl-qt fails with:


```
lclproc.pas(20,66) Fatal: Can't find unit LCLProc used by DynQueue
Fatal: Compilation aborted
gmake: *** [lazcontrols.ppu] Error 1
*** [do-build] Error code 2
```


----------



## Anonymous (Mar 29, 2014)

After I inserted in the other Makefiles


```
OPT	=	"-Fu../../lcl/ -Fu../lcl -Fu../../lcl/forms -Fu../../lcl/nonwin32 -Fu../../lcl/widgetset -Fi../../lcl/include"
.include "${MASTERDIR}/Makefile"
```

the error changed in:


```
lclproc.pas(21,16) Fatal: Can't find unit LCLProc used by InterfaceBase
Fatal: Compilation aborted
gmake[1]: *** [../lcl.ppu] Error 1
```


----------



## trh411 (Mar 30, 2014)

talsamon said:
			
		

> After I inserted in the other Makefiles
> 
> 
> ```
> ...


I'm experimenting on my end too. I'll let you know if I come up with anything useful. A little like whack-a-mole, no?


----------



## trh411 (Mar 30, 2014)

Using only the changes to the ports tree provided by r349582, I was able to successfully build and install editors/lazarus. Installation was on a VirtualBox VM with FreeBSD-10.0 amd64 installed.


----------



## Anonymous (Mar 30, 2014)

No, does not work. I deleted fpc complete (with fpc.cfg) and installed it new. I have deleted all lazarus-ports and fetched it new with `portsnap`. Does not compile anyway.


----------



## trh411 (Mar 30, 2014)

talsamon said:
			
		

> No, does not work. I deleted fpc complete (with fpc.cfg) and installed it new. I have deleted all lazarus-ports and fetched it new with portsnap. Does not compile anyway.


Well, my successful build was on FreeBSD-10.0, and yours fails on FreeBSD-9.2. That happens sometimes with ports: they build for one version, but not for others. If I get a chance tomorrow I'll create a FreeBSD-9.2 VM and try the install editors/lazarus on that version. It will take half the day to just to load up all the dependencies before I can even attempt a build of editors/lazarus, but with any luck I may have a result to share by day's end.

Is your platform amd64 or i386?


----------



## Anonymous (Mar 30, 2014)

Thank you, my platform is amd64.


----------



## trh411 (Mar 30, 2014)

I successfully built and installed editors/lazarus on a VirtualBox VM guest with FreeBSD-9.2-p3 amd64 installed.

However, half way through the process I formulated a theory as to why I can build successfully, but you cannot. My builds on FreeBSD-9.2 and FreeBSD-10.0 were against the default devel/gtk2 interface. One of your error messages suggests to me that you might be attempting to build against the devel/qt4 interface. If so, that option may be what is broken. I am attempting to re-install editors/lazarus now with the devel/qt4 option to confirm or refute this theory. Since it has to build the whole devel/qt4 first, it could take 3 to 4 hours before I can report back.


----------



## Anonymous (Mar 30, 2014)

I don't know where editors/lazarus-lcl-gtk2  and editors/lazarus-lcl-nogui  come from I have only checked in editors/lazarus `qt4` as option.
editors/lazarus  failes with 

```
lazres.pp(38,35) Fatal: Can't find unit LCLProc used by LazRes
Fatal: Compilation aborted
```
.
editor/lazarus-lcl-qt fails also with:

```
actionseditor.pas(27,22) Fatal: Can't find unit LCLProc used by ActionsEditor
Fatal: Compilation aborted
```

There's something wrong in the Makefile or Makefiles, or in the fpc.cfg, seems with the paths.


----------



## trh411 (Mar 30, 2014)

I successfully built and installed editors/lazarus with the devel/qt4 option on a VirtualBox VM guest with FreeBSD-9.2-p3 amd64 installed.



			
				talsamon said:
			
		

> I don't know where editors/lazarus-lcl-gtk2  and editors/lazarus-lcl-nogui  come from I have only checked in editors/lazarus `qt4` as option.


Based on my tests, editors/lazarus-lcl-nogui is a build/run dependency regardless of the interface selected. editors/lazarus-lcl-gtk2 is a build/run dependency only if devel/gtk2 is selected as an option.  editors/lazarus-lcl-qt is a build/run dependency only if devel/qt4 is selected as an option.



			
				talsamon said:
			
		

> There's something wrong in the Makefile or Makefiles, or in the fpc.cfg, seems with the paths.


If that was the case, I should not be able to build either. AFAIK, we are using the same versions of all these files. I am using all files as-is from the ports tree without any local modifications.


----------



## Anonymous (Mar 30, 2014)

`uname -a
9.2-RELEASE-p3 FreeBSD 9.2-RELEASE-p3`

I also install from original ports. If I fetched it new, they are original.

editor/lazarus wants to install nogui:


```
=> SHA256 Checksum OK for freepascal/lazarus-1.2-0.tar.gz.
===>  Patching for lazarus-1.2
===>  Applying FreeBSD patches for lazarus-1.2
===>   lazarus-1.2 depends on executable: fpcres - found
===>   lazarus-1.2 depends on file: /usr/local/share/lazarus/lcl/units/x86_64-freebsd/alllclunits.ppu - found
===>   lazarus-1.2 depends on file: /usr/local/share/lazarus/lcl/units/x86_64-freebsd/nogui/interfaces.ppu - not found
```

but /usr/local/share/lazarus/lcl/units/x86_64-freebsd/nogui/interfaces.ppu exists


----------



## trh411 (Mar 30, 2014)

I am at a loss to explain why it would report an existing file as "not found". I am also at a loss to explain why you are encountering so many strange errors when I can get clean builds using the same port versions on the same version of FreeBSD.

How about your /etc/make.conf file? Can you post it, please? Do you have an /etc/src.conf file? If so, can you post that too, please?

Have all your builds been from ports? You haven't intermixed a package install in here somewhere have you?


----------



## Anonymous (Mar 30, 2014)

/etc/make.conf:

```
.include "/usr/local/etc/ports_sites.conf"
.if !defined(NO_CCACHE)
CC=/usr/local/libexec/ccache/world/clang33
CXX=/usr/local/libexec/ccache/world/clang++33
##CPP=/usr/local/libexec/ccache/world/clang-cpp
.endif
#CCACHE_CPP2="YES"
.if ${.CURDIR:M/usr/ports/*}
CFLAGS+="-m64"
.endif
WRKDIRPREFIX=/ram
WITH_CCACHE_BUILD=yes
WITH_PKGNG="YES"
```


```
/etc/src.conf: No such file or directory
```

I have tried it also without CCACHE.


----------



## trh411 (Mar 30, 2014)

That all looks good, and you have already tried the one thing I would have suggested, namely, to try the build without devel/ccache.

Sorry to say that right now I am all out of ideas. If I think of something else to try I'll get back to you.


----------



## wblock@ (Mar 31, 2014)

talsamon said:
			
		

> /etc/make.conf:




```
.include "/usr/local/etc/ports_sites.conf"
```
What is in that file?


```
.if !defined(NO_CCACHE)
CC=/usr/local/libexec/ccache/world/clang33
CXX=/usr/local/libexec/ccache/world/clang++33
##CPP=/usr/local/libexec/ccache/world/clang-cpp
.endif
#CCACHE_CPP2="YES"
```
None of that should be needed on FreeBSD 10.


```
.if ${.CURDIR:M/usr/ports/*}
CFLAGS+="-m64"
.endif
```
Do not set CFLAGS.  It is the first thing to suspect when there are problems and the last thing to do if you want to avoid them.


```
WRKDIRPREFIX=/ram
```
Why?  Assuming that's a RAM disk, it limits the amount of memory available to build, and saves little time.


```
WITH_CCACHE_BUILD=yes
```
I do not use devel/ccache at all any more on FreeBSD 10.  I can't recall if merely setting NO_CCACHE was enough to avoid problems, though.


----------



## Anonymous (Mar 31, 2014)

`uname -a
9.2-RELEASE-p3 FreeBSD 9.2-RELEASE-p3`

I think the problem is related with the update from fpc-2.6.2 to fpc-2.6.4,1.


----------



## Anonymous (Mar 31, 2014)

The solution was simple. After `rm -rf /usr/local/share/lazarus/*` everything compiles fine.


----------



## trh411 (Mar 31, 2014)

talsamon said:
			
		

> The solution was simple. After `rm -rf /usr/local/share/lazarus/*` everything compiles fine.


Thanks for sharing the solution.


----------

