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

Please remove front-matter.js? #351

Closed
regnaio opened this issue Jan 25, 2021 · 2 comments
Closed

Please remove front-matter.js? #351

regnaio opened this issue Jan 25, 2021 · 2 comments

Comments

@regnaio
Copy link

regnaio commented Jan 25, 2021

I'm unsure why there is the file front-matter.js? It is breaking the build process

I'm on Windows 10 with emsdk install 1.39.0. The last few lines of output from running cmake --build builds are:

shared : error : C:/dev/ammo.js/front-matter.js: Input file has an unknown suffix, don't know what to do with it! [C:\dev\ammo.js\builds\ammo-javascript.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(238,5): error MSB8066: Custom build for 'C:\dev\amm
o.js\builds\CMakeFiles\f8eaa61671472485174d6f054ffab191\ammo.js.rule;C:\dev\ammo.js\builds\CMakeFiles\e6bbd10bfef2029d5b5b22613118c551\ammo-javascript.rule' exited wit
h code 1. [C:\dev\ammo.js\builds\ammo-javascript.vcxproj]
  Building ammo webassembly
shared : error : C:/dev/ammo.js/front-matter.js: Input file has an unknown suffix, don't know what to do with it! [C:\dev\ammo.js\builds\ammo-wasm.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(238,5): error MSB8066: Custom build for 'C:\dev\amm
o.js\builds\CMakeFiles\f8eaa61671472485174d6f054ffab191\ammo.wasm.js.rule;C:\dev\ammo.js\builds\CMakeFiles\e6bbd10bfef2029d5b5b22613118c551\ammo-wasm.rule' exited with
 code 1. [C:\dev\ammo.js\builds\ammo-wasm.vcxproj]

Removing front-matter.js and deleting set(AMMO_FRONT_MATTER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/front-matter.js) from CMakeLists.txt allows me to get further into the build process, but it still fails due to:

wasm-ld : error : glue.o: undefined symbol: gContactAddedCallback [C:\dev\ammo.js\builds\ammo-javascript.vcxproj]
wasm-ld : error : glue.o: undefined symbol: gContactProcessedCallback [C:\dev\ammo.js\builds\ammo-javascript.vcxproj]
wasm-ld : error : glue.o: undefined symbol: gContactDestroyedCallback [C:\dev\ammo.js\builds\ammo-javascript.vcxproj]
wasm-ld : error : glue.o: undefined symbol: vtable for btSphereShape [C:\dev\ammo.js\builds\ammo-javascript.vcxproj]
wasm-ld : error : glue.o: undefined symbol: vtable for btDefaultVehicleRaycaster [C:\dev\ammo.js\builds\ammo-javascript.vcxproj]
shared : error : 'C:/dev/emsdk/upstream/bin\wasm-ld.exe -o C:\Users\georg\AppData\Local\Temp\emscripten_temp_j6cgw2ha\ammo.wasm --allow-undefined --lto-O3 glue.o C:/de
v/ammo.js/builds/bullet/src/BulletCollision/Debug/libBulletCollision.a C:/dev/ammo.js/builds/bullet/src/BulletDynamics/Debug/libBulletDynamics.a C:/dev/ammo.js/builds/
bullet/src/BulletSoftBody/Debug/libBulletSoftBody.a -LC:\dev\emsdk\upstream\emscripten\system\local\lib C:/dev/ammo.js/builds/bullet/src/LinearMath/Debug/libLinearMath
.a -LC:\dev\emsdk\upstream\emscripten\system\lib -LC:\dev\emsdk\upstream\emscripten\cache\wasm-obj C:\dev\emsdk\upstream\emscripten\cache\wasm-obj\libc.a C:\dev\emsdk\
upstream\emscripten\cache\wasm-obj\libcompiler_rt.a C:\dev\emsdk\upstream\emscripten\cache\wasm-obj\libc-wasm.a C:\dev\emsdk\upstream\emscripten\cache\wasm-obj\libc++-
noexcept.a C:\dev\emsdk\upstream\emscripten\cache\wasm-obj\libc++abi-noexcept.a C:\dev\emsdk\upstream\emscripten\cache\wasm-obj\libdlmalloc.a C:\dev\emsdk\upstream\ems
cripten\cache\wasm-obj\libpthread_stub.a C:\dev\emsdk\upstream\emscripten\cache\wasm-obj\libc_rt_wasm.a --import-memory --import-table -mllvm -combiner-global-alias-an
alysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --export __wasm_call_ctors --export __data_end --export malloc --export free --export setThrew --export
 _ZSt18uncaught_exceptionv -z stack-size=5242880 --initial-memory=268435456 --no-entry --max-memory=268435456 --global-base=1024' failed (1) [C:\dev\ammo.js\builds\amm
o-javascript.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(238,5): error MSB8066: Custom build for 'C:\dev\amm
o.js\builds\CMakeFiles\f8eaa61671472485174d6f054ffab191\ammo.js.rule;C:\dev\ammo.js\builds\CMakeFiles\e6bbd10bfef2029d5b5b22613118c551\ammo-javascript.rule' exited wit
h code 1. [C:\dev\ammo.js\builds\ammo-javascript.vcxproj]
@ianpurvis
Copy link
Collaborator

Hi, I think your issue is that you are building with Visual Studio which has not been supported. Have you tried to build ammo with mingw? There is a link in the readme where you can download it-

On windows, you can build using cmake's mingw generator:

cmake -B builds -G 'MinGW Makefiles'
cmake --build builds

@regnaio
Copy link
Author

regnaio commented Jan 26, 2021

Thank you so much for your help, @ianpurvis

Building on Windows was too difficult for me, so I tried Docker image (https://hub.docker.com/r/emscripten/emsdk), which worked smoothly

I forked Ammo.js and added two lines to .idl to resolve #350

Also, I added a new Dockerfile that should easily build Ammo on any system: https://github.com/regnaio/ammo.js/blob/master/Dockerfile

FROM emscripten/emsdk

WORKDIR /src

COPY . .

RUN cmake -B builds -DCLOSURE=1 -DTOTAL_MEMORY=268435456

RUN cmake --build builds

# Build image by running: docker build -t ammo .

# Run container by running: docker run -t ammo:latest

# Retrieve build files by running: docker cp <container-id>:/src/builds <host-path>

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

No branches or pull requests

2 participants