savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.4k stars 130 forks source link

Problem with rqueue.mli when compiling from souce #473

Closed count00zero closed 7 years ago

count00zero commented 7 years ago

Hi there,

I'm trying to build the "new" 1.3.1 from source.

Whenever i do a make I get this:

File "tools/rqueue.ml", line 1:
Error: Could not find the .cmi file for interface tools/rqueue.mli.

Does anyone have a solution for that behaviour (I'm using taglib-1.11.1 built with -fPIC)

Unfortunately opam install liquidsoap doesn't work:

# tzlib.cpp:(.text+0x62): Nicht definierter Verweis auf `inflateInit_'
# tzlib.cpp:(.text+0x193): Nicht definierter Verweis auf `inflate'
# tzlib.cpp:(.text+0x1d5): Nicht definierter Verweis auf `inflateEnd'
# tzlib.cpp:(.text+0x268): Nicht definierter Verweis auf `inflateEnd'

Thx a lot upfront :)

BR, count (ubuntu 17.04 on x64)

toots commented 7 years ago

Hi,

There's a fix for the taglib issue, will release soon.

You other issue can be caused by many different reasons. Could you post more about how you are compiling, logs and command lines?

mooseh commented 7 years ago

we are having the same issue, we use an ansible playbook so it has every comand just how you wanna see it.

  - name: update the source list
    apt_repository:
      repo: "{{ item }}"
    with_items:
      - deb http://ftp.uk.debian.org/debian/ jessie main non-free
      - deb-src http://ftp.uk.debian.org/debian/ jessie main non-free
      - deb http://www.deb-multimedia.org jessie main non-free
    become: yes

  - name: update the apt cache
    apt: update_cache=yes name=deb-multimedia-keyring force=yes
    become: yes

  - name: install the liquidsoap requirements
    apt: update_cache=yes name="{{ item }}"
    become: yes
    with_items:
      - libfdk-aac0
      - libfdk-aac-dev
      - build-essential
      - libpcre3-dev
      - pkg-config
      - rsync
      - mercurial
      - darcs
      - m4
      - unzip
      - autoconf
      - aspcud
      - libncurses5-dev
      - libncursesw5-dev
      - libtaglib-ocaml-dev

  - name: get opam and install
    shell: wget https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh -O - | sh -s /usr/local/bin/
    ignore_errors: yes
    become: yes

  - name: change opam env
    shell: eval `opam config env`

  - name: install final packages
    apt: name="{{ item }}" state=latest
    become: yes
    with_items:
      - libao-dev
      - libportaudio-ocaml-dev
      - ocaml-findlib
      - libao-ocaml-dev
      - libportaudio-ocaml-dev
      - libmad-ocaml-dev
      - libtaglib-ocaml-dev
      - libalsa-ocaml-dev
      - libvorbis-ocaml-dev
      - libladspa-ocaml-dev
      - libxmlplaylist-ocaml-dev
      - libflac-dev
      - libxml-dom-perl
      - libxml-dom-xpath-perl
      - patch
      - autoconf
      - libmp3lame-dev
      - libcamlimages-ocaml-dev
      - libtool
      - libpulse-dev
      - camlidl
      - libfaad-dev
      - libpcre-ocaml-dev
      - libopus-ocaml
      - libopus-dev

  - name: set the users env
    shell: y '' | opam init --comp=4.02.3

  - name: change opam env
    shell: eval `opam config env`

  - name: update and upgrade opam
    shell: opam update && opam upgrade

  - name: install opam packages
    shell: opam install lame opus pcre mad vorbis camomile base-bytes camlp4 depext xmlm taglib cry

  - name: opam depext
    shell: y '' | opam depext

  - name: git clone liquidsoap source code
    git: repo=https://github.com/savonet/liquidsoap-full dest=/home/liquid/liquidsoap-full clone=yes

  - name: make init
    make:
      chdir: /home/liquid/liquidsoap-full
      target: init

  - name: make update
    make:
      chdir: /home/liquid/liquidsoap-full
      target: update

  - name: get the packages in order
    shell: cp PACKAGES.minimal PACKAGES
    args:
      chdir: /home/liquid/liquidsoap-full

  - name: enable ocaml-portaudio
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-portaudio'
      line: 'ocaml-portaudio'

  - name: enable ocaml-alsa
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-alsa'
      line: 'ocaml-alsa'

  - name: enable ocaml-pulseaudio
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-pulseaudio'
      line: 'ocaml-pulseaudio'

  - name: enable ocaml-faad
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-faad'
      line: 'ocaml-faad'

  - name: enable ocaml-opus
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-opus'
      line: 'ocaml-opus'

  - name: enable ocaml-fdkaac
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-fdkaac'
      line: 'ocaml-fdkaac'

  - name: boostrap liquidsoap
    shell: ./bootstrap
    args:
      chdir: /home/liquid/liquidsoap-full

  - name: make sure we install any missing packages from opam
    shell: y '' | opam depext taglib mad lame vorbis cry

  - name: add to rc.local create liquidsoap running file
    lineinfile: dest=/etc/rc.local line='chown liquidsoap:liquidsoap /var/run/liquidsoap'
    become: yes

  - name: create the liquidsoap running directory
    file: path=/var/run/liquidsoap state=directory owner=liquid group=liquid
    become: yes

  - name: make the liquidsoap directory
    file: path=/etc/liquidsoap state=directory owner=liquid group=liquid
    become: yes

  - name: set env and configure (ignore opam moaning)
    shell: y '' | opam init && eval `opam config env`  && ./configure
    args:
      chdir: /home/liquid/liquidsoap-full/
    ignore_errors: yes

  - name: set env and  make
    shell: y '' | opam init && eval `opam config env` && make
    args:
      chdir: /home/liquid/liquidsoap-full

  - name: make install liquidsoap
    shell: y '' | opam init && eval `opam config env` && make install
    args:
      chdir: /home/liquid/liquidsoap-full
    become: yes

(thankyou to smimram for making this code appear correctly)

toots commented 7 years ago

Ok, so most of this seems mixed-up to me. Here's a question: do you need the latest source code or are you happy with just the latest released liquidsoap?

mooseh commented 7 years ago

latest source code, this playbook was working last week without a hitch :)

toots commented 7 years ago

It's working but there are a lot of things that you don't know, in particular opam. If you're compiling from liquidsoap-full, you should not use opam.. Here's a try:

mooseh commented 7 years ago

when we didnt use opam, we had ALOT of missing packages, we are completely debian, we dont touch ubuntu

toots commented 7 years ago
  - name: update the source list
    apt_repository:
      repo: "{{ item }}"
    with_items:
      - deb http://ftp.uk.debian.org/debian/ jessie main non-free
      - deb-src http://ftp.uk.debian.org/debian/ jessie main non-free
      - deb http://www.deb-multimedia.org jessie main non-free
    become: yes

  - name: install the liquidsoap requirements
    apt: update_cache=yes name="{{ item }}"
    become: yes
    with_items:
      - ocaml-nox
      - ladspa-sdk
      - libxmlm-ocaml-dev
      - libfdk-aac0
      - libfdk-aac-dev
      - build-essential
      - libpcre3-dev
      - pkg-config
      - libncurses5-dev
      - libncursesw5-dev
      - libao-dev
      - ocaml-findlib
      - libflac-dev
      - libxml-dom-perl
      - libxml-dom-xpath-perl
      - patch
      - autoconf
      - automake
      - libmp3lame-dev
      - libcamlimages-ocaml-dev
      - libtool
      - libpulse-dev
      - portaudio19-dev
      - libfaad-dev
      - libpcre-ocaml-dev
      - libcamomile-ocaml-dev
      - libopus-dev

  - name: git clone liquidsoap source code
    git: repo=https://github.com/savonet/liquidsoap-full dest=/home/liquid/liquidsoap-full clone=yes

  - name: make init
    make:
      chdir: /home/liquid/liquidsoap-full
      target: init

  - name: make update
    make:
      chdir: /home/liquid/liquidsoap-full
      target: update

  - name: get the packages in order
    shell: cp PACKAGES.minimal PACKAGES
    args:
      chdir: /home/liquid/liquidsoap-full

  - name: enable ocaml-portaudio
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-portaudio'
      line: 'ocaml-portaudio'

  - name: enable ocaml-alsa
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-alsa'
      line: 'ocaml-alsa'

  - name: enable ocaml-ao
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-ao'
      line: 'ocaml-ao'

  - name: enable ocaml-pulseaudio
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-pulseaudio'
      line: 'ocaml-pulseaudio'

  - name: enable ocaml-portaudio
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-portaudio'
      line: 'ocaml-portaudio'

  - name: enable ocaml-ladspa
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-ladspa'
      line: 'ocaml-ladspa'

  - name: enable ocaml-xmlplaylist
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-xmlplaylist'
      line: 'ocaml-xmlplaylist'

  - name: enable ocaml-faad
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-faad'
      line: 'ocaml-faad'

  - name: enable ocaml-opus
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-opus'
      line: 'ocaml-opus'

  - name: enable ocaml-fdkaac
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-fdkaac'
      line: 'ocaml-fdkaac'

  - name: enable ocaml-taglib
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-taglib'
      line: 'ocaml-taglib'

  - name: enable ocaml-mad
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-mad'
      line: 'ocaml-mad'

  - name: enable ocaml-lame
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-lame'
      line: 'ocaml-lame'

  - name: enable ocaml-ogg
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-ogg'
      line: 'ocaml-ogg'

  - name: enable ocaml-vorbis
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-vorbis'
      line: 'ocaml-vorbis'

  - name: enable ocaml-flac
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-flac'
      line: 'ocaml-flac'

  - name: enable ocaml-cry
    lineinfile:
      dest: /home/liquid/liquidsoap-full/PACKAGES
      regexp: '^#ocaml-cry'
      line: 'ocaml-cry'

  - name: boostrap liquidsoap
    shell: ./bootstrap
    args:
      chdir: /home/liquid/liquidsoap-full

  - name: add to rc.local create liquidsoap running file
    lineinfile: dest=/etc/rc.local line='chown liquidsoap:liquidsoap /var/run/liquidsoap'
    become: yes

  - name: create the liquidsoap running directory
    file: path=/var/run/liquidsoap state=directory owner=liquid group=liquid
    become: yes

  - name: make the liquidsoap directory
    file: path=/etc/liquidsoap state=directory owner=liquid group=liquid
    become: yes

  - name: configure
    shell: ./configure
    args:
      chdir: /home/liquid/liquidsoap-full/
    ignore_errors: yes

  - name: make
    shell: make
    args:
      chdir: /home/liquid/liquidsoap-full

  - name: make install liquidsoap
    shell: make install
    args:
      chdir: /home/liquid/liquidsoap-full
    become: yes
toots commented 7 years ago

Couple of remarks:

toots commented 7 years ago

Here's how it would work with just opam:

  - name: install ocaml-nox and opam
    apt: update_cache=yes name="{{ item }}"
    become: yes
    with_items:
      - ocaml-nox
      - opam

  - name: set the users env
    shell: y '' | opam init

  - name: update and upgrade opam
    shell: opam update && opam upgrade

  - name: install opam depext
    shell: y '' | opam install depext

  - name: install external dependencies
    shell: y '' | opam depext lame opus pcre mad vorbis alsa liquidsoap # More dependencies here!

  - name: install liquidsoap and dependencies
    shell: y '' | opam install lame opus pcre mad vorbis alsa liquidsoap # More dependencies here!

  - name: add to rc.local create liquidsoap running file
    lineinfile: dest=/etc/rc.local line='chown liquidsoap:liquidsoap /var/run/liquidsoap'
    become: yes

  - name: create the liquidsoap running directory
    file: path=/var/run/liquidsoap state=directory owner=liquid group=liquid
    become: yes

  - name: make the liquidsoap directory
    file: path=/etc/liquidsoap state=directory owner=liquid group=liquid
    become: yes

The only part that I have no idea about how it works is the daemonization part. Liquisdsoap will end-up in a custom location like: /home/toots/.opam/4.05.0/bin/liquidsoap so you'll need to adapt the daemon script. You can look at: https://github.com/savonet/liquidsoap-daemon there is a opam package for it as well.

mooseh commented 7 years ago

thank I'll give this a go, I did have a really small one with opam whivh was super easy, but we play around with the code in source a little before which is why i had to source it only, unfortunately all 3 extra packages we use, I'm pretty sure our business and your business will be meeting in person in the near future :)

Thanks for really really great answers.

Kind Regards MooseH

count00zero commented 7 years ago

Hi there,

thank you! I did exactly as proposed by your playbook (but excluded fdkaac & faad); so u might know my commands for this compile-try-iteration :) and now i get this:

Error: The implementation tools/server.ml
       does not match the interface tools/server.cmi:
       The value `exec' is required but not provided
       The value `remove' is required but not provided
       The value `add' is required but not provided
       The value `unregister' is required but not provided
       The value `register' is required but not provided
       The value `to_string' is required but not provided
       The type `namespace' is required but not provided
       The value `conf_telnet_port' is required but not provided
       The value `conf_telnet_bind_addr' is required but not provided
       The value `conf_telnet' is required but not provided
       The value `conf_socket_perms' is required but not provided
       The value `conf_socket_path' is required but not provided
       The value `conf_socket' is required but not provided
       The value `conf' is required but not provided

so now I'm somewhat confused :-o

mooseh commented 7 years ago

same issue

File "tools/rqueue.ml", line 1: Error: Could not find the .cmi file for interface tools/rqueue.mli. ../Makefile.rules:192: recipe for target 'tools/rqueue.cmx' failed make[3]: [tools/rqueue.cmx] Error 2 make[3]: Leaving directory '/home/sharpstream/liquidsoap-full/liquidsoap/src' ../Makefile.rules:67: recipe for target 'all-auto-ocaml-prog' failed make[2]: [all-auto-ocaml-prog] Error 2 make[2]: Leaving directory '/home/sharpstream/liquidsoap-full/liquidsoap/src' Makefile.rules:27: recipe for target 'all-subdirs' failed make[1]: [all-subdirs] Error 2 make[1]: Leaving directory '/home/sharpstream/liquidsoap-full/liquidsoap' Makefile:11: recipe for target 'all' failed make: [all] Error 1

also needed to add to more requirements

      - libtag1-dev
      - libmad0-dev
toots commented 7 years ago

Ok. Y'all have more logs of the build? It's hard to tell what's wrong without them..

count00zero commented 7 years ago

OK, i did log the whole configure & make cycle. They are attached here ...

By the way, thank you for spending time to investigate!!!!

Best regards, count

make.txt configure.txt

toots commented 7 years ago

Of course!

Sorry, I stil cannot use it, could you try the following for make:

LANG=C make clean
LANG=C make

Thanks!

count00zero commented 7 years ago

I did that, but I can not detect any difference.

BR, count make.txt clean.txt

mooseh commented 7 years ago

Hi guys got a working playbook for you all <3 enjoy :), the REALLY weird thing is the tarball works but the git clone didnt, don't ask me why haha. note (if you are having more packages than me there will be more required debian packages)

opam is used to retrieve what you cannot retrieve in debian.

also you have to re init with opam and ansible a lot for some odd reason, I think it re-initiates an ssh connection causing the bash rc to reset oddly.

also please note this is for MY setup so there may be some extra non-required packages.

---
- hosts: all
  remote_user: liquidaudio
  become_method: sudo

  tasks:

  - name: update the source list
    apt_repository:
      repo: "{{ item }}"
    with_items:
      #- deb http://ftp.uk.debian.org/debian/ jessie main non-free
      #- deb-src http://ftp.uk.debian.org/debian/ jessie main non-free
      - deb http://www.deb-multimedia.org jessie main non-free
    become: yes

  - name: update the apt cache
    apt: update_cache=yes name=deb-multimedia-keyring force=yes
    become: yes

  - name: get opam and install
    shell: wget https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh -O - | sh -s /usr/local/bin/
    ignore_errors: yes
    become: yes

  - name: change opam env
    shell: eval `opam config env`

  - name: install final packages
    apt: name="{{ item }}" state=latest
    become: yes
    with_items:
      - libao-dev
      - libportaudio-ocaml-dev
      - ocaml-findlib
      - libao-ocaml-dev
      - libportaudio-ocaml-dev
      - libmad-ocaml-dev
      - libtaglib-ocaml-dev
      - libalsa-ocaml-dev
      - libvorbis-ocaml-dev
      - libladspa-ocaml-dev
      - libxmlplaylist-ocaml-dev
      - libflac-dev
      - libxml-dom-perl
      - libxml-dom-xpath-perl
      - patch
      - autoconf
      - libmp3lame-dev
      - libcamlimages-ocaml-dev
      - libtool
      - libpulse-dev
      - camlidl
      - libfaad-dev
      - libpcre-ocaml-dev
      - libopus-ocaml
      - libopus-dev
      - libfdk-aac-dev
      - build-essential
      - libpcre3-dev
      - pkg-config
      - rsync
      - mercurial
      - darcs
      - m4
      - unzip
      - autoconf
      - aspcud
      - libncurses5-dev
      - libncursesw5-dev
      - libtaglib-ocaml-dev
      - camlp4-extra

  - name: set the users env
    shell: y '' | opam init

  - name: change opam env
    shell: eval `opam config env`

  - name: update and upgrade opam
    shell: opam update && opam upgrade

  - name: install opam packages
    shell: opam install lame opus pcre mad vorbis camomile base-bytes camlp4 depext xmlm taglib cry dtools mm duppy

  - name: get liquidsoap tarball
    get_url: url=https://github.com/savonet/liquidsoap/releases/download/1.3.1/liquidsoap-1.3.1-full.tar.bz2 dest=/home/liquidaudio/liquidsoap-1.3.1-full.tar.bz2

  - name: extract liquidsoap
    shell: tar -xvf /home/liquidaudio/liquidsoap-full.tar.bz2

  - name: get the packages in order
    shell: cp PACKAGES.minimal PACKAGES
    args:
      chdir: /home/liquidaudio/liquidsoap-1.3.1-full

  - name: enable ocaml-portaudio
    lineinfile:
      dest: /home/liquidaudio/liquidsoap-1.3.1-full/PACKAGES
      regexp: '^#ocaml-portaudio'
      line: 'ocaml-portaudio'

  - name: enable ocaml-alsa
    lineinfile:
      dest: /home/liquidaudio/liquidsoap-1.3.1-full/PACKAGES
      regexp: '^#ocaml-alsa'
      line: 'ocaml-alsa'

  - name: enable ocaml-pulseaudio
    lineinfile:
      dest: /home/liquidaudio/liquidsoap-1.3.1-full/PACKAGES
      regexp: '^#ocaml-pulseaudio'
      line: 'ocaml-pulseaudio'

  - name: enable ocaml-faad
    lineinfile:
      dest: /home/liquidaudio/liquidsoap-1.3.1-full/PACKAGES
      regexp: '^#ocaml-faad'
      line: 'ocaml-faad'

  - name: enable ocaml-opus
    lineinfile:
      dest: /home/liquidaudio/liquidsoap-1.3.1-full/PACKAGES
      regexp: '^#ocaml-opus'
      line: 'ocaml-opus'

  - name: enable ocaml-fdkaac
    lineinfile:
      dest: /home/liquidaudio/liquidsoap-1.3.1-full/PACKAGES
      regexp: '^#ocaml-fdkaac'
      line: 'ocaml-fdkaac'

  - name: boostrap liquidsoap
    shell: ./bootstrap
    args:
      chdir: /home/liquidaudio/liquidsoap-1.3.1-full

  - name: make sure we install any missing packages from opam
    shell: y '' | opam depext taglib mad lame vorbis cry

  - name: add to rc.local create liquidsoap running file
    lineinfile: dest=/etc/rc.local line='chown liquidsoap:liquidsoap /var/run/liquidsoap'
    become: yes

  - name: create the liquidsoap running directory
    file: path=/var/run/liquidsoap state=directory owner=liquidaudio group=liquidaudio
    become: yes

  - name: make the liquidsoap directory
    file: path=/etc/liquidsoap state=directory owner=liquidaudio group=liquidaudio
    become: yes

  - name: set env and configure
    shell: y '' | opam init && eval `opam config env`  && ./configure
    args:
      chdir: /home/liquidaudio/liquidsoap-1.3.1-full/
    ignore_errors: yes

  - name: set env and  make
    shell: y '' | opam init && eval `opam config env` && make
    args:
      chdir: /home/liquidaudio/liquidsoap-1.3.1-full

  - name: make install liquidsoap
    shell: y '' | opam init && eval `opam config env` && make install
    args:
      chdir: /home/liquidaudio/liquidsoap-1.3.1-full
    become: yes

  - name: make the liquidsoap log directory
    file: path=/var/log/liquidsoap state=directory owner=liquidaudio group=liquidaudio
    become: yes
count00zero commented 7 years ago

Thanks for your effort!!

I did as you proposed and used the tarball. Now I partially back to my old "problem" which is:

/usr/bin/ld: /usr/local/lib/libtag.a(tzlib.cpp.o): undefined reference to symbol 'inflateEnd'
//lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
count00zero commented 7 years ago

Now I did also an opam reinstall and now this, I dont know what to do any further ...

File "outputs/graphics_out.ml", line 35, characters 4-23:
Error: Unbound module Graphics
../Makefile.rules:192: die Regel für Ziel „outputs/graphics_out.cmx“ scheiterte
make[3]: *** [outputs/graphics_out.cmx] Fehler 2
toots commented 7 years ago

For graphics failures, just pass --disable-graphics at configure.

@mooseh: I'm glad that your script works. I still believe that it could be cleanup further but, as we say in french, perhaps you don't want to change a winning team..

I'm gonna close this guys, I think this discussion should continue on savonet-users@lists.sourceforge.net

toots commented 7 years ago

Ok guys, my bad. There was indeed an issue in the latest git build. Should be fixed now.

count00zero commented 7 years ago

Hurraaa ... I was able to compile it with the latest 1.3.2 Version and with --without-curl