Closed turian closed 11 months ago
I also try the standard Dockerfile for DawDreamer, even though it for i86, hoping to run through emulation mode.
But now I get this:
import dawdreamer Traceback (most recent call last): File "
", line 1, in File "/DawDreamer/dawdreamer/init.py", line 4, in from .dawdreamer import * ImportError: /DawDreamer/dawdreamer/dawdreamer.so: undefined symbol: PyThread_tss_create [root@ad2496ee1c86 DawDreamer]# python Python 2.7.5 (default, Nov 14 2023, 16:14:06) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2 Type "help", "copyright", "credits" or "license" for more information. import dawdreamer Traceback (most recent call last): File "
", line 1, in File "dawdreamer/init.py", line 4, in from .dawdreamer import * ImportError: dawdreamer/dawdreamer.so: undefined symbol: PyInstanceMethod_Type
Perhaps I can disable Faust in DawDreamer? I am only interested in loading presets and running them
I haven't tried it in a while, but you should be able to skip everything Faust related by removing the BUILD_DAWDREAMER_FAUST
preprocessor in DawDreamer.jucer and regenerating the Makefiles. Editing the makefile by other means should be doable do. I think I'll try to do more architecture support toward the end of December.
In your first post I noticed that the script uses both python3.10 and python 3.8. Your second post uses Python 2.7.
If that doesn't fix it, something could be going wrong with make -f Make.llvm.static
, so running that in isolation and looking at debug print statements or logs could help.
Sorry my mistake, I have been experimenting with ubuntu22.04 and 20.04 and python2 and python3 and experiencing no success.
But I have the same error that I originally posted, sorry for not rigorously testing what I commented. I have tried all variation though.
I can remove the BUILD_DAWDREAMER_FAUST in DawDreamer.jucer but I don't know how to regenerate the Makefiles.
No worries. Can you try removing "-DBUILD_DAWDREAMER_FAUST"
in https://github.com/DBraun/DawDreamer/blob/main/Builds/LinuxMakefile/Makefile
I tried that but it still has a lot of faust stuff it's pulling in:
8746e3c89c10 ~/DawDreamer/Builds/LinuxMakefile # make
Linking DawDreamer - Dynamic Library
/usr/bin/aarch64-unknown-linux-gnu-ld.bfd: cannot find -lfaustwithllvm: No such file or directory
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:122: build/libdawdreamer.so] Error 1
I've even resorted to trying to make a Gentoo Dockerfile. But Gentoo doesn't want to build static LLVM: https://discourse.llvm.org/t/llvm-static-libs/38255 https://lists.llvm.org/pipermail/llvm-dev/2015-September/090589.html
I would really love a way to build DawDreamer that doesn't depend upon faust, this has been really gnarly
Sorry I overlooked another thing. Try removing -lfaustwithllvm from the Makefile too. If there are other issues just keep deleting anything Faust related from the Makefile.
Okay so your suggestion helped. (p.s. building libfaustwithllvm is super gnarly and I couldn't figure it out after trying a variety of methods)
This Dockerfile builds and I can import dawdreamer:
# Using Ubuntu 22.04 as the base image
FROM ubuntu:22.04
LABEL maintainer="lastname@gmail.com" \
version="0.1" \
description=""
# Set the working directory
WORKDIR /root/
# Set the environment variables
ENV LANG=C.UTF-8 \
TZ=Etc/UTC \
DEBIAN_FRONTEND=noninteractive \
PYTHONLIBPATH=/usr/lib/python3.10 \
PYTHONINCLUDEPATH=/usr/include/python3.10
# Setting the timezone and installing essential packages
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& apt-get update \
&& apt-get install -y lsb-release software-properties-common wget python3-pip python3-dev git build-essential cmake g++ make nasm curl unzip libgl1-mesa-dev \
&& apt-get install -y lv2-c++-tools libgtkmm-2.4-1v5 pkg-config lv2-dev libgtkmm-2.4-dev \
libsndfile1 libx11-dev libxrandr-dev libxinerama-dev libxrender-dev libxcomposite-dev libxcursor-dev libfreetype6-dev libsndfile1-dev \
libvorbis-dev libopus-dev libflac-dev libasound2-dev alsa-utils
# && bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" \
# Clone repositories and install Python packages
RUN git clone https://github.com/zynthian/moog.git \
&& pip3 install pedalboard \
&& git clone https://github.com/DBraun/DawDreamer.git \
&& cd DawDreamer \
&& git submodule init \
&& git submodule update
# Modify Makefile
RUN perl -i -pe 's/ -lfaustwithllvm//' DawDreamer/Builds/LinuxMakefile/Makefile
RUN perl -i -pe 's/ "-DBUILD_DAWDREAMER_FAUST"//' DawDreamer/Builds/LinuxMakefile/Makefile
# Build libsamplerate
RUN cd DawDreamer/thirdparty/libsamplerate && \
cmake -DCMAKE_BUILD_TYPE=Release -Bbuild_release -DCMAKE_POSITION_INDEPENDENT_CODE=ON && \
cd build_release && \
make CONFIG=Release
# Build DawDreamer
RUN cd DawDreamer/Builds/LinuxMakefile \
&& make -j8 VERBOSE=1 CONFIG=Release LIBS="-lstdc++fs" CXXFLAGS="-I../../alsa-lib/include -I/usr/include/python3.10 -I$PYTHONINCLUDEPATH" LDFLAGS="-L/__w/DawDreamer/DawDreamer/alsa-lib/src -L$PYTHONLIBPATH -L/root/faust-2.69.3/lib -L/root/faust-2.69.3/build/lib/"
# Move the built library
RUN cd DawDreamer/Builds/LinuxMakefile && mv build/libdawdreamer.so ../../dawdreamer/dawdreamer.so
RUN cd moog && CXXFLAGS="-I/usr/include/lv2-c++-tools" CFLAGS="-I/usr/include/lv2-c++-tools" make && make install
# Build and install the Python package
RUN cd DawDreamer && python3 setup.py build && python3 setup.py install
# Test import of DawDreamer
RUN { python3 -c "import dawdreamer"; }
Unfortunately,
/root/DawDreamer/thirdparty/libfaust/download_libfaust.sh
only works for i86. (arm64 is not supported yet: https://github.com/grame-cncm/faust/issues/951)I am tearing my hair out trying to build a Dockerfile to build everything under arm64 Ubuntu.
Here is what I currently have:
It ultimately fails with
I have been tearing my hair out trying to figure out why the linked libfaustwithllvm has a bogus symbol.
Any idea how to fix this?