liblzo2 compilation issue

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

wiinf
Engineer
Engineer
Posts: 14
Joined: 07 Jan 2010 12:07

liblzo2 compilation issue

Post 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?
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: liblzo2 compilation issue

Post 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.
wiinf
Engineer
Engineer
Posts: 14
Joined: 07 Jan 2010 12:07

Re: liblzo2 compilation issue

Post 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.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: liblzo2 compilation issue

Post by Rubidium »

Sounds like you're missing the development headers.
wiinf
Engineer
Engineer
Posts: 14
Joined: 07 Jan 2010 12:07

Re: liblzo2 compilation issue

Post by wiinf »

And how do i get them? I tried installing lzo2-dev through macports, but that doesn't exist...
wiinf
Engineer
Engineer
Posts: 14
Joined: 07 Jan 2010 12:07

Re: liblzo2 compilation issue

Post by wiinf »

Can nobody help me here?
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: liblzo2 compilation issue

Post 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.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: liblzo2 compilation issue

Post 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.
wiinf
Engineer
Engineer
Posts: 14
Joined: 07 Jan 2010 12:07

Re: liblzo2 compilation issue

Post 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...
wiinf
Engineer
Engineer
Posts: 14
Joined: 07 Jan 2010 12:07

Re: liblzo2 compilation issue

Post by wiinf »

Any other ideas?
wiinf
Engineer
Engineer
Posts: 14
Joined: 07 Jan 2010 12:07

Re: liblzo2 compilation issue

Post by wiinf »

Ok, other question: What are the consequences if i configure and compile with --without-liblzo2 ?
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: liblzo2 compilation issue

Post by planetmaker »

You won't be able to load certain types of savegames.
User avatar
John
Tycoon
Tycoon
Posts: 3402
Joined: 05 May 2003 18:44
Location: Cotswolds, UK
Contact:

Re: liblzo2 compilation issue

Post 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 :(
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2852
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: liblzo2 compilation issue

Post by ChillCore »

The only thing I can think off is that you did not install the lzo2-dev package.

Edit: typo
Last edited by ChillCore on 05 Feb 2010 22:46, edited 1 time in total.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: liblzo2 compilation issue

Post 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.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: liblzo2 compilation issue

Post 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
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: liblzo2 compilation issue

Post by Rubidium »

Those warnings can be 'solved' by marking that include directory as a 'system' include directory, i.e. -isystem <path>.
User avatar
Paploo
Engineer
Engineer
Posts: 21
Joined: 10 Jan 2010 03:19
Location: Spokane, WA, USA

Re: liblzo2 compilation issue

Post 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. :)
User avatar
Paploo
Engineer
Engineer
Posts: 21
Joined: 10 Jan 2010 03:19
Location: Spokane, WA, USA

Re: liblzo2 compilation issue

Post 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). :)
Hai
Engineer
Engineer
Posts: 16
Joined: 10 Feb 2010 03:02

Re: liblzo2 compilation issue

Post 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.
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 10 guests