Closed sdaau closed 4 years ago
I managed to compile finally; this is what I think the issue is:
Under Linux/Ubuntu, g++
is the proper GNU version used. On Ubuntu 14.04, the default g++
has version 4.8.4; however:
https://gcc.gnu.org/onlinedocs/gcc-4.8.3/gcc/C-Extensions.html (documentation for the 4.8.3 release) does not mention the overflow builtins. The unversioned address https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html corresponds to the documentation for the development version of gcc (the future gcc-5). You can wait until March or April, or start playing with a snapshot, or use clang's equivalent.
I independently tried to build LLVM 5.0 ( that version can still be built with gcc 4.8* on Ubuntu 14.04, although it is quite a nasty process, see http://svn.code.sf.net/p/sdaaubckp/code/source-build-scripts/get_llvm_source_u1404.sh ), and managed to do so - however, that in itself was possibly not necessary.
What was necessary, however, is that the compilation is manually repeated for all those files, where the __builtin_
stuff fails, by copying the command line printed by the faust
make process, and then replacing the g++
in it with clang++-5.0
. This then requires stddef.h
, stdarg.h
and similar headers; however, using the default Linux headers (say, in /usr/include
) causes compilation to fail again. And here it is important that the stddef.h
, stdarg.h
are used from the LLVM source, which in my case are in /path/to/llvm-toolchain/branches/llvm-toolchain-5.0_5.0~svn319231/clang_5.0~svn319231/lib/Headers
- and also this directory needs to be added to the compile line as an -I
nclude directory; in all, these are the files that I had to manually build in this way:
(cd compiler; clang++-5.0 -std=c++11 -O1 -fPIC -D__USE_MINGW_ANSI_STDIO -Wall -Wuninitialized -Wno-parentheses -Wno-overloaded-virtual -fvisibility=hidden -I. -Iboxes -Ierrors -Ievaluate -Inormalize -Iparser -Ipropagate -Iparallelize -Isignals -Itlib -Idraw -Idraw/device -Idraw/schema -Iextended -Ipatternmatcher -Idocumentator -Iutils -I../libraries -Igenerator -Igenerator/asmjs -Igenerator/c -Igenerator/cpp -Igenerator/java -Igenerator/js -Igenerator/llvm -Igenerator/fir -Igenerator/wasm -Igenerator/interpreter -Igenerator/rust -DINSTALL_PREFIX='"/usr/local"' -I`/usr/bin/llvm-config-5.0 --includedir` -I../architecture -DLLVM_50 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DASMJS_BUILD -DC_BUILD -DCPP_BUILD -DFIR_BUILD -DINTERP_BUILD -DJAVA_BUILD -DJS_BUILD -DLLVM_BUILD -DOCPP_BUILD -DRUST_BUILD -DWASM_BUILD -I/path/to/llvm-toolchain/branches/llvm-toolchain-5.0_5.0~svn319231/clang_5.0~svn319231/lib/Headers -O3 -c -o global.o global.cpp)
(cd compiler; clang++-5.0 -std=gnu++11 -O1 -fPIC -D__USE_MINGW_ANSI_STDIO -Wall -Wuninitialized -Wno-parentheses -Wno-overloaded-virtual -fvisibility=hidden -I. -Iboxes -Ierrors -Ievaluate -Inormalize -Iparser -Ipropagate -Iparallelize -Isignals -Itlib -Idraw -Idraw/device -Idraw/schema -Iextended -Ipatternmatcher -Idocumentator -Iutils -I../libraries -Igenerator -Igenerator/asmjs -Igenerator/c -Igenerator/cpp -Igenerator/java -Igenerator/js -Igenerator/llvm -Igenerator/fir -Igenerator/wasm -Igenerator/interpreter -Igenerator/rust -DINSTALL_PREFIX='"/usr/local"' -I`/usr/bin/llvm-config-5.0 --includedir` -I../architecture -DLLVM_50 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DASMJS_BUILD -DC_BUILD -DCPP_BUILD -DFIR_BUILD -DINTERP_BUILD -DJAVA_BUILD -DJS_BUILD -DLLVM_BUILD -DOCPP_BUILD -DRUST_BUILD -DWASM_BUILD -I/path/to/llvm-toolchain/branches/llvm-toolchain-5.0_5.0~svn319231/clang_5.0~svn319231/lib/Headers -O3 -c -o libcode.o libcode.cpp)
(cd compiler; clang++-5.0 -std=gnu++11 -O1 -fPIC -D__USE_MINGW_ANSI_STDIO -Wall -Wuninitialized -Wno-parentheses -Wno-overloaded-virtual -fvisibility=hidden -I. -Iboxes -Ierrors -Ievaluate -Inormalize -Iparser -Ipropagate -Iparallelize -Isignals -Itlib -Idraw -Idraw/device -Idraw/schema -Iextended -Ipatternmatcher -Idocumentator -Iutils -I../libraries -Igenerator -Igenerator/asmjs -Igenerator/c -Igenerator/cpp -Igenerator/java -Igenerator/js -Igenerator/llvm -Igenerator/fir -Igenerator/wasm -Igenerator/interpreter -Igenerator/rust -DINSTALL_PREFIX='"/usr/local"' -I`/usr/bin/llvm-config-5.0 --includedir` -I../architecture -DLLVM_50 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DASMJS_BUILD -DC_BUILD -DCPP_BUILD -DFIR_BUILD -DINTERP_BUILD -DJAVA_BUILD -DJS_BUILD -DLLVM_BUILD -DOCPP_BUILD -DRUST_BUILD -DWASM_BUILD -I/path/to/llvm-toolchain/branches/llvm-toolchain-5.0_5.0~svn319231/clang_5.0~svn319231/lib/Headers -O3 -c -o generator/interpreter/interpreter_code_container.o generator/interpreter/interpreter_code_container.cpp)
(cd compiler; clang++-5.0 -std=gnu++11 -O1 -fPIC -D__USE_MINGW_ANSI_STDIO -Wall -Wuninitialized -Wno-parentheses -Wno-overloaded-virtual -fvisibility=hidden -I. -Iboxes -Ierrors -Ievaluate -Inormalize -Iparser -Ipropagate -Iparallelize -Isignals -Itlib -Idraw -Idraw/device -Idraw/schema -Iextended -Ipatternmatcher -Idocumentator -Iutils -I../libraries -Igenerator -Igenerator/asmjs -Igenerator/c -Igenerator/cpp -Igenerator/java -Igenerator/js -Igenerator/llvm -Igenerator/fir -Igenerator/wasm -Igenerator/interpreter -Igenerator/rust -DINSTALL_PREFIX='"/usr/local"' -I`/usr/bin/llvm-config-5.0 --includedir` -I../architecture -DLLVM_50 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DASMJS_BUILD -DC_BUILD -DCPP_BUILD -DFIR_BUILD -DINTERP_BUILD -DJAVA_BUILD -DJS_BUILD -DLLVM_BUILD -DOCPP_BUILD -DRUST_BUILD -DWASM_BUILD -I/path/to/llvm-toolchain/branches/llvm-toolchain-5.0_5.0~svn319231/clang_5.0~svn319231/lib/Headers -O3 -c -o generator/interpreter/interpreter_dsp_aux.o generator/interpreter/interpreter_dsp_aux.cpp)
After these files are compiled "manually", then I could run make -j 4 world
again, and the compilation process completes for faust
.
Not sure if this should be mentioned in the documentation, or ./installer/ubuntu1404/install.regular.sh
.
EDIT: just removed the LLVM 5.0 packages I built, and did instead sudo apt-get install llvm-3.5 clang-3.5
; the same trick with copying build lines and replacing g++
with clang++
works, and this time it is not required to add the -I
nclude directory; so the manual files build commands are:
(cd compiler; clang++-3.5 -std=gnu++11 -O1 -fPIC -D__USE_MINGW_ANSI_STDIO -Wall -Wuninitialized -Wno-parentheses -Wno-overloaded-virtual -fvisibility=hidden -I. -Iboxes -Ierrors -Ievaluate -Inormalize -Iparser -Ipropagate -Iparallelize -Isignals -Itlib -Idraw -Idraw/device -Idraw/schema -Iextended -Ipatternmatcher -Idocumentator -Iutils -I../libraries -Igenerator -Igenerator/asmjs -Igenerator/c -Igenerator/cpp -Igenerator/java -Igenerator/js -Igenerator/llvm -Igenerator/fir -Igenerator/wasm -Igenerator/interpreter -Igenerator/rust -DINSTALL_PREFIX='"/usr/local"' -I`/usr/bin/llvm-config-3.5 --includedir` -I../architecture -DLLVM_35 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DASMJS_BUILD -DC_BUILD -DCPP_BUILD -DFIR_BUILD -DINTERP_BUILD -DJAVA_BUILD -DJS_BUILD -DLLVM_BUILD -DOCPP_BUILD -DRUST_BUILD -DWASM_BUILD -O3 -c -o global.o global.cpp)
(cd compiler; clang++-3.5 -std=gnu++11 -O1 -fPIC -D__USE_MINGW_ANSI_STDIO -Wall -Wuninitialized -Wno-parentheses -Wno-overloaded-virtual -fvisibility=hidden -I. -Iboxes -Ierrors -Ievaluate -Inormalize -Iparser -Ipropagate -Iparallelize -Isignals -Itlib -Idraw -Idraw/device -Idraw/schema -Iextended -Ipatternmatcher -Idocumentator -Iutils -I../libraries -Igenerator -Igenerator/asmjs -Igenerator/c -Igenerator/cpp -Igenerator/java -Igenerator/js -Igenerator/llvm -Igenerator/fir -Igenerator/wasm -Igenerator/interpreter -Igenerator/rust -DINSTALL_PREFIX='"/usr/local"' -I`/usr/bin/llvm-config-3.5 --includedir` -I../architecture -DLLVM_35 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DASMJS_BUILD -DC_BUILD -DCPP_BUILD -DFIR_BUILD -DINTERP_BUILD -DJAVA_BUILD -DJS_BUILD -DLLVM_BUILD -DOCPP_BUILD -DRUST_BUILD -DWASM_BUILD -O3 -c -o generator/interpreter/interpreter_dsp_aux.o generator/interpreter/interpreter_dsp_aux.cpp)
(cd compiler; clang++-3.5 -std=gnu++11 -O1 -fPIC -D__USE_MINGW_ANSI_STDIO -Wall -Wuninitialized -Wno-parentheses -Wno-overloaded-virtual -fvisibility=hidden -I. -Iboxes -Ierrors -Ievaluate -Inormalize -Iparser -Ipropagate -Iparallelize -Isignals -Itlib -Idraw -Idraw/device -Idraw/schema -Iextended -Ipatternmatcher -Idocumentator -Iutils -I../libraries -Igenerator -Igenerator/asmjs -Igenerator/c -Igenerator/cpp -Igenerator/java -Igenerator/js -Igenerator/llvm -Igenerator/fir -Igenerator/wasm -Igenerator/interpreter -Igenerator/rust -DINSTALL_PREFIX='"/usr/local"' -I`/usr/bin/llvm-config-3.5 --includedir` -I../architecture -DLLVM_35 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DASMJS_BUILD -DC_BUILD -DCPP_BUILD -DFIR_BUILD -DINTERP_BUILD -DJAVA_BUILD -DJS_BUILD -DLLVM_BUILD -DOCPP_BUILD -DRUST_BUILD -DWASM_BUILD -O3 -c -o generator/interpreter/interpreter_code_container.o generator/interpreter/interpreter_code_container.cpp)
(cd compiler; clang++-3.5 -std=gnu++11 -O1 -fPIC -D__USE_MINGW_ANSI_STDIO -Wall -Wuninitialized -Wno-parentheses -Wno-overloaded-virtual -fvisibility=hidden -I. -Iboxes -Ierrors -Ievaluate -Inormalize -Iparser -Ipropagate -Iparallelize -Isignals -Itlib -Idraw -Idraw/device -Idraw/schema -Iextended -Ipatternmatcher -Idocumentator -Iutils -I../libraries -Igenerator -Igenerator/asmjs -Igenerator/c -Igenerator/cpp -Igenerator/java -Igenerator/js -Igenerator/llvm -Igenerator/fir -Igenerator/wasm -Igenerator/interpreter -Igenerator/rust -DINSTALL_PREFIX='"/usr/local"' -I`/usr/bin/llvm-config-3.5 --includedir` -I../architecture -DLLVM_35 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DASMJS_BUILD -DC_BUILD -DCPP_BUILD -DFIR_BUILD -DINTERP_BUILD -DJAVA_BUILD -DJS_BUILD -DLLVM_BUILD -DOCPP_BUILD -DRUST_BUILD -DWASM_BUILD -O3 -c -o libcode.o libcode.cpp)
This is enough for make world
, and to have make
succeed, one also needs sudo apt-get install libedit-dev
( via https://stackoverflow.com/questions/27926618/linker-issues-with-ledit-ubuntu-14-10/27928077 )
I'm trying to build
faust
from source; the same error happens in both the (new)master
branch, and theold-faust2
branch. This is what I did:The build runs fine for a while, and then:
This is kinda weird, since
__builtin_sadd_overflow
should be, well, built-in - as noted in https://clang.llvm.org/docs/LanguageExtensions.html#checked-arithmetic-builtinsIs there a way around this error?