madskjeldgaard / faustgen-supercollider

Livecode Faust in SuperCollider using an embedded Faust compiler.
GNU General Public License v3.0
29 stars 3 forks source link

Can't make it work #2

Open smrg-lm opened 2 years ago

smrg-lm commented 2 years ago

Hi

I'm trying it built it on Ubuntu but I can't compile it properly, the server gives me this error:

*** ERROR: dlopen '/home/xyz/.local/share/SuperCollider/Extensions/FaustGen/FaustGen/FaustGen_supernova.so' err '/home/xyz/.local/share/SuperCollider/Extensions/FaustGen/FaustGen/FaustGen_supernova.so: undefined symbol: _ZN16llvm_dsp_factory9getTargetB5cxx11Ev'

for _supernova and _scsynth.so, booth. I used this command to configure the build:

cmake .. -DCMAKE_BUILD_TYPE=Release -DSC_PATH=../SuperCollider.git -DCMAKE_INSTALL_PREFIX=~/.local/share/SuperCollider -DLLVM_DIR=/usr/lib/llvm-10/cmake

I had to use llvm_dir because it was detecting both llvm 6 and llvm 10 in different steps. The output is:

-- Found SuperCollider: /home/xyz/Sources/SuperCollider.git
-- Building plugins for SuperCollider version: 3.12.1
-- Install directory set to: /home/xyz/.local/share/SuperCollider/Extensions
-- Faust Library
-- Configuring version 2.32.17
-- Found LLVM 10.0.0
-- In target staticlib: include LLVM backend
-- Compile wasm glue library
-- Install location is /home/xyz/.local/share/SuperCollider/Extensions
-- Install libraries in /home/xyz/.local/share/SuperCollider/Extensions/lib
-- Include targets: staticlib 
-- Added server plugin target FaustGen_scsynth
-- Added server plugin target FaustGen_supernova
-- Found LLVM 10.0.0
-- Using LLVMConfig.cmake in: /usr/lib/llvm-10/cmake
-- Generating plugin targets done
-- Generating plugin targets done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xyz/Sources/faustgen-supercollider/build

There is one path that catches my attention : /home/xyz/.local/share/SuperCollider/Extensions/lib it is not in the install manifest which is:

/home/xyz/.local/share/SuperCollider/Extensions/FaustGen/FaustGen/FaustGen_scsynth.so
/home/xyz/.local/share/SuperCollider/Extensions/FaustGen/FaustGen/FaustGen_supernova.so
/home/xyz/.local/share/SuperCollider/Extensions/FaustGen/FaustGen/Classes/FaustGen.sc
/home/xyz/.local/share/SuperCollider/Extensions/FaustGen/FaustGen/Classes/FaustGenController.sc
/home/xyz/.local/share/SuperCollider/Extensions/FaustGen/FaustGen/HelpSource/Classes/FaustGen.schelp
/home/xyz/.local/share/SuperCollider/Extensions/FaustGen/FaustGen/HelpSource/Classes/FaustGenController.schelp

I don't know what I'm doing wrong, the faust library seems to be missing, I have it installed but nevertheless the build does compile a static version for the .so, right?

madskjeldgaard commented 2 years ago

I'm not totally sure but we've had some trouble lately because of some llvm updates. I should get back to finishing this project soon.... Sorry.

Anyways:

There is more info here https://scsynth.org/t/wip-faustgen-a-ugen-for-interpreting-faust-code/4029/34?u=madskjeldgaard

Try again with latest version of Faust built from master-dev branch and run git submodule update --remote in this repo before building it.

smrg-lm commented 2 years ago

Still not working, faust rebuilt from master-dev with all the backends git submodule update --remote and the same result. The resulting plugins .so don't link dynamically to faust so I guess it might be something when building the static library or linking to it or something else in the build process, I don't have much idea.

madskjeldgaard commented 2 years ago

Still not working, faust rebuilt from master-dev with all the backends git submodule update --remote and the same result. The resulting plugins .so don't link dynamically to faust so I guess it might be something when building the static library or linking to it or something else in the build process, I don't have much idea.

Damn. What's the output of faust --version on your system?

On mine (Arch Linux) it's:

FAUST Version 2.38.16
Embedded backends: 
   DSP to C
   DSP to C++
   DSP to CSharp
   DSP to DLang
   DSP to FIR
   DSP to Interpreter
   DSP to Java
   DSP to Julia
   DSP to LLVM IR
   DSP to old C++
   DSP to Rust
   DSP to SOUL
   DSP to WebAssembly (wast/wasm)
Build with LLVM version 13.0.0
Copyright (C) 2002-2022, GRAME - Centre National de Creation Musicale. All rights reserved. 

Once this whole project is done I will setup prebuilt versions like in my other plugin repos FYI.

smrg-lm commented 2 years ago

The output is almost the same:

FAUST Version 2.38.17
Embedded backends: 
   DSP to C
   DSP to C++
   DSP to CSharp
   DSP to DLang
   DSP to FIR
   DSP to Interpreter
   DSP to Java
   DSP to Julia
   DSP to LLVM IR
   DSP to old C++
   DSP to Rust
   DSP to SOUL
   DSP to WebAssembly (wast/wasm)
Build with LLVM version 10.0.0
Copyright (C) 2002-2022, GRAME - Centre National de Creation Musicale. All rights reserved.

Don't worry I just wanted to give it a try.

madskjeldgaard commented 2 years ago

The output is almost the same:

FAUST Version 2.38.17
Embedded backends: 
   DSP to C
   DSP to C++
   DSP to CSharp
   DSP to DLang
   DSP to FIR
   DSP to Interpreter
   DSP to Java
   DSP to Julia
   DSP to LLVM IR
   DSP to old C++
   DSP to Rust
   DSP to SOUL
   DSP to WebAssembly (wast/wasm)
Build with LLVM version 10.0.0
Copyright (C) 2002-2022, GRAME - Centre National de Creation Musicale. All rights reserved.

Don't worry I just wanted to give it a try.

Maybe the Ubuntu llvm is a bit too old? Honestly not sure though

smrg-lm commented 2 years ago

The missing symbol seems to be from faust dsp_factory getTarget (trimmed), maybe if it is linking statically something is failing to link or missing.

Edit: If it shows a dlopen error it should be a searching for a dynamic library, but is not linked to the faust library:

ldd FaustGen_scsynth.so 
        linux-vdso.so.1 (0x00007ffda11ac000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5cdf4de000)
        libLLVM-10.so.1 => /lib/x86_64-linux-gnu/libLLVM-10.so.1 (0x00007f5cdae4a000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f5cdac68000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5cdab19000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f5cdaafe000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5cda90c000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f5cdfd49000)
        libffi.so.7 => /lib/x86_64-linux-gnu/libffi.so.7 (0x00007f5cda8fe000)
        libedit.so.2 => /lib/x86_64-linux-gnu/libedit.so.2 (0x00007f5cda8c6000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f5cda8aa000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f5cda89f000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5cda899000)
        libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f5cda869000)
        libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f5cda84d000)