Skip to content
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

Changes to allow building wasm csound using emscripten, cmake and vckpg #1797

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

nonameentername
Copy link

Changes to allow building wasm csound using emscripten, cmake and vckpg

@nonameentername nonameentername changed the base branch from master to develop December 21, 2023 19:00
@nonameentername nonameentername force-pushed the feature/vcpkg-buld-wasm branch 2 times, most recently from 44dde6e to 017ae7b Compare December 21, 2023 19:03
@nonameentername nonameentername changed the title Feature/vcpkg buld wasm Changes to allow building wasm csound using emscripten, cmake and vckpg Dec 21, 2023
@nonameentername nonameentername marked this pull request as draft December 21, 2023 19:06
CMakeLists.txt Outdated Show resolved Hide resolved
Engine/csound_pre.lex Outdated Show resolved Hide resolved
@nonameentername nonameentername force-pushed the feature/vcpkg-buld-wasm branch 2 times, most recently from d1ca684 to a1724a1 Compare December 28, 2023 00:59
@gogins
Copy link
Contributor

gogins commented Dec 28, 2023 via email

@kunstmusik
Copy link
Member

kunstmusik commented Dec 30, 2023 via email

@nonameentername
Copy link
Author

The existing wasm build found in the wasm folder is using nix and wasi-sdk to create a wasm build.
There is some pre-processing that patches the source code with similar changes to the ones in this pull request before it compiles csound.

The changes in this pull request use vcpkg and emscripten compiler to create the wasm build.

@nonameentername nonameentername force-pushed the feature/vcpkg-buld-wasm branch 8 times, most recently from 91a5380 to 0d45a23 Compare January 9, 2024 05:27
@nonameentername
Copy link
Author

Created a pull request to update vcpkg libflac microsoft/vcpkg#36080. Once merged the local libflac port can be removed.

@nonameentername nonameentername marked this pull request as ready for review January 9, 2024 05:47
@vlazzarini
Copy link
Member

@kunstmusik how are we with this PR? Ready to merge?

@kunstmusik
Copy link
Member

Took a look at this now and tried to reproduce the build locally on macOS. Installed emsdk and got through configuration and then tried to build:

stevenyi@stevens-MacBook-Pro cs7-prs % cmake --build build --config Release
[ 0%] Building C object CMakeFiles/csound.dir/Top/csound.c.o
/Users/stevenyi/work/csound/cs7-prs/Top/csound.c:1237:14: fatal error: 'execinfo.h' file not found
1237 | #include <execinfo.h>
| ^~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/csound.dir/Top/csound.c.o] Error 1
make[1]: *** [CMakeFiles/csound.dir/all] Error 2
make: *** [all] Error 2

Guessing this PR needs changes for macOS.

I was able to build our current nix-based WASM build from this branch though have not tested yet what was built.

Sidenote: @vlazzarini I saw we have a lot of preprocessor checks for NACL. I think these could be removed.

Also, there is a mixture now in our codebase between checking wasm and wasi. Haven't checked, but I wonder if we can normalize on one (i.e., will our nix-based build work if we just check for wasm ?).

cc: @hlolli

@kunstmusik
Copy link
Member

Also to note, I saw a number of messages in the github actions build regarding data sizes for LONG and others. I seem to remember we patched some code back regarding sizes when we used Emscripten in CS6. Not sure what to make of this yet, but I wanted to note it here.

@vlazzarini
Copy link
Member

Sidenote: @vlazzarini I saw we have a lot of preprocessor checks for NACL. I think these could be removed.

working on these now.

@nonameentername nonameentername force-pushed the feature/vcpkg-buld-wasm branch 2 times, most recently from 6fcab20 to 24fe223 Compare April 28, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants