emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.65k stars 3.29k forks source link

can not compile OpenMesh #271

Closed bompo closed 12 years ago

bompo commented 12 years ago

Compiling of OpenMesh (http://www.openmesh.org/) fails.

I added the following lines to the cmake.txt:

SET(CMAKE_C_COMPILER          "/home/stefanw/emscripten/emcc")
SET(CMAKE_CXX_COMPILER        "/home/stefanw/emscripten/emcc")

after that I called "cmake .. && make"

stefanw@ubuntu:~/Downloads/OpenMesh-2.1/build$ make
Scanning dependencies of target OpenMeshCore
[  1%] Building CXX object src/OpenMesh/Core/CMakeFiles/OpenMeshCore.dir/Geometry/NormalConeT.cc.o
[  2%] Building CXX object src/OpenMesh/Core/CMakeFiles/OpenMeshCore.dir/IO/BinaryHelper.cc.o
[  3%] Building CXX object src/OpenMesh/Core/CMakeFiles/OpenMeshCore.dir/IO/OMFormat.cc.o
In file included from /home/stefanw/Downloads/OpenMesh-2.1/src/OpenMesh/Core/IO/OMFormat.cc:51:
In file included from /home/stefanw/Downloads/OpenMesh-2.1/src/OpenMesh/Core/../../OpenMesh/Core/IO/OMFormat.hh:51:
In file included from /home/stefanw/Downloads/OpenMesh-2.1/src/OpenMesh/Core/../../OpenMesh/Core/IO/SR_store.hh:57:
/home/stefanw/Downloads/OpenMesh-2.1/src/OpenMesh/Core/../../OpenMesh/Core/IO/SR_rbo.hh:92:3: error: 
      implicit instantiation of undefined template 'OpenMesh::GenProg::AssertCompile<false>'
  assert_compile(false);
  ^
/home/stefanw/Downloads/OpenMesh-2.1/src/OpenMesh/Core/../../OpenMesh/Core/Utils/GenProg.hh:154:45: note: expanded from:
#define assert_compile(EXPR)                GenProg::AssertCompile<(EXPR)>();
                                            ^
/home/stefanw/Downloads/OpenMesh-2.1/src/OpenMesh/Core/../../OpenMesh/Core/Utils/GenProg.hh:82:29: note: 
      template is declared here
template <bool Expr> struct AssertCompile;
                            ^
In file included from /home/stefanw/Downloads/OpenMesh-2.1/src/OpenMesh/Core/IO/OMFormat.cc:51:
In file included from /home/stefanw/Downloads/OpenMesh-2.1/src/OpenMesh/Core/../../OpenMesh/Core/IO/OMFormat.hh:51:
In file included from /home/stefanw/Downloads/OpenMesh-2.1/src/OpenMesh/Core/../../OpenMesh/Core/IO/SR_store.hh:57:
/home/stefanw/Downloads/OpenMesh-2.1/src/OpenMesh/Core/../../OpenMesh/Core/IO/SR_rbo.hh:90:37: warning: 
      unused parameter '_val' [-Wunused-parameter]
void _reverse_byte_order_N(uint8_t* _val)
                                    ^
/home/stefanw/Downloads/OpenMesh-2.1/src/OpenMesh/Core/../../OpenMesh/Core/IO/SR_rbo.hh:159:3: error: 
      implicit instantiation of undefined template 'OpenMesh::GenProg::AssertCompile<false>'
  assert_compile(false);
  ^
/home/stefanw/Downloads/OpenMesh-2.1/src/OpenMesh/Core/../../OpenMesh/Core/Utils/GenProg.hh:154:45: note: expanded from:
#define assert_compile(EXPR)                GenProg::AssertCompile<(EXPR)>();
                                            ^
/home/stefanw/Downloads/OpenMesh-2.1/src/OpenMesh/Core/../../OpenMesh/Core/Utils/GenProg.hh:82:29: note: 
      template is declared here
template <bool Expr> struct AssertCompile;
                            ^
1 warning and 2 errors generated.
emcc: compiler frontend failed to generate LLVM bitcode, halting
make[2]: *** [src/OpenMesh/Core/CMakeFiles/OpenMeshCore.dir/IO/OMFormat.cc.o] Error 1
make[1]: *** [src/OpenMesh/Core/CMakeFiles/OpenMeshCore.dir/all] Error 2
make: *** [all] Error 2

Did I something wrong or isn't it possible to compile OpenMesh with emscripten? :/ Simple helloworld examples compile fine with emscripten and OpenMesh compiles fine with normal gcc but not with emscripten.

crazyjul commented 12 years ago

It seems to be more a clang issue than a emscripten one. Try to compile using clang directly and see if it works

bompo commented 12 years ago

Yeah it's a clang issue. Compiling with clang fails with the same error. Thanks