Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Compiling Musepack on Linux (Read 16848 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Compiling Musepack on Linux

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: [Select]
./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

Compiling Musepack on Linux

Reply #1
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.

Compiling Musepack on Linux

Reply #2
[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: [Select]
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

Compiling Musepack on Linux

Reply #3
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".

Compiling Musepack on Linux

Reply #4
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: [Select]
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: [Select]
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.

 

Compiling Musepack on Linux

Reply #5
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.

This results in an error when you run cmake in musepack_src:
Code: [Select]
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: [Select]
cmake -DCUEFILE_INCLUDE_DIR:FILEPATH=/usr/local/include/

That might do the trick for you.

Compiling Musepack on Linux

Reply #6
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...

Compiling Musepack on Linux

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