mamedev / mame

MAME
https://www.mamedev.org/
Other
7.95k stars 1.98k forks source link

Can't compilate with Emscripten (Windows 11) #10216

Open liudonghua123 opened 2 years ago

liudonghua123 commented 2 years ago

I tried to make a web assembly build of mame, I installed and configured the latest emsdk 3.1.18. However when I tried emmake make SUBTARGET=arcade, it failed with make: *** [makefile:1266: build/projects/sdl/mamearcade/gmake-asmjs/Makefile] Error -1 error.

D:\code\webassembly\emsdk>emsdk install latest
Resolving SDK alias 'latest' to '3.1.18'
Resolving SDK version '3.1.18' to 'sdk-releases-upstream-49d45744895c7d7e28acd94a385d7ee361653b4a-64bit'
Installing SDK 'sdk-releases-upstream-49d45744895c7d7e28acd94a385d7ee361653b4a-64bit'..
Skipped installing node-14.18.2-64bit, already installed.
Skipped installing python-3.9.2-nuget-64bit, already installed.
Skipped installing java-8.152-64bit, already installed.
Skipped installing releases-upstream-49d45744895c7d7e28acd94a385d7ee361653b4a-64bit, already installed.
All SDK components already installed: 'sdk-releases-upstream-49d45744895c7d7e28acd94a385d7ee361653b4a-64bit'.

D:\code\webassembly\emsdk>emsdk activate latest
Resolving SDK alias 'latest' to '3.1.18'
Resolving SDK version '3.1.18' to 'sdk-releases-upstream-49d45744895c7d7e28acd94a385d7ee361653b4a-64bit'
Setting the following tools as active:
   node-14.18.2-64bit
   python-3.9.2-nuget-64bit
   java-8.152-64bit
   releases-upstream-49d45744895c7d7e28acd94a385d7ee361653b4a-64bit

Adding directories to PATH:
PATH += D:\code\webassembly\emsdk
PATH += D:\code\webassembly\emsdk\node\14.18.2_64bit\bin
PATH += D:\code\webassembly\emsdk\upstream\emscripten

Setting environment variables:
PATH = D:\code\webassembly\emsdk;D:\code\webassembly\emsdk\node\14.18.2_64bit\bin;D:\code\webassembly\emsdk\upstream\emscripten;C:\Users\Liu.D.H\AppData\Roaming\Composer\vendor\bin;D:\apps\Windows Resource Kits Tools\;C:\Program Files (x86)\VMware\VMware Workstation\bin\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Users\Liu.D.H\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files (x86)\NetSarang\Xshell 7\;C:\Program Files (x86)\NetSarang\Xftp 7\;C:\ProgramData\chocolatey\bin;C:\Users\Liu.D.H\.wasmer\bin;C:\Users\Liu.D.H\.wasmer\globals\wapm_packages\.bin;C:\Program Files\mvndaemon\mvnd-0.7.1-windows-amd64\bin;C:\msys64\usr\bin;C:\Program Files\MiKTeX\miktex\bin\x64\;D:\apps\微信web开发者工具\dll.disable;C:\Program Files\Git LFS;C:\ProgramData\chocolatey\lib\mpv.install\tools;C:\Program Files\Memurai\;D:\apps\go\bin;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Wasmtime\bin;C:\Users\Liu.D.H\AppData\Local\Programs\Python\Launcher\;C:\Users\Liu.D.H\.poetry\bin;C:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\;C:\Users\Liu.D.H\AppData\Local\Programs\Python\Python38\Scripts\;C:\Users\Liu.D.H\AppData\Local\Programs\Python\Python38\;C:\Users\Liu.D.H\scoop\shims;C:\Users\Liu.D.H/.local/bin;C:\Users\Liu.D.H\AppData\Roaming\npm;C:\Users\Liu.D.H\.cargo\bin;C:\Users\Liu.D.H\AppData\Local\Microsoft\WindowsApps;D:\apps\qt\5.15.2\msvc2019_64\bin;C:\Users\Liu.D.H\anaconda3;C:\Users\Liu.D.H\anaconda3\Library\mingw-w64\bin;C:\Users\Liu.D.H\anaconda3\Library\usr\bin;C:\Users\Liu.D.H\anaconda3\Library\bin;C:\Users\Liu.D.H\anaconda3\Scripts;C:\Users\Liu.D.H\.dotnet\tools;C:\Users\Liu.D.H\AppData\Local\Programs\Microsoft VS Code\bin;D:\android\android_sdk\tools;D:\android\android_sdk\tools\bin;D:\android\android_sdk\platform-tools;D:\android\android_sdk\cmdline-tools\latest\bin;D:\android\android_sdk\build-tools\29.0.3;D:\android\android_sdk\ndk-bundle;C:\Program Files\Java\jdk-17\bin;D:\apps\flutter\bin;D:\apps\flutter\bin\cache\dart-sdk\bin;D:\apps\apache-maven-3.8.4\bin;D:\apps\ffmpeg-5.0-full_build\bin;D:\apps\ImageMagick-7.1.0-portable-Q16-HDRI-x64;D:\apps;D:\apps\bin;C:\Program Files\Sublime Text;C:\Program Files\JetBrains\DataGrip 2021.3.1\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\CMake\bin;D:\apps\graphicsmagick-1.3.36-q16;D:\apps\WasmEdge-0.9.1-windows\bin;C:\tools\msys64;C:\Users\Liu.D.H\AppData\Local\Pub\Cache\bin;C:\Program Files\JetBrains\IntelliJ IDEA 2021.3.1\bin;D:\apps\binaryen-version_105-x86_64-windows\bin;D:\apps\oracle\instantclient_19_14;D:\apps\SysinternalsSuite;C:\Users\Liu.D.H\go\bin;D:\apps\vcpkg;D:\apps\graphviz\bin;C:\Users\Liu.D.H\.deno\bin;D:\game\qqgame\Hall.57773\;D:\apps\LLVM\bin;D:\apps\NSIS;C:\Users\Liu.D.H\AppData\Local\Programs\oh-my-posh\bin;
EMSDK = D:/code/webassembly/emsdk
EM_CONFIG = D:\code\webassembly\emsdk\.emscripten
EMSDK_NODE = D:\code\webassembly\emsdk\node\14.18.2_64bit\bin\node.exe
EMSDK_PYTHON = D:\code\webassembly\emsdk\python\3.9.2-nuget_64bit\python.exe
JAVA_HOME = D:\code\webassembly\emsdk\java\8.152_64bit
Clearing existing environment variable: EMSDK_PY
The changes made to environment variables only apply to the currently running shell instance. Use the 'emsdk_env.bat' to re-enter this environment later, or if you'd like to register this environment permanently, rerun this command with the option --permanent.

D:\code\webassembly\emsdk>D:\code\other\mame_binaries\mame\

D:\code\other\mame_binaries\mame>git status
HEAD detached at mame0246
nothing to commit, working tree clean

D:\code\other\mame_binaries\mame>
D:\code\other\mame_binaries\mame>emmake make SUBTARGET=arcade
make: make SUBTARGET=arcade
GCC  detected
1534 source file(s) found
Clang version 6.0 or later needed
make: *** [makefile:1266: build/projects/sdl/mamearcade/gmake-asmjs/Makefile] Error -1
emmake: error: 'make SUBTARGET=arcade' failed (returned 2)

D:\code\other\mame_binaries\mame>
D:\code\other\mame_binaries\mame>set VERBOSE=1

D:\code\other\mame_binaries\mame>emmake make SUBTARGET=arcade
make: make SUBTARGET=arcade
GCC  detected
3rdparty/genie/bin/windows/genie.exe --distro=generic --OPTIMIZE=3 --target='mame' --subtarget='arcade' --build-dir='build' --PYTHON_EXECUTABLE='python' --NOASM='1' --osd='sdl' --targetos='asmjs' --PLATFORM='x86' --gcc=asmjs --gcc_version= gmake
1534 source file(s) found
Clang version 6.0 or later needed
make: *** [makefile:1266: build/projects/sdl/mamearcade/gmake-asmjs/Makefile] Error -1
emmake: error: 'make SUBTARGET=arcade' failed (returned 2)

D:\code\other\mame_binaries\mame>
DopefishJustin commented 2 years ago

Building with Emscripten under a Windows environment is not currently supported - it should work in Linux.

liudonghua123 commented 2 years ago

thanks, i see. However, what's stop webassemily currently on windows?

milliluk commented 1 year ago

Clang version 6.0 or later needed

What version of Clang are you running?

liudonghua123 commented 1 year ago

Clang version 6.0 or later needed

What version of Clang are you running?

The version of clang of emsdk is 16.0.0.

D:\code\webassembly\emsdk>"D:\code\webassembly\emsdk\upstream\bin\clang.exe" --version
clang version 16.0.0 (https://github.com/llvm/llvm-project 48129cf0ed5053ed3fdf4f928180635e84892614)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: D:\code\webassembly\emsdk\upstream\bin

D:\code\webassembly\emsdk>"D:\code\webassembly\emsdk\upstream\bin\clang++.exe" --version
clang version 16.0.0 (https://github.com/llvm/llvm-project 48129cf0ed5053ed3fdf4f928180635e84892614)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: D:\code\webassembly\emsdk\upstream\bin

D:\code\webassembly\emsdk>