Page 1 of 2

liblzo2 compilation issue

Posted: 23 Jan 2010 15:31
by wiinf
Hi guys,
trying to compile OpenTTD myself. Worked several times, but from one day to another i get the following:

Code: Select all

...
checking lzo2... not found
WARNING: liblzo2 was not detected or disabled
WARNING: OpenTTD doesn't require liblzo2, but it does mean that
WARNING: loading old savegames/scenarios will be disabled.
configure: error: no liblzo2 detected
...
I've looked for the libraries, they're definately where they should be.
Anybody got an idea what the problem might be?

Re: liblzo2 compilation issue

Posted: 23 Jan 2010 15:35
by Rubidium
Yes. We removed minilzo in our sources and now depend on the library. Maintaining a 'clone' of minilzo (which is basically liblzo2) in our code was too much effort in trying to keep up-to-date; especially the compile warnings it gave us. Also several Linux distributions don't like it when "upstream" contains code that is copied from another project.

As you've only given the error and no extra information (like OS or packages you tried) I can't help you with solving the issue.

Re: liblzo2 compilation issue

Posted: 23 Jan 2010 15:41
by wiinf
Ok, that clears things up a bit.
I'm on Mac OS X 10.5 and have installed lzo2 through macports which puts liblzo2.dylib in /opt/local/lib.

Re: liblzo2 compilation issue

Posted: 23 Jan 2010 15:47
by Rubidium
Sounds like you're missing the development headers.

Re: liblzo2 compilation issue

Posted: 23 Jan 2010 15:51
by wiinf
And how do i get them? I tried installing lzo2-dev through macports, but that doesn't exist...

Re: liblzo2 compilation issue

Posted: 27 Jan 2010 16:32
by wiinf
Can nobody help me here?

Re: liblzo2 compilation issue

Posted: 27 Jan 2010 16:39
by Rubidium
wiinf wrote:Can nobody help me here?
If you look in the 'Future of the Mac OS X port' thread you'll see that there are very few Mac OS X users that know enough to compile OpenTTD. I'd love to help you, but I've got absolutely no clue (nor any Apple product).
I know a bit about the compiler environment in the compile farm, but that is far from standard and everything there is self-compiled and configured from scratch to our needs. In other words, what would work for the compile farm does almost certainly not work for you, e.g. I doubt you have a /usr/apple-darwin9 directory.

Re: liblzo2 compilation issue

Posted: 27 Jan 2010 17:22
by planetmaker
wiinf wrote:And how do i get them? I tried installing lzo2-dev through macports, but that doesn't exist...
if you symlink the dirs and files from the /opt/... dirs to the /usr/... dirs it worked for me. I don't call that a desirable solution, though.

Re: liblzo2 compilation issue

Posted: 27 Jan 2010 21:54
by wiinf
planetmaker wrote:if you symlink the dirs and files from the /opt/... dirs to the /usr/... dirs it worked for me. I don't call that a desirable solution, though.
That's what i guessed too. Nonetheless, nothing. Doesn't work...
Edit: I even tried copying the files and passing the /opt/...-directory to the configure script via env CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib" ./configure. Doesn't work either way...

Re: liblzo2 compilation issue

Posted: 31 Jan 2010 11:56
by wiinf
Any other ideas?

Re: liblzo2 compilation issue

Posted: 02 Feb 2010 15:07
by wiinf
Ok, other question: What are the consequences if i configure and compile with --without-liblzo2 ?

Re: liblzo2 compilation issue

Posted: 02 Feb 2010 15:20
by planetmaker
You won't be able to load certain types of savegames.

Re: liblzo2 compilation issue

Posted: 05 Feb 2010 22:27
by John
I thought I would also add that I do am struggling with liblzo2 on Mac OS X 10.5.8.

Same problem as above ./configure leads to a liblzo2 not found error.

I have tried both macports and fink to install lzo2 but no luck with either.

I have tried symlink as planetmaker suggested, but no luck there. I have a feeling though this was more me doing it wrong though - which files exactly did you symlink planetmaker?

Finally, when I was trying macports I installed the liblzo2 +universal variant (along side the darwin 8 version)- and the ./configure error switched to a "disabled" error for liblzo2.

So anyone got any ideas on getting this to work?
The only things I found which might be relevant is a bug from 2007 where the macports lzo2 library headers pointed to /include/lzo2 instead of /include/lzo which it should have done (and does).

And for those that say "google it" - the only thing that I can find is this thread :(

Re: liblzo2 compilation issue

Posted: 05 Feb 2010 22:44
by ChillCore
The only thing I can think off is that you did not install the lzo2-dev package.

Edit: typo

Re: liblzo2 compilation issue

Posted: 05 Feb 2010 22:45
by Rubidium
This is 'typically' an issue where I would ask the Mac OS X developer to tell how it works/should work and to fix the detection of liblzo2 might it be broken for Mac OS X. Point is, there is no Mac OS X developer.

Re: liblzo2 compilation issue

Posted: 05 Feb 2010 23:17
by planetmaker
Actually...

macports installs liblzo2 just fine. It is also detected. "Only" thing I do get is a bunch of warnings about undefined labels which also must not be defined. Looks rather like a compiler (warning) issue:

Code: Select all

In file included from /opt/local/include/lzo/lzoconf.h:72,
                 from /opt/local/include/lzo/lzo1x.h:45,
                 from /Users/ingo/ottd/trunk/src/saveload/saveload.cpp:1248:
/opt/local/include/lzo/lzodefs.h:434:6: warning: "LZO_OS_DOS16" is not defined
/opt/local/include/lzo/lzodefs.h:434:22: warning: "LZO_OS_OS216" is not defined
/opt/local/include/lzo/lzodefs.h:434:38: warning: "LZO_OS_WIN16" is not defined
(...)
Each line is caused by an expression in the code of the form

Code: Select all

#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
within /opt/local/include/lzo/lzodefs.h

Re: liblzo2 compilation issue

Posted: 06 Feb 2010 00:48
by Rubidium
Those warnings can be 'solved' by marking that include directory as a 'system' include directory, i.e. -isystem <path>.

Re: liblzo2 compilation issue

Posted: 12 Feb 2010 01:02
by Paploo
John wrote:Finally, when I was trying macports I installed the liblzo2 +universal variant (along side the darwin 8 version)- and the ./configure error switched to a "disabled" error for liblzo2.
Have any of you tried compiling the liblzo2 lib from source?

In my experience, there are a *lot* more issues when attempting to lean on macports or fink libraries to compile your apps than when one goes through the extra effort of compiling them themselves.

On 10.6.2 I was able to download, lzo-2.03, compile it, run its tests, and install, all in about 5 minutes. A quick check of ./configure on the 1.0.0b4 source (with include of macos.h header bug fixed) shows that it recognizes the library, so the only thing left to do is compile. :)

Re: liblzo2 compilation issue

Posted: 12 Feb 2010 01:20
by Paploo
Paploo wrote:
John wrote:Finally, when I was trying macports I installed the liblzo2 +universal variant (along side the darwin 8 version)- and the A quick check of ./configure on the 1.0.0b4 source (with include of macos.h header bug fixed) shows that it recognizes the library, so the only thing left to do is compile. :)
A quick "make mrproper && ./configure && make && make bundle", and OpenTTD 1.0.0b4 boots fine, complete with liblzo2 support!

(I'm assuming make mrproper is a better choice than make clean since I needed to rebuild the configure file, but I'm sure an actual OpenTTD dev would know better if this is the appropriate action). :)

Re: liblzo2 compilation issue

Posted: 12 Feb 2010 06:25
by Hai
I got an error complaining the lzo1x.h could not be found during compilation with lzo2 enabled.

I edited crashlog.cpp and saveload/saveload.cpp and changed the include statement to

#include </opt/local/include/lzo/lzo1x.h>

from

#include <lzo/lzo1x.h>

to reflect the location of where macports installed lzo2 headers.