VCVRack / VCV-Prototype

Other
130 stars 22 forks source link

macOS Monterey x86_64 compilation error #61

Open esrsound opened 2 years ago

esrsound commented 2 years ago

Hello. I trying to compile v2 branch. Getting this error after make dep:

cc -DPD -DHAVE_UNISTD_H -DUSEAPI_DUMMY -I./libpd_wrapper -I./libpd_wrapper/util -I./pure-data/src -DHAVE_LIBDL -I/System/Library/Frameworks/JavaVM.framework/Headers -ffast-math -funroll-loops -fomit-frame-pointer -O3 -DLIBPD_EXTRA -DPDINSTANCE -DPDTHREADS  -DPD_LONGINTTYPE="long long" -mmacosx-version-min=10.9 -stdlib=libc++   -c -o libpd_wrapper/z_hooks.o libpd_wrapper/z_hooks.c
cc -DPD -DHAVE_UNISTD_H -DUSEAPI_DUMMY -I./libpd_wrapper -I./libpd_wrapper/util -I./pure-data/src -DHAVE_LIBDL -I/System/Library/Frameworks/JavaVM.framework/Headers -ffast-math -funroll-loops -fomit-frame-pointer -O3 -DLIBPD_EXTRA -DPDINSTANCE -DPDTHREADS  -DPD_LONGINTTYPE="long long" -mmacosx-version-min=10.9 -stdlib=libc++   -c -o libpd_wrapper/z_libpd.o libpd_wrapper/z_libpd.c
libpd_wrapper/z_libpd.c:91:3: error: implicit declaration of function 'sys_set_audio_api' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  sys_set_audio_api(API_DUMMY);
  ^
libpd_wrapper/z_libpd.c:91:3: note: did you mean 'sys_get_audio_apis'?
./pure-data/src/s_stuff.h:166:13: note: 'sys_get_audio_apis' declared here
EXTERN void sys_get_audio_apis(char *buf);
            ^
libpd_wrapper/z_libpd.c:163:29: error: too many arguments to function call, expected single argument 'as', have 12 arguments
  sys_set_audio_settings(1, indev, 1, inch,
  ~~~~~~~~~~~~~~~~~~~~~~    ^~~~~~~~~~~~~~~
./pure-data/src/s_stuff.h:153:13: note: 'sys_set_audio_settings' declared here
EXTERN void sys_set_audio_settings(t_audiosettings *as);
            ^
2 errors generated.
make[1]: *** [libpd_wrapper/z_libpd.o] Error 1
make: *** [dep/lib/libpd.a] Error 2
➜  VCV-Prototype git:(v2) ✗
mxa commented 2 years ago

Just learned through this issue that there is a v2 branch. Is there an official process how the compatibility to v2 is implemented, who is in charge and what are the changes? @AndrewBelt we need some guidance.

sleexyz commented 2 years ago

I was able to build so far on the v2 branch (on a M1 Mac, Monterey, compiling for x86_64) with just the Faust and LuaJIT script engines. However, I get an error within Rack2 that says No engine found for ..dsp extension (and the same for .lua when I try to load lua scripts).

EDIT: Found the bug. The V2 SDK's system::getExtension returns the leading . (as it uses std::filesystem::path::extension under the hood) whereas V1's string::filenameExtension doesn't.

f693e763335b5912ddfc2f8e26f687ffcf3693e6 doesn't account for this change, which is why the error message shows two periods.

(I wonder if the change in semantics in the SDK was intentional? Anyways, the std::filesystem::path behavior does seem to make more sense.)