grame-cncm / faust

Functional programming language for signal processing and sound synthesis
http://faust.grame.fr
Other
2.54k stars 319 forks source link

faust fails with '-lang cpp not supported', but configure said that cpp was built #558

Closed yurivict closed 3 years ago

yurivict commented 3 years ago

I've configured faust-2.30.5 with -DLLVM_BACKEND=DYNAMIC -DC_BACKEND=DYNAMIC -DCPP_BACKEND=DYNAMIC and configure printed:

-- Configuring version 2.30.5
-- Found LLVM 11.0.1
-- In target dynamiclib: include C backend
-- In target dynamiclib: include CPP backend
-- In target dynamiclib: include LLVM backend

but then faust fails like this:

$ faust -a lv2.cpp -cn phasemod -I examples examples/phasemod.dsp -o examples/phasemod.cpp
ERROR : -lang cpp not supported since CPP backend is not built

Is there a faust command that reports what backends are built?

Why does faust say contradictory things in configure- and run-time?

OS: FreeBSD 12.2

dfober commented 3 years ago

and what does the faust --version command return?

yurivict commented 3 years ago
$ faust --version
FAUST Version 2.30.5
Embedded backends: 
Copyright (C) 2002-2021, GRAME - Centre National de Creation Musicale. All rights reserved. 
dfober commented 3 years ago

so the version that is used does not include any backend (Embedded backends is empty). Maybe a path issue? And what does build/bin/faust --version return?

yurivict commented 3 years ago
$ build/bin/faust --version
FAUST Version 2.30.5
Embedded backends: 
Copyright (C) 2002-2021, GRAME - Centre National de Creation Musicale. All rights reserved. 
yurivict commented 3 years ago

There is a patch:

--- build/CMakeLists.txt.orig   2021-01-14 11:18:56 UTC
+++ build/CMakeLists.txt
@@ -53,7 +53,7 @@ endif()

 ####################################
 # source and headers files
-file (GLOB SRC ${SRCDIR}/*.cpp ${SRCDIR}/*/*.cpp ${SRCDIR}/draw/*/*.cpp ${SRCDIR}/generator/fir/*.cpp)
+file (GLOB SRC ${SRCDIR}/*.cpp ${SRCDIR}/*/*.cpp ${SRCDIR}/draw/*/*.cpp ${SRCDIR}/generator/fir/*.cpp ${SRCDIR}/generator/cpp/*.cpp ${SRCDIR}/generator/llvm/*.cpp)
 file (GLOB HH  ${SRCDIR}/*.hh  ${SRCDIR}/*/*.hh  ${SRCDIR}/generator/fir/*.hh)

 ####################################

that was added because it doesn't add backend-specific files by itself.

dfober commented 3 years ago

when rereading the first message, it is quite normal that there is no backend in faust: they are only included in the dynamic library. To get these backends in the faust compiler (that doesn't depend on the library) you should use

-DLLVM_BACKEND=COMPILER -DC_BACKEND=COMPILER -DCPP_BACKEND=COMPILER

But above all, use the backends config files is highly recommended.
make help from the build folder may also help

yurivict commented 3 years ago

Thank you for this information.

Faust backends now build fine.