# Compile liquidsoap.



## djmentos (Sep 15, 2014)

Hello.

Liquidsoap is no longer available in the ports collection, so I try to compile it manually. But it returns me an error:

```
File "configure.ml", line 1:
Error: /usr/local/lib/ocaml/site-lib/camomile/camomileLibraryDyn.cmi
is not a compiled interface for this version of OCaml.
It seems to be for an older version of OCaml.
```
And I don't know how to resolve it. Could you help me, please?

---
EDIT. I solve that by OCAML rebuidl. But now I have another trouble.
`./configure` returns me:

```
...
checking lame/lame.h usability... no
checking lame/lame.h presence... no
checking for lame/lame.h... no
configure: error: Cannot find liblame.
```
liblame and audio/lame aren't same?

```
# pkg info | grep lame
lame-3.99.5_2                  Fast MP3 encoder kit
```


----------



## talsamon (Sep 15, 2014)

```
less /usr/ports/MOVED|grep liquidsoap
audio/liquidsoap||2014-09-01|Not staged
```


----------



## djmentos (Sep 15, 2014)

I wrote:


> Liquidsoap is no longer available in the ports collection, so I try to compile it manually.



So it is obvius it will be not available in ports tree... Manually = from source, tarball downloaded from liquidsoap's site.


----------



## talsamon (Sep 15, 2014)

Sorry, I overlooked the first line.

from the Makefile


```
# xmplapalylist disabled now: missing ocaml-xmlm port
#               XMLPLAYLIST     "support various xml format (rss/podcast/etc)"  Off \
# lastfm requires xmlplaylist
#               LASTFM          "radios and the audioscrobbler (need XMLPLAYLIST)"      Of
f
#               port unbuildable now without lame. Enabled permanently
#               LAME            "for MP3 encoding"      On
#       portuaudio unbuildable now
#               PORTAUDIO       "portable audio library with both input and output"     Off
```


----------



## talsamon (Sep 15, 2014)

I think you have to modify configure.ac

```
# Check for liblame
LAME_LIBS="-lmp3lame -lm"
LAME_CFLAGS=""
LAME_CPPFLAGS=""
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $LAME_CPPFLAGS"
CFLAGS="$CFLAGS $LAME_CFLAGS"
LIBS="$LAME_LIBS $LIBS"
AC_CHECK_HEADERS([lame/lame.h], [
AC_CHECK_FUNC([lame_init], [ac_have_lame="yes"])
])
```

It checks mp3lame - but I find only a libmp3lame. It also checks lame.h , isn't there on the system.
Sorry, that was wrong it is in /usr/local/include/lame/lame.h.


----------



## SirDice (Sep 15, 2014)

Before the port was removed it was marked "BROKEN" because it refused to link properly.


----------



## djmentos (Sep 15, 2014)

> Before the port was removed it was marked "BROKEN" because it refused to link properly.


I know it. It was removed on 31. Sep. It doesn't compile due to libTag build error. But I am not a programist and I can't fix it.



> I think you have to modify configure.ac


I tried it. But any modification returns:

```
~/liquidsoap-1.1.1-full/ocaml-lame-0.3.2# autoconf
configure.ac:6: error: possibly undefined macro: AC_BASE_CHECKS
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
```

If I will make just ./configure it returns:
with: LAME_LIBS="-libmp3lame -lm"

```
./configure --with-cry-dir=../ocaml-cry-0.2.2/src --with-ao-dir=../ocaml-ao-0.2.0/src --with-mad-dir=../ocaml-mad-0.4.4/src --with-taglib-dir=../ocaml-taglib-0.3.1/src --with-lame-dir=../ocaml-lame-0.3.2/src
configure: WARNING: unrecognized options: --with-cry-dir, --with-ao-dir, --with-mad-dir, --with-taglib-dir, --with-lame-dir
configuring ocaml-lame 0.3.2
first-class modules not supported by the compiler, disabling shared modules
checking for gcc... no
checking for cc... cc
checking whether the C compiler works... no
configure: error: in `/home/daniel/liquidsoap-1.1.1-full/ocaml-lame-0.3.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
```


----------



## talsamon (Sep 16, 2014)

It should be: 
	
	



```
LAME_LIBS="-llibmp3lame -lm"
```
 There must be a "l" before the name of the library.
Without programming knowledge it will be very hard, that you will find all the things you have to modify. 
What do you need? Perhaps we can find a program that can replace liquidsoap.


----------



## djmentos (Sep 16, 2014)

Ok, may be it isn't properly solution, but works 
lame/lame.h is only in /usr/local/include
`./configure` finds stdint.h - it is only in two locations:
/usr/include and /usr/local/include. 

If configure doesn't see lame from /usr/local/include I copied it to /usr/src. In this case `./configure` returned:

```
checking for lame/lame.h... [b]yes[/b]
checking for lame_init... no
configure: error: Cannot find liblame.
```

It was closer. I did the same way with libmp3lame.so  - copied from /usr/local/lib to /usr/lib and it works.


----------



## talsamon (Sep 16, 2014)

Do you read the INSTALL file ??


```
*BSD users, as well as OSX users might need to export some variables that can be
missing during the process:

   % export CPPFLAGS=-I/usr/local/include
   % export LDFLAGS=-L/usr/local/lib
   % export OCAMLMKLIB_FLAGS=-L/usr/local/lib
```


----------



## djmentos (Sep 16, 2014)

Sure, it didn't helped. As well `./configure` ignored switches:
`--includedir=/usr/local/include --oldincludedir=/usr/local/include --libdir=/usr/local/lib`


----------

