-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building ofxPd using Emscripten #75
Comments
The first step is to read the error and interpret what it might mean. openFrameworks is mostly C++ and while is libpd mostly C files. It looks like whoever made the script/makefile which builds the source files for the openFrameworks emscripten target did not test building C files as well as C++ files. The compiler seems to be saying "I can build C files, but not with the C++ stdlib." The quoted flag in the error message needs to be taken out where the compiler is being called to build the C file. I have no idea where and, as this is a general issue, I would ask the openFramneworks enscripten people. Also, I have no idea if using libpd in emscripten will work, ie. audio in/out. |
Thank you so much for your answer. P.S: It seems like there's at least one person who could compile libpd using Emscripten: https://www.reddit.com/r/puredata/comments/8g8ahc/libpd_compiled_to_llvmwasm_has_this_been_done_or/ |
I could successfully build Here are the steps I took:
After these steps, I could successfully build However, when I run the project on the browser, it didn't work properly. P.S: I accidentally found this https://mathr.co.uk/empd/#empd |
Okay, I could almost successfully build and run Here are the full steps:
And here's the screenshot: Although there are some errors and |
Hey @danomatika, i tried to run the examples with Emscripten following the steps from @cuinjune, but without success. While it is possible to build with Emscripten (if I change the example and the patch here and there), if I use the ofxPd version that is included in OfxOfelia. It would be really great, if the official ofxPd version would be compatible with Emscripten too. |
Honestly, I am never likely to use Emscripten, so it is up to y’all to make a PR where I can simply review the required changes. If you look on the pure-data Github repo itself, there is an issue about required changes for Emacripten support for the Pd sources, if you’ve not seen it already.
I prefer *not* to provide local hacks and would much rather accept changes made upstream, ie. libpd/pure-data, so I suggest starting there and working back toward here.
enohp ym morf tnes
-----------
Dan Wilcox
danomatika.com
robotcowboy.com
… On Nov 23, 2021, at 4:02 PM, Jonathan ***@***.***> wrote:
Hey @danomatika, i tried to run the examples with Emscripten following the steps from @cuinjune, but without success. While it is possible to build with Emscripten (if I change the example and the patch here and there), if I use the ofxPd version that is included in OfxOfelia. It would be really great if the official ofxPd version would be compatible with Emscripten too.
Here is a discussion (there is one issue left with pd.closePatch with the ofxPd version from @cuinjune).
Here is a discussion: openframeworks/openFrameworks#6781
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
@danomatika I guess this issue can be closed, because compiling with Emscripten is possible without any changes now. |
Please test the I don't normally use a develop branch here but this warrants additional testing in case we need to fix anything inside the Pd core itself. |
@danomatika tested the pdExample with Emscripten and it works well. There are a few things that I had to change in the patch (which was also the case with earlier attempts): |
I'm not willing to change the default example/test patch. What do you mean by "do not work" ie. does the app crash or does the patch simply do nothing? |
Thats not what I wanted to say. I wanted to say that it is expected behavior that the pdExample does not work with Emscripten as it is (which is not a problem for me). And tell what need to be theoretically(!) changed. The app does nothing and this is the error message:
|
Seems like a bug then... I would expect the app to maybe not work but at least not crash. That is the point of the patch: as a test as well a showing basic functionality. |
So the problematic PD objects with Emscripten are (so far): [array], [midiout], [midiin] and [sysexin]. |
For the last three, it might need to be built with s_midi_dummy.c instead of s_libpdmidi.c or the libpd part should be disabled via an ifdef for EMSCRIPTEN.enohp ym morf tnes-----------Dan Wilcoxdanomatika.comrobotcowboy.comOn Apr 11, 2024, at 1:01 AM, Jonathan Frank ***@***.***> wrote:
So the problematic PD objects with Emscripten are [array], [midiout], [midiin] and [sysexin].
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I made a webMIDI proposal for OF some time ago, which works quite well: openframeworks/openFrameworks#7259 I get this error when I replace
|
Then this is probably not the right approach to fix this. Sending a message from Pd through a midi object just results in the appropriate midi hook function getting called. There is no built-in midi library, so this should not trigger a crash. It's a bug. I would ask @claudeha or @Spacechild1 about this since now is the time to test, find bugs, and fix them if you want the fixes in pure-data or libpd any time soon... |
On 11/04/2024 08:35, Dan Wilcox wrote:
There is no built-in midi library, so this should not trigger a crash.
It's a bug.
I would ask @claudeha <https://github.com/claudeha> or @Spacechild1
<https://github.com/Spacechild1> about this since /now/ is the time to
test, find bugs, and fix them if you want the fixes in pure-data or
libpd any time soon...
See libpd/libpd#395 , I haven't tested any
WebMIDI API or similar.
Emscripten is stricter about casting function pointers (they must be
called at the exact original type), which is the reason for the original
runtime failure.
|
I tried building
ofxPd/pdExample
project using Emscripten following this instruction: https://openframeworks.cc/setup/emscripten/After running
emmake make
, it fails with the following error when it tries to buildc
files inlibpd
folder.What should I do to fix this error? I would appreciate any advice.
P.S: I used
openFrameworks-master
branch since other versions have problem building Emscripten.The text was updated successfully, but these errors were encountered: