moddevices / caps-lv2

LV2 port for the CAPS Audio Plugin Suit
GNU General Public License v3.0
39 stars 9 forks source link

compiliation fails with error: builtin functions must be directly called #30

Open david0 opened 3 years ago

david0 commented 3 years ago

Hi, I tried to compile caps-lv2 on OS/X.

Unfortunately it fails with the following error:

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C plugins/mod-caps-AmpVTS.lv2
c++ -MM -O3 -ffast-math -funroll-loops -Wall -fPIC -DPIC -fdata-sections -ffunction-sections -I../.. -fvisibility=hidden -fvisibility-inlines-hidden ../../Amp.cc ../../ToneStack.cc ../../dsp/polynomials.cc interface.cc > .depend
c++ ../../Amp.cc -O3 -ffast-math -funroll-loops -Wall -fPIC -DPIC -fdata-sections -ffunction-sections -I../.. -fvisibility=hidden -fvisibility-inlines-hidden -o ../../Amp.o -c
In file included from ../../Amp.cc:30:
In file included from ../../Amp.h:39:
../../dsp/ToneStack.h:57:10: warning: private field 'fs' is not used [-Wunused-private-field]
                double fs;
                       ^
1 warning generated.
c++ ../../ToneStack.cc -O3 -ffast-math -funroll-loops -Wall -fPIC -DPIC -fdata-sections -ffunction-sections -I../.. -fvisibility=hidden -fvisibility-inlines-hidden -o ../../ToneStack.o -c
In file included from ../../ToneStack.cc:34:
In file included from ../../ToneStack.h:34:
../../dsp/ToneStack.h:57:10: warning: private field 'fs' is not used [-Wunused-private-field]
                double fs;
                       ^
1 warning generated.
c++ ../../dsp/polynomials.cc -O3 -ffast-math -funroll-loops -Wall -fPIC -DPIC -fdata-sections -ffunction-sections -I../.. -fvisibility=hidden -fvisibility-inlines-hidden -o ../../dsp/polynomials.o -c
c++ interface.cc -O3 -ffast-math -funroll-loops -Wall -fPIC -DPIC -fdata-sections -ffunction-sections -I../.. -fvisibility=hidden -fvisibility-inlines-hidden -o interface.o -c
In file included from interface.cc:5:
In file included from ../../Cabinet.h:39:
../../dsp/v4f.h:84:10: error: builtin functions must be directly called
                d[i] = fn(s[i]);
                       ^
../../dsp/v4f.h:158:12: note: in instantiation of function template specialization 'v4f_map<&__builtin_sinf>' requested here
                                y[0] = v4f_map<__builtin_sinf> (w);
                                       ^
../../dsp/v4f.h:84:10: error: builtin functions must be directly called
                d[i] = fn(s[i]);
                       ^
../../dsp/v4f.h:161:20: note: in instantiation of function template specialization 'v4f_map<&__builtin_cosf>' requested here
                                y[2] = v4f_2 * v4f_map<__builtin_cosf> (w); /* b */
                                               ^
In file included from interface.cc:17:
In file included from ../../Amp.h:39:
../../dsp/ToneStack.h:57:10: warning: private field 'fs' is not used [-Wunused-private-field]
                double fs;
                       ^
1 warning and 2 errors generated.
make[1]: *** [interface.o] Error 1
make: *** [build] Error 2

i'm using clang++:

macbook [caps-lv2]$ c++ --version                                                                                                                                                                                                  18:19:56
Apple clang version 12.0.0 (clang-1200.0.32.27)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
falkTX commented 3 years ago

Try applying this patch https://github.com/DISTRHO/PawPaw/blob/master/patches/caps-lv2/01_xplat-compat.patch

david0 commented 3 years ago

The patch works for me 👍 (so does sed 's/__builtin_sinf/sinf/g' +cos)