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

Docker + ubuntu image 编译 emsdk 失败,提示 No CMAKE_CXX_COMPILER could be found #3

Open
undirectlookable opened this issue Jun 22, 2017 · 0 comments

Comments

@undirectlookable
Copy link

镜像 ubuntu:latest

环境准备, 参考

$ apt update
$ apt install git cmake gcc python

编译

$ git clone https://github.com/juj/emsdk.git
$ cd emsdk
$ ./emsdk install sdk-incoming-64bit binaryen-master-64bit

报错

CMake Error at CMakeLists.txt:47 (project):   No CMAKE_CXX_COMPILER could be found.    Tell CMake where to find the compiler by setting either the environment   variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path   to the compiler, or to the compiler name if it is in the PATH.   -- Configuring incomplete, errors occurred! See also "/root/emsdk/clang/fastcomp/build_incoming_64/CMakeFiles/CMakeOutput.log". See also "/root/emsdk/clang/fastcomp/build_incoming_64/CMakeFiles/CMakeError.log". CMake invocation failed due to exception! Working directory: /root/emsdk/clang/fastcomp/build_incoming_64 Command '['cmake', '-G', 'Unix Makefiles', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DPYTHON_EXECUTABLE=/usr/bin/python', '-DLLVM_TARGETS_TO_BUILD=X86;JSBackend', '-DLLVM_INCLUDE_EXAMPLES=OFF', '-DCLANG_INCLUDE_EXAMPLES=OFF', '-DLLVM_INCLUDE_TESTS=OFF', '-DCLANG_INCLUDE_TESTS=OFF', '-DLLVM_ENABLE_ASSERTIONS=ON', '/root/emsdk/clang/fastcomp/src']' returned non-zero exit status 1 Installation failed!

解决

官方的入门指南里只提到gcc,但实际也依赖 g++。一步到位可以安装 build-essential,想要精简可以只安装 cmake gccg++

所以,安装 g++ 后重新编译

$ apt install g++

解决。

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

1 participant