grame-cncm / faust

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

mesh2faust failing to build on Ubuntu 22.04 (Win 11 WSL) #986

Closed retromore closed 8 months ago

retromore commented 8 months ago

Trying to compile mesh2faust on Ubuntu 22.04 (Win 11 WSL); After fixing all dependencies the compiler gets to 97% and then throws the following error:

[ 97%] Building CXX object CMakeFiles/mesh2faust-bin.dir/src/main.cpp.o
/home/rtt/mesh2faust/src/main.cpp: In function ‘int main(int, char**)’:
/home/rtt/mesh2faust/src/main.cpp:180:33: error: no matching function for call to ‘mesh2faust(const char*&, <brace-enclosed initializer list>)’
  180 |     string dsp = m2f::mesh2faust(
      |                  ~~~~~~~~~~~~~~~^
  181 |         objectFileName,
      |         ~~~~~~~~~~~~~~~
  182 |         {
      |         ~
  183 |             modelName,
      |             ~~~~~~~~~~
  184 |             materialProperties,
      |             ~~~~~~~~~~~~~~~~~~~
  185 |             freqControl,
      |             ~~~~~~~~~~~~
  186 |             modesMinFreq,
      |             ~~~~~~~~~~~~~
  187 |             modesMaxFreq,
      |             ~~~~~~~~~~~~~
  188 |             targetNModes,
      |             ~~~~~~~~~~~~~
  189 |             femNModes,
      |             ~~~~~~~~~~
  190 |             exPos,
      |             ~~~~~~
  191 |             nExPos,
      |             ~~~~~~~
  192 |             showFreqs,
      |             ~~~~~~~~~~
  193 |             debugMode
      |             ~~~~~~~~~
  194 |         }
      |         ~
  195 |     );
      |     ~
In file included from /home/rtt/mesh2faust/src/main.cpp:1:
/home/rtt/mesh2faust/src/mesh2faust.h:34:13: note: candidate: ‘std::string m2f::mesh2faust(const char*, m2f::MaterialProperties, m2f::CommonArguments)’
   34 | std::string mesh2faust(
      |             ^~~~~~~~~~
/home/rtt/mesh2faust/src/mesh2faust.h:36:24: note:   no known conversion for argument 2 from ‘<brace-enclosed initializer list>’ to ‘m2f::MaterialPropertie’
   36 |     MaterialProperties materialProperties = {}, // material properties to set on the generated volumetric mesh
      |     ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/home/rtt/mesh2faust/src/mesh2faust.h:42:13: note: candidate: ‘std::string m2f::mesh2faust(TetMesh*, m2f::CommonArguments)’
   42 | std::string mesh2faust(TetMesh *volumetricMesh, CommonArguments args = {});
      |             ^~~~~~~~~~
/home/rtt/mesh2faust/src/mesh2faust.h:42:33: note:   no known conversion for argument 1 from ‘const char*’ to ‘TetMesh*’
   42 | std::string mesh2faust(TetMesh *volumetricMesh, CommonArguments args = {});
      |                        ~~~~~~~~~^~~~~~~~~~~~~~
/home/rtt/mesh2faust/src/mesh2faust.h:44:13: note: candidate: ‘std::string m2f::mesh2faust(const Eigen::SparseMatrix<double>&, const Eigen::SparseMatrix<double>&, int, int, m2f::CommonArguments)’
   44 | std::string mesh2faust(
      |             ^~~~~~~~~~
/home/rtt/mesh2faust/src/mesh2faust.h:44:13: note:   candidate expects 5 arguments, 2 provided
make[2]: *** [CMakeFiles/mesh2faust-bin.dir/build.make:76: CMakeFiles/mesh2faust-bin.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:111: CMakeFiles/mesh2faust-bin.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Any suggestions on how to fix this?

sletz commented 8 months ago

@khiner Any idea how to fix ?

khiner commented 8 months ago

It looks like I must have missed updating the main.cpp after pulling the material props out of the common arguments. I haven't tested this yet, but just looking at the code, I hope that this change would fix:

Change this:

    string dsp = m2f::mesh2faust(
        objectFileName,
        {
            modelName,
            materialProperties,
            freqControl,
            modesMinFreq,
            modesMaxFreq,
            targetNModes,
            femNModes,
            exPos,
            nExPos,
            showFreqs,
            debugMode
        }
    );

to this:

    string dsp = m2f::mesh2faust(
        objectFileName,
        materialProperties,
        {
            modelName,
            freqControl,
            modesMinFreq,
            modesMaxFreq,
            targetNModes,
            femNModes,
            exPos,
            nExPos,
            showFreqs,
            debugMode
        }
    );

I'll test this soon, apologies for the oversight!

khiner commented 8 months ago

I confirmed this fixes. I'll submit a PR soon.

khiner commented 8 months ago

PR: https://github.com/grame-cncm/faust/pull/987

retromore commented 8 months ago

I confirmed this fixes. I'll submit a PR soon.

Yes! That fixed it, thanks a lot and happy new year!

khiner commented 8 months ago

Glad to hear it - happy new year!