IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Compiling Musepack on Linux
polemon
post Jan 5 2011, 18:12
Post #1





Group: Members
Posts: 144
Joined: 1-April 09
Member No.: 68578



Hi, there isn't much documentation on how to get Musepack compiled under Linux.

I'd like to compile it myself, so I've downloaded the source packages:
  • Musepack SV8 libs & tools (r435)
  • libreplaygain (r453)
  • libcuefile (r453)

But I didn't get much further than that.

I did a autoreconf -vif and after running ./configure it seems to run through fine, expect for not finding replaygain.
When running make, I get the error that cuetools/cuefile.h is not found.

Now, I've downloaded both libs with their source codes, but what am I supposed to do with them? should I put them into the musepack_src_r435 directory?
libcuefile doesn't even have a Makefile, should I compile them with gcc manually?

Would be nice to see some better documentation on the build process, or packages that just need:
CODE
./configure
make
make install

In the end, I'd like the Musepack tools and their libs to be compiled and installed, along with libcuefile and libreplaygain.

Cheers,
--polemon


--------------------
-EOF-
Go to the top of the page
+Quote Post
XQYZ
post Jan 6 2011, 02:09
Post #2





Group: Members
Posts: 22
Joined: 12-May 10
Member No.: 80595



Depending on what distro you're running you'll need -dev packages for the libs which contain the header files. The libs you installed are most likely just binary blobs. Now if you install a binary program the program already has the information compiled into it how to access those libs, but if you want to compile something yourself you're gonna need the header (-dev) files to tell your compiler how the program can access the libs.
So you'll probably gonna want to look into your package manager for -dev packages of the libraries you installed. Otherwise you'll need to fetch the header files (.h, .hpp for C/C++) from the source code yourself and copy them somewhere in the include path of your C/C++ compiler.

Looking at the ebuild for libcuefile I see that libcuefile uses cmake to compile, so you might want to read up on that.

This post has been edited by XQYZ: Jan 6 2011, 02:13
Go to the top of the page
+Quote Post
polemon
post Jan 6 2011, 02:22
Post #3





Group: Members
Posts: 144
Joined: 1-April 09
Member No.: 68578



[WIP]

Nevermind, I solved it.

I'm gonna write the how-to in this thread shortly. I just don't feel like doing it right now, because I want to play around with the software a bit...

The trick is to compile and archive libcuefile.a yourself, the rest is quite smoothly.

I'll make a nicer how to out of this blob right here:
CODE
1. download, unpack
2. libreplaygain: autoreconf -vif, ./configure, make, make install
3. libcuefile: (src)
3.1. for file in *c; do gcc -I../include -c -o ${file%%.c}.o $file; done
3.2 ar cru libcuefile.a *o
4. musepack_src:
4.1 autoreconf -vif
4.2 CFLAGS=-I../../libcuefile_r453/include LDFLAGS=-L../../libcuefile_r453/src ./configure
4.3 make, make install


This post has been edited by polemon: Jan 6 2011, 02:37


--------------------
-EOF-
Go to the top of the page
+Quote Post
XQYZ
post Jan 6 2011, 02:50
Post #4





Group: Members
Posts: 22
Joined: 12-May 10
Member No.: 80595



As I was trying to hint that's not how it's supposed to be done. Try this:
cd to the directory and then do a "cmake ."
Now cmake should produce a Makefile for you to use with "make && make install".
Go to the top of the page
+Quote Post
polemon
post Jan 6 2011, 03:35
Post #5





Group: Members
Posts: 144
Joined: 1-April 09
Member No.: 68578



QUOTE (XQYZ @ Jan 6 2011, 02:50) *
As I was trying to hint that's not how it's supposed to be done. Try this:
cd to the directory and then do a "cmake ."
Now cmake should produce a Makefile for you to use with "make && make install".


Problem is, there's obviously a bug:
When you run 'cmake .' inside the libcuefile directory, and then 'make && make install', it installs all but the include files.
This results in an error when you run cmake in musepack_src:
CODE
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUEFILE_INCLUDE_DIR
   used as include directory in directory /home/bereziak/make/musepack_src_r435/mpcchap

I tried setting CUEFILE_INCLUDE_DIR to the directory where I unpacked libcuefile, but to no avail.

To make things work, I manually copied the include directory of libcuefile into /usr/local/include.
Even after doing this, things still don't work as expected, since obviously the CMakeLists.txt in the subfolders of musepack_src are mostly broken.
The only thing that's being installed after running
CODE
cmake .
make
make install

is mpcenc, nothing else. No other binary, no libraries, and no includes.

Until those bugs are resolved, there's no point in using cmake, as it doesn't reliably create what I want. And to circumvent this, I might as well create it with conventional make.
Or maybe a combination, I'll post both solutions, probably. The important thing is, that the tools work as expected.


--------------------
-EOF-
Go to the top of the page
+Quote Post
XQYZ
post Jan 6 2011, 04:26
Post #6





Group: Members
Posts: 22
Joined: 12-May 10
Member No.: 80595



QUOTE (polemon @ Jan 6 2011, 03:35) *
Problem is, there's obviously a bug:
When you run 'cmake .' inside the libcuefile directory, and then 'make && make install', it installs all but the include files.


I looked into it and it's apparently true, the install routine doesn't copy the headers itself. Gentoo's ebuild for example does it manually also.

QUOTE (polemon @ Jan 6 2011, 03:35) *
This results in an error when you run cmake in musepack_src:
CODE
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUEFILE_INCLUDE_DIR
   used as include directory in directory /home/bereziak/make/musepack_src_r435/mpcchap

I tried setting CUEFILE_INCLUDE_DIR to the directory where I unpacked libcuefile, but to no avail.


I'm not sure why this occurs, as it does not behave like this for me, CUEFILE_INCLUDE_DIR is automatically detected (/usr/include instead of /usr/local/include on Gentoo thought) even if I manually compile it without using portage. You can set cmake variables like this thought, they aren't the same as env-variables as you might have noticed:

QUOTE
-D <var>:<type>=<value>
Create a cmake cache entry.

When cmake is first run in an empty build tree, it creates a
CMakeCache.txt file and populates it with customizable settings
for the project. This option may be used to specify a setting
that takes priority over the project's default value. The
option may be repeated for as many cache entries as desired.

CODE
cmake -DCUEFILE_INCLUDE_DIR:FILEPATH=/usr/local/include/

That might do the trick for you.
Go to the top of the page
+Quote Post
polemon
post Jan 6 2011, 05:40
Post #7





Group: Members
Posts: 144
Joined: 1-April 09
Member No.: 68578



I wrote this manual on compiling Musepack under Fedora 14: http://polemon.org/musepack

Both solutions kinda work, but the build process definitely needs debugging...


--------------------
-EOF-
Go to the top of the page
+Quote Post
r2d
post Jan 9 2011, 22:48
Post #8


Musepack Developer


Group: Developer
Posts: 14
Joined: 12-December 06
Member No.: 38630



Hello,

There is a wiki page on compiling Musepack SVN here :
http://trac.musepack.net/trac/wiki/SV8Build
As you have seen, the cmake install targets needs work. Your contributions are welcome.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th September 2014 - 11:26