Opened 9 years ago

Closed 9 years ago

#116 closed defect (fixed)

cmake cannot link museekd against libxml++

Reported by: Silver Owned by: lbponey
Priority: major Milestone: Release 0.2.0
Component: museek_general Version: 0.2prerelease (newnet2 branch)
Keywords: Cc: silver.salonen@…

Description

I'm trying to build Museek+ 0.2 (SVN 1026) on FreeBSD. Concerning museekd, it gets built OK, but then:

... [100%] Building CXX object museekd/CMakeFiles/museekd.dir/distributedsocket.cpp.o Linking CXX executable museekd /usr/bin/ld: cannot find -lxml++-2.6 * Error code 1

Concerning libxml++, cmake seems to find it OK - before building:

... -- checking for one of the modules 'libxml++-2.6' -- found libxml++-2.6, version 2.22.0

Attachments (2)

CMakeCache.txt (18.8 KB) - added by Silver 9 years ago.
CMakeCache_without-DCMAKE_LIBRARY_PATH.txt (18.7 KB) - added by Silver 9 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 Changed 9 years ago by lbponey

Status: newassigned

Have you checked that libxml++ is correctly installed?

comment:2 Changed 9 years ago by Silver

Yes, it is: I have /usr/local/lib/libxml++-2.6.so, /usr/local/include/libxml++-2.6 etc. Cmake finds it initially too:

-- checking for one of the modules 'libxml++-2.6' -- found libxml++-2.6, version 2.22.0

comment:3 Changed 9 years ago by lbponey

It seems to be again a problem with the files being installed in /usr/local/. Can you try adding this to the cmake command? (you might need to delete cmake cache files)

-DCMAKE_LIBRARY_PATH=/usr/local/lib

And can you also try to replace "-DCMAKE_REQUIRED_INCLUDES=/usr/local/include" by "-DCMAKE_INCLUDE_PATH=/usr/local/include" and see if the iconv problem reappears?

Thanks!

comment:4 Changed 9 years ago by Silver

I tried both -DCMAKE_LIBRARY_PATH=/usr/local/lib and -DCMAKE_REQUIRED_LIBRARIES=/usr/local/lib, but neither didn't help in this case.

Changing -DCMAKE_REQUIRED_INCLUDES to -DCMAKE_INCLUDE_PATH made the iconv problem reappear indeed.

comment:5 Changed 9 years ago by lbponey

Can you try with:

-DCMAKE_LIBRARY_PATH=/usr/local

and

-DCMAKE_INCLUDE_PATH=/usr/local

(you might need to delete cmake cache files) thanks

comment:6 Changed 9 years ago by Silver

-DCMAKE_INCLUDE_PATH=/usr/local causes the iconv problem to reappear and -DCMAKE_LIBRARY_PATH=/usr/local doesn't change anything.

Maybe the problem isn't that libxml++ isn't found (-- found libxml++-2.6, version 2.22.0), but rather that how it's found - shouldn't it be smth like "-llibxml++-2.6"?

comment:7 Changed 9 years ago by lbponey

I don't know... -lxml++-2.6 is ok though, this is what is used on linux (returned by "pkg-config --libs libxml++-2.6"). Have you tried symlinking libs from /usr/local/lib in /usr/lib?

The -DCMAKE_INCLUDE_PATH is not a problem. I thought it would be more adapted than -DCMAKE_REQUIRED_LIBRARIES, but if it doesn't work... let's stick with -DCMAKE_INCLUDE_PATH!

comment:8 Changed 9 years ago by Silver

Now I did try linking all the libxml++ libraries in /usr/lib, but still nothing :(

But you meant sticking with -DCMAKE_REQUIRED_LIBRARIES, right? As it was the only one that worked concerning iconv.h.

comment:9 Changed 9 years ago by lbponey

Yes, stick with -DCMAKE_REQUIRED_LIBRARIES! I'll look into libxml++ problem.

comment:10 Changed 9 years ago by lbponey

hum. sorry, I think I said something stupid yesterday... stick with "-DCMAKE_REQUIRED_INCLUDES=/usr/local/include"!

Can you attach your CMakeCache.txt file?

Changed 9 years ago by Silver

Attachment: CMakeCache.txt added

comment:11 Changed 9 years ago by anonymous

Hehe, yes, now I noticed the mistake you did. I attached the CMakeCache.txt now.

comment:12 Changed 9 years ago by lbponey

thanks! Was it generated with -DCMAKE_REQUIRED_LIBRARIES or -DCMAKE_LIBRARY_PATH? If yes, I'd also like a cmakecache generated without.

comment:13 Changed 9 years ago by lbponey

Oh, and can you give me the output of this command:

ls -l /usr/local/lib/libxml*

comment:14 Changed 9 years ago by Silver

$ ls -l /usr/local/lib/libxml* -rw-r--r-- 1 root wheel 233086 Oct 6 17:35 /usr/local/lib/libxml++-2.6.a -rwxr-xr-x 1 root wheel 1122 Oct 6 17:35 /usr/local/lib/libxml++-2.6.la lrwxr-xr-x 1 root wheel 17 Oct 6 17:35 /usr/local/lib/libxml++-2.6.so -> libxml++-2.6.so.2 -rwxr-xr-x 1 root wheel 169210 Oct 6 17:35 /usr/local/lib/libxml++-2.6.so.2 -rw-r--r-- 1 root wheel 1434134 Nov 20 10:34 /usr/local/lib/libxml2.a -rwxr-xr-x 1 root wheel 838 Nov 20 10:34 /usr/local/lib/libxml2.la lrwxr-xr-x 1 root wheel 12 Nov 20 10:34 /usr/local/lib/libxml2.so -> libxml2.so.5 -rwxr-xr-x 1 root wheel 1328356 Nov 20 10:34 /usr/local/lib/libxml2.so.5 -rw-r--r-- 1 root wheel 33048 Sep 7 10:11 /usr/local/lib/libxmlparse.a -rwxr-xr-x 1 root wheel 844 Sep 7 10:11 /usr/local/lib/libxmlparse.la lrwxr-xr-x 1 root wheel 16 Sep 7 10:11 /usr/local/lib/libxmlparse.so -> libxmlparse.so.1 -rwxr-xr-x 1 root wheel 38520 Sep 7 10:11 /usr/local/lib/libxmlparse.so.1 -rw-r--r-- 1 root wheel 103404 Sep 7 10:11 /usr/local/lib/libxmltok.a -rwxr-xr-x 1 root wheel 830 Sep 7 10:11 /usr/local/lib/libxmltok.la lrwxr-xr-x 1 root wheel 14 Sep 7 10:11 /usr/local/lib/libxmltok.so -> libxmltok.so.1 -rwxr-xr-x 1 root wheel 102678 Sep 7 10:11 /usr/local/lib/libxmltok.so.1

Changed 9 years ago by Silver

comment:15 Changed 9 years ago by Silver

Hello again.

The problem is resolved now. I just set appropriate values for LDFLAGS and CONFIGURE_ENV while building. Now the basic flags look like this:

LDFLAGS+= -L/usr/local/lib CMAKE_ARGS+= -DCMAKE_REQUIRED_INCLUDES="/usr/local/include" CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"

comment:16 Changed 9 years ago by lbponey

Great! Thanks for working on this! I'm going to update the wiki. Just to be sure: you define those 3 flags before calling cmake? is that right? LDFLAGS+= -L/usr/local/lib

then

CMAKE_ARGS+= -DCMAKE_REQUIRED_INCLUDES="/usr/local/include"

then

CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"

and then

cmake [...]

And now that you've built it, does everything works ok on freebsd?

comment:17 Changed 9 years ago by Silver

I haven't actually built it yet - the process makes my machine terribly slow, so I'm setting up a separate machine for building, installing and testing it fully.

And actually I use FreeBSD ports' system to build/install it, but now I tried compiling it by hand, and that should do it under FreeBSD:

$ mkdir build && cd build

$ export LDFLAGS=-L/usr/local/lib

$ export CONFIGURE_ENV=LDFLAGS="${LDFLAGS}"

$ cmake ../ -DCMAKE_REQUIRED_INCLUDES="/usr/local/include"

comment:18 Changed 9 years ago by Silver

I've now completed initial packaging of Museek 0.2 for FreeBSD. It build and installs just OK and seems to work OK too. I'll give feedback through tickets if I discover any issues through the extensive use.

comment:19 Changed 9 years ago by lbponey

Resolution: fixed
Status: assignedclosed

Ok, thanks for your work!

Note: See TracTickets for help on using tickets.