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

Fix emscripten build #258

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

liulongbiao
Copy link

Fixed some issue when I use docker to build aubio with emscripten.

Now we can use Docker to build WebAssembly module with :

docker run --rm -v $(pwd):/src trzeci/emscripten /bin/bash -c "./scripts/get_waf.sh && ./scripts/build_emscripten"

CC may be resolved as absolute path, such as /emsdn_portable/sdk/emcc.
And add empty __init__.py files.
the default encoding is utf8, and will print like `u'xxx'`
Some tests needs dynamic library.
Since default build will test and generate docs, so emscripten build just need the wasm module
use 'aubio' as exported module name
@piem
Copy link
Member

piem commented Aug 28, 2019

hi @liulongbiao,

thanks! looks good to me, except the first commit. will comment in details.

cheers, piem

Copy link
Member

@piem piem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. why would you need to create the __init__.py files? these directories are not python modules
  2. what's missing with the current test?
>>> 'emcc' in '/path/to/emcc -E'
True

Copy link
Member

@piem piem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests and examples were correctly build last time i checked, and could be run with node. why disable them? see wscript#L528

Copy link
Member

@piem piem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you describe a configuration where the list c_mangled_names is not generated correctly?

@liulongbiao
Copy link
Author

  1. why would you need to create the __init__.py files? these directories are not python modules
  2. what's missing with the current test?
>>> 'emcc' in '/path/to/emcc -E'
True

without the __init__.py files, when configure with --with-target-platform emscripten, will got:

  File "/src/wscript", line 275, in configure
    from python.lib.gen_external import get_c_declarations, \
ImportError: No module named python.lib.gen_external

@liulongbiao
Copy link
Author

tests and examples were correctly build last time i checked, and could be run with node. why disable them? see wscript#L528

When I execute the script scripts/build_emscripten with tests, I got :

[ 85/223] Compiling tests/src/spectral/test-fft.c
[ 86/223] Compiling tests/src/spectral/test-filterbank.c
emcc:WARNING: ignoring unsupported linker flag: `--enable-auto-import`
emcc:WARNING: ignoring unsupported linker flag: `-h`
emcc:WARNING: ignoring unsupported linker flag: `aubio.min.js.5`
emcc:WARNING: ignoring unsupported linker flag: `-Bstatic`
emcc:WARNING: ignoring unsupported linker flag: `-Bdynamic`

[ 87/223] Compiling tests/src/spectral/test-filterbank_mel.c
[ 88/223] Compiling tests/src/spectral/test-mfcc.c
[ 89/223] Linking build/tests/test-sink.js
shared:ERROR: emcc: cannot find library "aubio" (`-s ERROR_ON_MISSING_LIBRARIES=0` to disable this error)

Waf: Leaving directory `/src/build'
Build failed
 -> task in 'test-sink' failed with exit status 1 (run with -v to display more information)

@piem
Copy link
Member

piem commented Sep 24, 2019

hi @liulongbiao

please don't close this issue until it is resolved. i will have a deeper look. thanks for your patience,

Paul

@piem piem reopened this Sep 24, 2019
@codecov
Copy link

codecov bot commented Sep 24, 2019

Codecov Report

Merging #258 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #258   +/-   ##
=======================================
  Coverage   88.09%   88.09%           
=======================================
  Files         124      124           
  Lines        9716     9716           
  Branches     1729     1729           
=======================================
  Hits         8559     8559           
  Misses       1110     1110           
  Partials       47       47

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63fc1df...9092747. Read the comment docs.

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

2 participants