VCV-Prototype icon indicating copy to clipboard operation
VCV-Prototype copied to clipboard

Build fails on Win10 msys64

Open jpnielsen opened this issue 4 years ago • 28 comments
trafficstars

Goal is to use https://faustide.grame.fr/ to generate a vcv rack module.

First i tried generating the vcvrack project file with their Web gui, but th ecompilation failed.

then i tried installing vcv prototype like they suggest in "Compiling the VCV Prototype module Faust version"

pacman -Suv
pacman -S mingw-w64-x86_64-portaudio (was installed after the build dep below gave an error)
pacman -S mingw-w64-x86_64-libsndfile (was installed when compilation of the faust2vcv example failed)
cd Rack/plugins
git clone -b faust https://github.com/VCVRack/VCV-Prototype.git
cd VCV-Prototype/
git submodule update --init --recursive
make -j4 dep

so far no errors.

$ make -j4
g++ -std=c++11 -Wsuggest-override  -Idep/include -Idep/vult -Idep/include/libpd -DHAVE_LIBDL -DPD_INTERNAL -DINTERP -fPIC -I../../include -I../../dep/include -MMD -MP -g -O3 -march=nocona -funsafe-math-optimizations -Wall -Wextra -Wno-unused-parameter -DARCH_WIN -D_USE_MATH_DEFINES  -c -o build/src/Prototype.cpp.o src/Prototype.cpp
g++ -std=c++11 -Wsuggest-override  -Idep/include -Idep/vult -Idep/include/libpd -DHAVE_LIBDL -DPD_INTERNAL -DINTERP -fPIC -I../../include -I../../dep/include -MMD -MP -g -O3 -march=nocona -funsafe-math-optimizations -Wall -Wextra -Wno-unused-parameter -DARCH_WIN -D_USE_MATH_DEFINES  -c -o build/src/QuickJSEngine.cpp.o src/QuickJSEngine.cpp
g++ -std=c++11 -Wsuggest-override  -Idep/include -Idep/vult -Idep/include/libpd -DHAVE_LIBDL -DPD_INTERNAL -DINTERP -fPIC -I../../include -I../../dep/include -MMD -MP -g -O3 -march=nocona -funsafe-math-optimizations -Wall -Wextra -Wno-unused-parameter -DARCH_WIN -D_USE_MATH_DEFINES  -c -o build/src/LuaJITEngine.cpp.o src/LuaJITEngine.cpp
g++ -std=c++11 -Wsuggest-override  -Idep/include -Idep/vult -Idep/include/libpd -DHAVE_LIBDL -DPD_INTERNAL -DINTERP -fPIC -I../../include -I../../dep/include -MMD -MP -g -O3 -march=nocona -funsafe-math-optimizations -Wall -Wextra -Wno-unused-parameter -DARCH_WIN -D_USE_MATH_DEFINES  -c -o build/src/VultEngine.cpp.o src/VultEngine.cpp
src/Prototype.cpp:9:10: fatal error: efsw/efsw.h: No such file or directory
    9 | #include <efsw/efsw.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make: *** [../../compile.mk:69: build/src/Prototype.cpp.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from src/QuickJSEngine.cpp:2:
dep/include/quickjs/quickjs.h: In function 'JSValue JS_NewCFunctionMagic(JSContext*, JSValue (*)(JSContext*, JSValue, int, JSValue*, int), const char*, int, JSCFunctionEnum, int)':
dep/include/quickjs/quickjs.h:826:34: warning: cast between incompatible function types from 'JSValue (*)(JSContext*, JSValue, int, JSValue*, int)' to 'JSValue (*)(JSContext*, JSValue, int, JSValue*)' [-Wcast-function-type]
  826 |     return JS_NewCFunction2(ctx, (JSCFunction *)func, name, length, cproto, magic);
      |                                  ^~~~~~~~~~~~~~~~~~~
In file included from src/VultEngine.cpp:3:
dep/include/quickjs/quickjs.h: In function 'JSValue JS_NewCFunctionMagic(JSContext*, JSValue (*)(JSContext*, JSValue, int, JSValue*, int), const char*, int, JSCFunctionEnum, int)':
dep/include/quickjs/quickjs.h:826:34: warning: cast between incompatible function types from 'JSValue (*)(JSContext*, JSValue, int, JSValue*, int)' to 'JSValue (*)(JSContext*, JSValue, int, JSValue*)' [-Wcast-function-type]
  826 |     return JS_NewCFunction2(ctx, (JSCFunction *)func, name, length, cproto, magic);
      |                                  ^~~~~~~~~~~~~~~~~~~

jpnielsen avatar Sep 18 '21 02:09 jpnielsen

the quickjs parts are warnings, which in this case can likely be ignored, but the src/Prototype.cpp:9:10: fatal error: efsw/efsw.h: No such file or directory is a definite error. it looks like one of the dependencies failed.

will have to wait for someone more familiar with that part to respond.

JerrySievert avatar Sep 18 '21 03:09 JerrySievert

Goal is to use https://faustide.grame.fr/ to generate a vcv rack module.

First i tried generating the vcvrack project file with their Web gui, but th ecompilation failed.

What are the errors?

sletz avatar Sep 18 '21 04:09 sletz

Prototype.cpp:9:10: fatal error: efsw/efsw.h: No such file or directory 9 | #include <efsw/efsw.h>

efsw is a git submodule, have you done: https://github.com/VCVRack/VCV-Prototype#load-submodules ?

sletz avatar Sep 18 '21 04:09 sletz

efsw is a git submodule, have you done: https://github.com/VCVRack/VCV-Prototype#load-submodules ?

Yes, "git submodule update --init --recursive" in the VCV-Prototype dir.

Something was changed in efsw 4 days ago - perhaps the lua config and build doesn't run in the submodule. I'm not an expert.

jpnielsen avatar Sep 18 '21 05:09 jpnielsen

Goal is to use https://faustide.grame.fr/ to generate a vcv rack module. First i tried generating the vcvrack project file with their Web gui, but th ecompilation failed.

What are the errors?

Here, I run make in a dir exported from the Faust web GUI

~/projects/Rack/plugins/exfaust3

$ make
g++ `pkg-config --cflags sndfile` -std=c++11 -Wsuggest-override  -fPIC -I../../include -I../../dep/include -MMD -MP -g -O3 -march=nocona -funsafe-math-optimizations -Wall -Wextra -Wno-unused-parameter -DARCH_WIN -D_USE_MATH_DEFINES  -c -o build/src/FaustModule.cpp.o src/FaustModule.cpp


src/FaustModule.cpp: In constructor 'exfaust3Module<VOICES>::exfaust3Module()':
src/FaustModule.cpp:4851:9: error: 'uint' was not declared in this scope; did you mean 'rint'?
 4851 |         uint buttons = params.fButtons.size();
      |         ^~~~
      |         rint
src/FaustModule.cpp:4852:13: error: expected ';' before 'entries'
 4852 |         uint entries = params.fRanges.size();
      |             ^~~~~~~~
      |             ;
src/FaustModule.cpp:4853:13: error: expected ';' before 'bargraphs'
 4853 |         uint bargraphs = params.fBargraph.size();
      |             ^~~~~~~~~~
      |             ;
src/FaustModule.cpp:4854:13: error: expected ';' before 'inputCV'
 4854 |         uint inputCV = params.fInputCV.size();
      |             ^~~~~~~~
      |             ;
src/FaustModule.cpp:4855:13: error: expected ';' before 'outputCV'
 4855 |         uint outputCV = params.fOutputCV.size();
      |             ^~~~~~~~~
      |             ;
src/FaustModule.cpp:4858:16: error: 'buttons' was not declared in this scope
 4858 |         config(buttons + entries, inputCV + fDSP[0].getNumInputs(), outputCV + fDSP[0].getNumOutputs(), bargraphs);
      |                ^~~~~~~
src/FaustModule.cpp:4858:26: error: 'entries' was not declared in this scope
 4858 |         config(buttons + entries, inputCV + fDSP[0].getNumInputs(), outputCV + fDSP[0].getNumOutputs(), bargraphs);
      |                          ^~~~~~~
src/FaustModule.cpp:4858:35: error: 'inputCV' was not declared in this scope; did you mean 'inputs'?
 4858 |         config(buttons + entries, inputCV + fDSP[0].getNumInputs(), outputCV + fDSP[0].getNumOutputs(), bargraphs);
      |                                   ^~~~~~~
      |                                   inputs
src/FaustModule.cpp:4858:69: error: 'outputCV' was not declared in this scope; did you mean 'outputs'?
 4858 |         config(buttons + entries, inputCV + fDSP[0].getNumInputs(), outputCV + fDSP[0].getNumOutputs(), bargraphs);
      |                                                                     ^~~~~~~~
      |                                                                     outputs
src/FaustModule.cpp:4858:105: error: 'bargraphs' was not declared in this scope
 4858 |         config(buttons + entries, inputCV + fDSP[0].getNumInputs(), outputCV + fDSP[0].getNumOutputs(), bargraphs);
      |                                                                                                         ^~~~~~~~~
src/FaustModule.cpp:4861:18: error: expected ';' before 'pa'
 4861 |         for (uint pa = 0; pa < buttons; pa++) {
      |                  ^~~
      |                  ;
src/FaustModule.cpp:4861:27: error: 'pa' was not declared in this scope
 4861 |         for (uint pa = 0; pa < buttons; pa++) {
      |                           ^~
src/FaustModule.cpp:4865:18: error: expected ';' before 'pa'
 4865 |         for (uint pa = 0; pa < entries; pa++) {
      |                  ^~~
      |                  ;
src/FaustModule.cpp:4865:27: error: 'pa' was not declared in this scope
 4865 |         for (uint pa = 0; pa < entries; pa++) {
      |                           ^~
src/FaustModule.cpp: In member function 'void exfaust3Module<VOICES>::process(const rack::engine::Module::ProcessArgs&)':
src/FaustModule.cpp:4921:9: error: 'uint' was not declared in this scope; did you mean 'rint'?
 4921 |         uint inputsCV = fRackUI->fParams.fInputCV.size();
      |         ^~~~
      |         rint
src/FaustModule.cpp:4922:18: error: expected ';' before 'chan'
 4922 |         for (uint chan = 0; chan < inputsCV; chan++) {
      |                  ^~~~~
      |                  ;
src/FaustModule.cpp:4922:29: error: 'chan' was not declared in this scope; did you mean 'char'?
 4922 |         for (uint chan = 0; chan < inputsCV; chan++) {
      |                             ^~~~
      |                             char
src/FaustModule.cpp:4922:36: error: 'inputsCV' was not declared in this scope; did you mean 'inputs'?
 4922 |         for (uint chan = 0; chan < inputsCV; chan++) {
      |                                    ^~~~~~~~
      |                                    inputs
src/FaustModule.cpp:4928:27: error: 'inputsCV' was not declared in this scope; did you mean 'inputs'?
 4928 |             inputs[chan + inputsCV].setChannels(VOICES);
      |                           ^~~~~~~~
      |                           inputs
src/FaustModule.cpp:4932:13: error: expected ';' before 'outputsCV'
 4932 |         uint outputsCV = fRackUI->fParams.fOutputCV.size();
      |             ^~~~~~~~~~
      |             ;
src/FaustModule.cpp:4933:18: error: expected ';' before 'chan'
 4933 |         for (uint chan = 0; chan < outputsCV; chan++) {
      |                  ^~~~~
      |                  ;
src/FaustModule.cpp:4933:29: error: 'chan' was not declared in this scope; did you mean 'char'?
 4933 |         for (uint chan = 0; chan < outputsCV; chan++) {
      |                             ^~~~
      |                             char
src/FaustModule.cpp:4933:36: error: 'outputsCV' was not declared in this scope; did you mean 'outputs'?
 4933 |         for (uint chan = 0; chan < outputsCV; chan++) {
      |                                    ^~~~~~~~~
      |                                    outputs
src/FaustModule.cpp:4939:28: error: 'outputsCV' was not declared in this scope; did you mean 'outputs'?
 4939 |             outputs[chan + outputsCV].setChannels(VOICES);
      |                            ^~~~~~~~~
      |                            outputs
src/FaustModule.cpp:4950:67: error: 'inputsCV' was not declared in this scope; did you mean 'inputs'?
 4950 |                 inputs_aux[chan] = ((VOICES == 1) ? inputs[chan + inputsCV].getVoltageSum() : inputs[chan + inputsCV].getVoltage(v))/5.0f;
      |                                                                   ^~~~~~~~
      |                                                                   inputs
src/FaustModule.cpp:4958:32: error: 'outputsCV' was not declared in this scope; did you mean 'outputs'?
 4958 |                 outputs[chan + outputsCV].setVoltage(outputs_aux[chan]*5.0f, v);
      |                                ^~~~~~~~~
      |                                outputs
src/FaustModule.cpp: In constructor 'exfaust3ModuleWidget<VOICES>::exfaust3ModuleWidget(exfaust3Module<VOICES>*)':
src/FaustModule.cpp:5067:13: error: 'uint' was not declared in this scope; did you mean 'rint'?
 5067 |             uint buttons = module->fRackUI->fParams.fButtons.size();
      |             ^~~~
      |             rint
src/FaustModule.cpp:5068:17: error: expected ';' before 'nentries'
 5068 |             uint nentries = module->fRackUI->fParams.fRanges.size();
      |                 ^~~~~~~~~
      |                 ;
src/FaustModule.cpp:5069:17: error: expected ';' before 'bargraphs'
 5069 |             uint bargraphs = module->fRackUI->fParams.fBargraph.size();
      |                 ^~~~~~~~~~
      |                 ;
src/FaustModule.cpp:5070:17: error: expected ';' before 'inputsCV'
 5070 |             uint inputsCV = module->fRackUI->fParams.fInputCV.size();
      |                 ^~~~~~~~~
      |                 ;
src/FaustModule.cpp:5071:17: error: expected ';' before 'outputsCV'
 5071 |             uint outputsCV = module->fRackUI->fParams.fOutputCV.size();
      |                 ^~~~~~~~~~
      |                 ;
src/FaustModule.cpp:5083:42: error: 'bargraphs' was not declared in this scope
 5083 |             vector<int> items = { 2, int(bargraphs), int(buttons), int(nentries), module->fDSP[0].getNumInputs(), module->fDSP[0].getNumOutputs() };
      |                                          ^~~~~~~~~
src/FaustModule.cpp:5083:58: error: 'buttons' was not declared in this scope
 5083 |             vector<int> items = { 2, int(bargraphs), int(buttons), int(nentries), module->fDSP[0].getNumInputs(), module->fDSP[0].getNumOutputs() };
      |                                                          ^~~~~~~
src/FaustModule.cpp:5083:72: error: 'nentries' was not declared in this scope
 5083 |             vector<int> items = { 2, int(bargraphs), int(buttons), int(nentries), module->fDSP[0].getNumInputs(), module->fDSP[0].getNumOutputs() };
      |                                                                        ^~~~~~~~
src/FaustModule.cpp:5103:22: error: expected ';' before 'pa'
 5103 |             for (uint pa = 0; pa < buttons; pa++) {
      |                      ^~~
      |                      ;
src/FaustModule.cpp:5103:31: error: 'pa' was not declared in this scope
 5103 |             for (uint pa = 0; pa < buttons; pa++) {
      |                               ^~
src/FaustModule.cpp:5114:22: error: expected ';' before 'pa'
 5114 |             for (uint pa = 0; pa < nentries; pa++) {
      |                      ^~~
      |                      ;
src/FaustModule.cpp:5114:31: error: 'pa' was not declared in this scope
 5114 |             for (uint pa = 0; pa < nentries; pa++) {
      |                               ^~
src/FaustModule.cpp:5121:22: error: expected ';' before 'pa'
 5121 |             for (uint pa = 0; pa < bargraphs; pa++) {
      |                      ^~~
      |                      ;
src/FaustModule.cpp:5121:31: error: 'pa' was not declared in this scope
 5121 |             for (uint pa = 0; pa < bargraphs; pa++) {
      |                               ^~
src/FaustModule.cpp:5128:17: error: 'inputsCV' was not declared in this scope; did you mean 'inputs'?
 5128 |             if (inputsCV > 0) {
      |                 ^~~~~~~~
      |                 inputs
src/FaustModule.cpp:5130:26: error: expected ';' before 'chan'
 5130 |                 for (uint chan = 0; chan < inputsCV; chan++) {
      |                          ^~~~~
      |                          ;
src/FaustModule.cpp:5130:37: error: 'chan' was not declared in this scope; did you mean 'char'?
 5130 |                 for (uint chan = 0; chan < inputsCV; chan++) {
      |                                     ^~~~
      |                                     char
src/FaustModule.cpp:5139:105: error: 'inputsCV' was not declared in this scope; did you mean 'inputs'?
 5139 |                     addInput(createInputCentered<PJ301MPort>(mm2px(Vec(8.0 + chan * 15, 83.0)), module, inputsCV + chan));
      |                                                                                                         ^~~~~~~~
      |                                                                                                         inputs
src/FaustModule.cpp:5144:17: error: 'outputsCV' was not declared in this scope; did you mean 'outputs'?
 5144 |             if (outputsCV > 0) {
      |                 ^~~~~~~~~
      |                 outputs
src/FaustModule.cpp:5146:26: error: expected ';' before 'chan'
 5146 |                 for (uint chan = 0; chan < outputsCV; chan++) {
      |                          ^~~~~
      |                          ;
src/FaustModule.cpp:5146:37: error: 'chan' was not declared in this scope; did you mean 'char'?
 5146 |                 for (uint chan = 0; chan < outputsCV; chan++) {
      |                                     ^~~~
      |                                     char
src/FaustModule.cpp:5155:108: error: 'outputsCV' was not declared in this scope; did you mean 'outputs'?
 5155 |                     addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(8.0 + chan * 15, 117.0)), module, outputsCV + chan));
      |                                                                                                            ^~~~~~~~~
      |                                                                                                            outputs
src/FaustModule.cpp: In instantiation of 'struct RackUI<1>':
src/FaustModule.cpp:4841:19:   required from 'exfaust3Module<VOICES>::exfaust3Module() [with int VOICES = 1]'
../../include/helpers.hpp:23:24:   required from 'rack::engine::Module* rack::createModel(const string&)::TModel::createModule() [with TModule = exfaust3Module<1>; TModuleWidget = exfaust3ModuleWidget<1>]'
../../include/helpers.hpp:39:2:   required from 'rack::plugin::Model* rack::createModel(const string&) [with TModule = exfaust3Module<1>; TModuleWidget = exfaust3ModuleWidget<1>; std::string = std::__cxx11::basic_string<char>]'
src/FaustModule.cpp:5182:106:   required from here


src/FaustModule.cpp: In instantiation of 'exfaust3ModuleWidget<VOICES>::exfaust3ModuleWidget(exfaust3Module<VOICES>*) [with int VOICES = 1]':
../../include/helpers.hpp:30:28:   required from 'rack::app::ModuleWidget* rack::createModel(const string&)::TModel::createModuleWidget() [with TModule = exfaust3Module<1>; TModuleWidget = exfaust3ModuleWidget<1>]'
../../include/helpers.hpp:39:2:   required from 'rack::plugin::Model* rack::createModel(const string&) [with TModule = exfaust3Module<1>; TModuleWidget = exfaust3ModuleWidget<1>; std::string = std::__cxx11::basic_string<char>]'
src/FaustModule.cpp:5182:106:   required from here
src/FaustModule.cpp:5083:25: error: could not convert '{2, <expression error>, <expression error>, <expression error>, module->exfaust3Module<1>::fDSP[0].exfaust3::getNumInputs(), module->exfaust3Module<1>::fDSP[0].exfaust3::getNumOutputs()}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
 5083 |             vector<int> items = { 2, int(bargraphs), int(buttons), int(nentries), module->fDSP[0].getNumInputs(), module->fDSP[0].getNumOutputs() };
      |                         ^~~~~
      |                         |
      |                         <brace-enclosed initializer list>
src/FaustModule.cpp: At global scope:

I deleted the "Warnings"

jpnielsen avatar Sep 18 '21 06:09 jpnielsen

Since this is not a Faust related compilation issue, I hope @AndrewBelt can have a look.

sletz avatar Sep 18 '21 06:09 sletz

Here, I run make in a dir exported from the Faust web GUI

On which OS are you compiling?

sletz avatar Sep 18 '21 06:09 sletz

Sorry, wrong file - it was for the OWL

Here's the right file binary..zip

Edit: It came from here:

image

jpnielsen avatar Sep 18 '21 06:09 jpnielsen

Here, I run make in a dir exported from the Faust web GUI

On which OS are you compiling?

Windows 10 MSYS2 Mingw64

jpnielsen avatar Sep 18 '21 06:09 jpnielsen

Can you try to add the following lines at the beginning of the FaustModule.cpp file and recompile ?

#ifdef WIN32
#define uint unsigned int
#endif

or

#ifdef WIN32
typedef unsigned int uint
#endif

sletz avatar Sep 18 '21 06:09 sletz

#ifdef WIN32 #define uint unsigned int #endif


src/FaustModule.cpp:4857:9: error: 'uint' was not declared in this scope; did you mean 'rint'? 4857 | uint buttons = params.fButtons.size(); | ^~~~ | rint

or

#ifdef WIN32
typedef unsigned int uint
#endif

No difference, still get the error:

src/FaustModule.cpp:4858:9: error: 'uint' was not declared in this scope; did you mean 'rint'? 4858 | uint buttons = params.fButtons.size(); | ^~~~ | rint

Anyhow - I'll just close this and use Ableton + Max/MSP instead. Every time i want to try installing something from source I have to solve a bunch of errors first.

jpnielsen avatar Sep 18 '21 06:09 jpnielsen

Yes, this is probably te different between commercial products, and open-source projects where testing on all possible software combinations is usually out of reach with limited resources.

sletz avatar Sep 18 '21 07:09 sletz

Never the less an issue is only closed if it is solved (or nobody will pick it up over an extended period of time).

mxa avatar Sep 18 '21 07:09 mxa

OK, Issue reported.

I don't have ressources to do further investigation/debugging.

jpnielsen avatar Sep 18 '21 07:09 jpnielsen

If someone has the same issue she or he can pick it up from here.

mxa avatar Sep 18 '21 07:09 mxa

partly solved, trying to build "VCV-Prototype" from git (branch v1)

The issue with Submodule 'efsw'

premake4 is missing

premake4 is not installlable via pacman default repositories on msys2 MinGW 64

get it from https://sourceforge.net/projects/premake/files/Premake/4.4/premake-4.4-beta5-windows.zip/download

extract and copy premake4.exe to \msys64\mingw64\bin

jpnielsen avatar Sep 18 '21 16:09 jpnielsen

I did this:

cd Rack/plugins
git clone https://github.com/VCVRack/VCV-Prototype.git
cd VCV-Prototype/
git submodule update --init --recursive
make dep

....

# PD_INTERNAL leaves the function declarations for libpd unchanged
# not specifying that flag would enable the  "EXTERN __declspec(dllexport) extern" macro
# which throws a linker error. I guess this macro should only be used for the windows
# specific .dll dynamic linking format.
# The corresponding #define resides in "m_pd.h" inside th Pure Data sources
FLAGS += -DPD_INTERNAL -Ofast
make: FLAGS: No such file or directory
make: *** [Makefile:221: dep/lib/libpd.a] Error 127

jpnielsen avatar Sep 18 '21 16:09 jpnielsen

A Pure Data issue AFAICS

sletz avatar Sep 18 '21 16:09 sletz

A Pure Data issue AFAICS

That's obvious,

I'm opening a new issue for the faust2vcvrack export compilation problems.

edit add: https://github.com/VCVRack/VCV-Prototype/issues/55

jpnielsen avatar Sep 18 '21 16:09 jpnielsen

I did this:

cd Rack/plugins
git clone https://github.com/VCVRack/VCV-Prototype.git
cd VCV-Prototype/
git submodule update --init --recursive
make dep

....

# PD_INTERNAL leaves the function declarations for libpd unchanged
# not specifying that flag would enable the  "EXTERN __declspec(dllexport) extern" macro
# which throws a linker error. I guess this macro should only be used for the windows
# specific .dll dynamic linking format.
# The corresponding #define resides in "m_pd.h" inside th Pure Data sources
FLAGS += -DPD_INTERNAL -Ofast
make: FLAGS: No such file or directory
make: *** [Makefile:221: dep/lib/libpd.a] Error 127

Sounds a bit like there is a build folder from a previous build which you should delete first.

mxa avatar Sep 19 '21 01:09 mxa

Sounds a bit like there is a build folder from a previous build which you should delete first.

Did it again, with rm -rf Rack/plugins/VCV-Prototype first, just to be sure:

This is the error again:

rm -rf Rack/plugins/VCV-Prototype
cd Rack/plugins
git clone https://github.com/VCVRack/VCV-Prototype.git
cd VCV-Prototype/
git submodule update --init --recursive

make dep

... many lines ...

cd dep && git clone "https://github.com/libpd/libpd.git" --recursive
Cloning into 'libpd'...
remote: Enumerating objects: 7665, done.
remote: Counting objects: 100% (179/179), done.
remote: Compressing objects: 100% (129/129), done.
remote: Total 7665 (delta 96), reused 102 (delta 49), pack-reused 7486
Receiving objects: 100% (7665/7665), 8.47 MiB | 10.36 MiB/s, done.
Resolving deltas: 100% (4187/4187), done.
Updating files: 100% (232/232), done.
Submodule 'jni/opensl_stream' (git://github.com/nettoyeurny/opensl_stream.git) registered for path 'jni/opensl_stream'
Submodule 'pure-data' (git://github.com/pure-data/pure-data) registered for path 'pure-data'
Cloning into '/home/jpn99/projects/Rack/plugins/VCV-Prototype/dep/libpd/jni/opensl_stream'...
remote: Enumerating objects: 51, done.
remote: Total 51 (delta 0), reused 0 (delta 0), pack-reused 51
Receiving objects: 100% (51/51), 12.16 KiB | 622.00 KiB/s, done.
Resolving deltas: 100% (28/28), done.
Cloning into '/home/jpn99/projects/Rack/plugins/VCV-Prototype/dep/libpd/pure-data'...
remote: Enumerating objects: 25833, done.
remote: Counting objects: 100% (1059/1059), done.
remote: Compressing objects: 100% (511/511), done.
remote: Total 25833 (delta 635), reused 889 (delta 548), pack-reused 24774
Receiving objects: 100% (25833/25833), 44.15 MiB | 11.22 MiB/s, done.
Resolving deltas: 100% (18954/18954), done.
Submodule path 'jni/opensl_stream': checked out '5f3930698569754c519f5b3e4cc7691223bc99a8'
Submodule path 'pure-data': checked out 'eeef4ba9130d3182146927c37fa57d61bbff0f0b'
cd dep/libpd && git checkout 5772a612527f06597d44d195843307ad0e3578fe
Note: switching to '5772a612527f06597d44d195843307ad0e3578fe'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 5772a61 updated changelog, updated attribution year, version bump
# PD_INTERNAL leaves the function declarations for libpd unchanged
# not specifying that flag would enable the  "EXTERN __declspec(dllexport) extern" macro
# which throws a linker error. I guess this macro should only be used for the windows
# specific .dll dynamic linking format.
# The corresponding #define resides in "m_pd.h" inside th Pure Data sources
FLAGS += -DPD_INTERNAL -Ofast
make: FLAGS: No such file or directory
make: *** [Makefile:221: dep/lib/libpd.a] Error 127

jpnielsen avatar Sep 19 '21 02:09 jpnielsen

Thanks for reporting. We will check soon on our windows build machine. On my mac it still builds without errors. (Allthough I had to deactivate linking supercollider here!)

clwe avatar Sep 19 '21 08:09 clwe

On windows MSYS2 the faust engine doesn't compile for me. This is the error:

g++ -std=c++11 -Wsuggest-override  -Idep/include -Idep/vult -Idep/include/libpd -DHAVE_LIBDL -DPD_INTERNAL -Ofast -DINTERP -fPIC -I../Rack-SDK-1.1.6//include -I../Rack-SDK-1.1.6//dep/include -MMD -MP -g -O3 -march=nocona -funsafe-math-optimizations -Wall -Wextra -Wno-unused-parameter -DARCH_WIN -D_USE_MATH_DEFINES  -c -o build/src/FaustEngine.cpp.o src/FaustEngine.cpp
In file included from src/FaustEngine.cpp:44:
dep/include/faust/dsp/interpreter-dsp.h:27: warning: "DEPRECATED" redefined
   27 | #define DEPRECATED(fun) __declspec(deprecated) fun
      |
In file included from ../Rack-SDK-1.1.6//include/rack.hpp:6,
                 from src/ScriptEngine.hpp:2,
                 from src/FaustEngine.cpp:24:
../Rack-SDK-1.1.6//include/common.hpp:28: note: this is the location of the previous definition
   28 |  #define DEPRECATED __attribute__ ((deprecated))
      |
src/FaustEngine.cpp: In member function 'virtual int FaustEngine::run(const string&, const string&)':
src/FaustEngine.cpp:252:12: error: 'MAX_PATH' was not declared in this scope
  252 |   char buf[MAX_PATH + 1] = {0};
      |            ^~~~~~~~
src/FaustEngine.cpp:253:22: error: 'buf' was not declared in this scope
  253 |   GetTempPath(sizeof(buf), buf);
      |                      ^~~
src/FaustEngine.cpp:253:3: error: 'GetTempPath' was not declared in this scope
  253 |   GetTempPath(sizeof(buf), buf);
      |   ^~~~~~~~~~~
make: *** [../Rack-SDK-1.1.6//compile.mk:69: build/src/FaustEngine.cpp.o] Error 1

clwe avatar Sep 20 '21 11:09 clwe

partly solved, trying to build "VCV-Prototype" from git (branch v1)

The issue with Submodule 'efsw'

premake4 is missing

premake4 is not installlable via pacman default repositories on msys2 MinGW 64

get it from https://sourceforge.net/projects/premake/files/Premake/4.4/premake-4.4-beta5-windows.zip/download

extract and copy premake4.exe to \msys64\mingw64\bin

I had the same premake4 issue.

I think we should update to premake5. With premake5, the build configuration "release" is unknown in the generated Makefile "efsw-static-lib.make" and needs to be "release_x86_64" or "release_x86". We would need further changes in the Makefile, since the efsw library name then changes from "libefsw-static-release.a" to "efsw-static-release.lib" (here on windows).

clwe avatar Sep 20 '21 11:09 clwe

I did this:

cd Rack/plugins
git clone https://github.com/VCVRack/VCV-Prototype.git
cd VCV-Prototype/
git submodule update --init --recursive
make dep

....

# PD_INTERNAL leaves the function declarations for libpd unchanged
# not specifying that flag would enable the  "EXTERN __declspec(dllexport) extern" macro
# which throws a linker error. I guess this macro should only be used for the windows
# specific .dll dynamic linking format.
# The corresponding #define resides in "m_pd.h" inside th Pure Data sources
FLAGS += -DPD_INTERNAL -Ofast
make: FLAGS: No such file or directory
make: *** [Makefile:221: dep/lib/libpd.a] Error 127

Commit d7b16f7f0740b0002317e1882a967787a4815b64 should fix this issue.

clwe avatar Sep 20 '21 11:09 clwe

When I try to build the supercollider engine on windows MSYS2 I get this error:

CMake Error at server/scsynth/CMakeLists.txt:26 (message):
  Portaudio selected as audio API, but development files not found

I guess this dependency is missing. Should portaudio be part of the windows build at all?

clwe avatar Sep 20 '21 11:09 clwe

partly solved, trying to build "VCV-Prototype" from git (branch v1) The issue with Submodule 'efsw' premake4 is missing premake4 is not installlable via pacman default repositories on msys2 MinGW 64 get it from https://sourceforge.net/projects/premake/files/Premake/4.4/premake-4.4-beta5-windows.zip/download extract and copy premake4.exe to \msys64\mingw64\bin

I had the same premake4 issue.

I think we should update to premake5. With premake5, the build configuration "release" is unknown in the generated Makefile "efsw-static-lib.make" and needs to be "release_x86_64" or "release_x86". We would need further changes in the Makefile, since the efsw library name then changes from "libefsw-static-release.a" to "efsw-static-release.lib" (here on windows).

I have premake5 installed in \msys64\mingw64\bin Your suggested changes worked for me. PR made for review.

SteveRussell33 avatar Sep 20 '21 14:09 SteveRussell33

When I try to build the supercollider engine on windows MSYS2 I get this error:

CMake Error at server/scsynth/CMakeLists.txt:26 (message):
  Portaudio selected as audio API, but development files not found

I guess this dependency is missing. Should portaudio be part of the windows build at all?

I solved this by changing entries in the makefile to update supercollider to v3.12 instead of using the old vcv-prototype support branch. This builds portaudio as part of supercollider without ASIO support.

cd dep/supercollider/build && cmake -G 'MSYS Makefiles' -DCMAKE_INSTALL_PREFIX="/c/_Projects/VCVRack/V1/Rack/plugins/VCV-Prototype/dep" -DCMAKE_INSTALL_LIBDIR=lib .. -DSUPERNOVA=0 -DSC_EL=0 -DSC_VIM=0 -DSC_ED=0 -DSC_IDE=0 -DSC_ABLETON_LINK=0 -DSC_QT=0 -DCMAKE_BUILD_TYPE=Release -DSCLANG_SERVER=0 -DBUILD_TESTING=0 -DNO_LIBSNDFILE=1
-- The C compiler identification is GNU 10.3.0
-- The CXX compiler identification is GNU 10.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- SuperCollider Version: 3.12.1
-- Building from branch HEAD, commit hash is 3a6eabc
-- PortAudio: building static library
CMake Deprecation Warning at external_libraries/portaudio/portaudio_submodule/CMakeLists.txt:7 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Could NOT find ASIOSDK (missing: ASIOSDK_ROOT_DIR ASIOSDK_INCLUDE_DIR)
-- DirectSound support will be built with DSound provided by MinGW.
-- Building PortAudio WITHOUT support for ASIO
-- Using bundled boost
-- Using bundled yaml-cpp
-- HIDAPI components:
--     Windows
--     hidapi_parser
-- Building with HID support
-- FFT library (scsynth): Green
-- Audio API (scsynth): portaudio
-- Configuring done
-- Generating done

make dep completes, however when I go to make a vcv-prototype distribution I get this:

In file included from src/SuperColliderEngine.cpp:4:
dep/supercollider/lang/LangSource/SC_LanguageConfig.hpp:28:10: fatal error: boost/filesystem/path.hpp: No such file or directory
   28 | #include <boost/filesystem/path.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [../../compile.mk:69: build/src/SuperColliderEngine.cpp.o] Error 1

I solved this by adding the Boost libs I have already installed (for another plugin) to the makefile flags. CXXFLAGS += -I c:/_Projects/boost_1_77_0/ -O3

I then get this error:

src/FaustEngine.cpp: In member function 'virtual int FaustEngine::run(const string&, const string&)':
src/FaustEngine.cpp:252:12: error: 'MAX_PATH' was not declared in this scope
  252 |   char buf[MAX_PATH + 1] = {0};
      |            ^~~~~~~~
src/FaustEngine.cpp:253:22: error: 'buf' was not declared in this scope
  253 |   GetTempPath(sizeof(buf), buf);
      |                      ^~~
src/FaustEngine.cpp:253:3: error: 'GetTempPath' was not declared in this scope
  253 |   GetTempPath(sizeof(buf), buf);
      |   ^~~~~~~~~~~
make: *** [../../compile.mk:69: build/src/FaustEngine.cpp.o] Error 1

This is the line in question: https://github.com/VCVRack/VCV-Prototype/blob/d7b16f7f0740b0002317e1882a967787a4815b64/src/FaustEngine.cpp#L252

And that is as far as I've gotten atm.

SteveRussell33 avatar Sep 20 '21 17:09 SteveRussell33