Building Ogre 1.11 with Emscripten Topic is solved

Problems building or running the engine, queries about how to use features etc.
Post Reply
ProfessorJ
Gnoblar
Posts: 16
Joined: Tue Aug 14, 2007 6:49 am
Location: Australia

Building Ogre 1.11 with Emscripten

Post by ProfessorJ »

Ogre Version: :1.11.2:

Hi, I am having problems building the latest Ogre with Emscripten.

I have had a problem building until I removed a line in OgreMain/CMakeLists.txt

Code: Select all

include_directories("${ZLIB_INCLUDE_DIRS}" "${ZZip_INCLUDE_DIRS}")
and now cmake is generating build files.

Code: Select all

> cmake -DCMAKE_TOOLCHAIN_FILE=/.../emsdk/emscripten/1.37.36/cmake/Modules/Platform/Emscripten.cmake .
-- Configuring OGRE 1.11.2
-- Search path: /.../ogre-1.11.2/Dependencies;/.../ogre-1.11.2/Dependencies;/.../ogre-1.11.2/../Dependencies;/.../ogre-1.11.2/../Dependencies
-- Looking for ZZip...
-- Checking for module 'zziplib'
--   No package 'zziplib' found
-- Could not locate ZZip
-- Looking for FreeImage...
-- Checking for module 'freeimage'
--   No package 'freeimage' found
-- Could not locate FreeImage
-- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) 
-- Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR) 
-- Looking for Softimage...
-- Could not locate Softimage
-- Looking for GLSL_Optimizer...
-- Checking for module 'GLSL_Optimizer'
--   No package 'GLSL_Optimizer' found
-- Could not locate GLSL_Optimizer
-- Looking for HLSL2GLSL...
-- Checking for module 'HLSL2GLSL'
--   No package 'HLSL2GLSL' found
-- Could not locate HLSL2GLSL
-- 
-----------------------------------------------------------------------------
-- The following external packages were located on your system.
-- This installation will have the extra features provided by these packages.
+ zlib
+ freetype
+ OpenGL ES 2.x
+ Doxygen
-----------------------------------------------------------------------------
-- The following OPTIONAL packages could NOT be located on your system.
-- Consider installing them to enable more features from this software.
+ zziplib: Extract data from zip archives <http://zziplib.sourceforge.net>
+ freeimage: Support for commonly used graphics image formats <http://freeimage.sourceforge.net>
+ OpenEXR: Load High dynamic range images <http://www.openexr.com/>
+ Python: Language bindings to use OGRE from Python <http://www.python.org/>
+ SDL2: Simple DirectMedia Library needed for input handling in samples <https://www.libsdl.org/>
+ Softimage: Softimage SDK needed for building XSIExporter <FALSE>
+ GLSL Optimizer: GLSL Optimizer <http://github.com/aras-p/glsl-optimizer/>
+ HLSL2GLSL: HLSL2GLSL <http://hlsl2glslfork.googlecode.com/>
-----------------------------------------------------------------------------

-- 
----------------------------------------------------------------------------
  FEATURE SUMMARY
----------------------------------------------------------------------------

Building components:
  + Bites
  + HLMS [BETA]
  + MeshLodGenerator
  + Overlay
  + Property
  + RTShader System
  + RTShader System Core Shaders
  + RTShader System Extensions Shaders
Building plugins:
  + Octree scene manager
  + STBI codec (generic)
  + Particle FX
Building rendersystems:
  + OpenGL ES2/ ES3
Building executables:
  + Samples
Building core features:
  + Mesh Lod
  + DDS image codec (.dds)
  + PVRTC image codec (.pvr)
  + ETC image codec (.pkm, .ktx) 

Build type:                      static
Thread safety:                   none
ResourceManager behaviour:       strict
Use double precision:            disabled
Nodes inherit transform:         disabled
Assert mode:                     release exceptions

----------------------------------------------------------------------------

-- Configuring done
-- Generating done
-- Build files have been written to: /home/jmaloney/Documents/dev/ogre-1.11.2

Making the project gives bin/EmscriptenSample.html which runs but throws an exception

Code: Select all

TypeError: asm.js type error: Disabled by debugger EmscriptenSample.js
Creating resource group General EmscriptenSample.html:1237:13
Creating resource group OgreInternal EmscriptenSample.html:1237:13
Creating resource group OgreAutodetect EmscriptenSample.html:1237:13
SceneManagerFactory for type 'DefaultSceneManager' registered. EmscriptenSample.html:1237:13
Registering ResourceManager for type Material EmscriptenSample.html:1237:13
Registering ResourceManager for type Mesh EmscriptenSample.html:1237:13
Registering ResourceManager for type Skeleton EmscriptenSample.html:1237:13
MovableObjectFactory for type 'ParticleSystem' registered. EmscriptenSample.html:1237:13
ArchiveFactory for archive type FileSystem registered. EmscriptenSample.html:1237:13
DDS codec registering EmscriptenSample.html:1237:13
PVRTC codec registering EmscriptenSample.html:1237:13
ETC codec registering EmscriptenSample.html:1237:13
Registering ResourceManager for type HighLevelGpuProgram EmscriptenSample.html:1237:13
Registering ResourceManager for type Compositor EmscriptenSample.html:1237:13
MovableObjectFactory for type 'Entity' registered. EmscriptenSample.html:1237:13
MovableObjectFactory for type 'Light' registered. EmscriptenSample.html:1237:13
MovableObjectFactory for type 'BillboardSet' registered. EmscriptenSample.html:1237:13
MovableObjectFactory for type 'ManualObject' registered. EmscriptenSample.html:1237:13
MovableObjectFactory for type 'BillboardChain' registered. EmscriptenSample.html:1237:13
MovableObjectFactory for type 'RibbonTrail' registered. EmscriptenSample.html:1237:13
*-*-* OGRE Initialising EmscriptenSample.html:1237:13
*-*-* Version 1.11.2 (Rhagorthua) EmscriptenSample.html:1237:13
Installing plugin: OpenGL ES 2.0 RenderSystem EmscriptenSample.html:1237:13
OpenGL ES 2.x Rendering Subsystem created. EmscriptenSample.html:1237:13
Plugin successfully installed EmscriptenSample.html:1237:13
Installing plugin: Octree Scene Manager EmscriptenSample.html:1237:13
Plugin successfully installed EmscriptenSample.html:1237:13
Installing plugin: ParticleFX EmscriptenSample.html:1237:13
Particle Emitter Type 'Point' registered EmscriptenSample.html:1237:13
Particle Emitter Type 'Box' registered EmscriptenSample.html:1237:13
Particle Emitter Type 'Ellipsoid' registered EmscriptenSample.html:1237:13
Particle Emitter Type 'Cylinder' registered EmscriptenSample.html:1237:13
Particle Emitter Type 'Ring' registered EmscriptenSample.html:1237:13
Particle Emitter Type 'HollowEllipsoid' registered EmscriptenSample.html:1237:13
Particle Affector Type 'LinearForce' registered EmscriptenSample.html:1237:13
Particle Affector Type 'ColourFader' registered EmscriptenSample.html:1237:13
Particle Affector Type 'ColourFader2' registered EmscriptenSample.html:1237:13
Particle Affector Type 'ColourImage' registered EmscriptenSample.html:1237:13
Particle Affector Type 'ColourInterpolator' registered EmscriptenSample.html:1237:13
Particle Affector Type 'Scaler' registered EmscriptenSample.html:1237:13
Particle Affector Type 'Rotator' registered EmscriptenSample.html:1237:13
Particle Affector Type 'DirectionRandomiser' registered EmscriptenSample.html:1237:13
Particle Affector Type 'DeflectorPlane' registered EmscriptenSample.html:1237:13
Plugin successfully installed EmscriptenSample.html:1237:13
Installing plugin: STB Image Codec EmscriptenSample.html:1237:13
stb_image - v2.19 - public domain JPEG/PNG reader EmscriptenSample.html:1237:13
Supported formats: jpeg,jpg,png,bmp,psd,tga,gif,pic,ppm,pgm,hdr EmscriptenSample.html:1237:13
Plugin successfully installed EmscriptenSample.html:1237:13
OverlayElementFactory for type Panel registered. EmscriptenSample.html:1237:13
OverlayElementFactory for type BorderPanel registered. EmscriptenSample.html:1237:13
OverlayElementFactory for type TextArea registered. EmscriptenSample.html:1237:13
Registering ResourceManager for type Font EmscriptenSample.html:1237:13
CPU Identifier & Features EmscriptenSample.html:1237:13
------------------------- EmscriptenSample.html:1237:13
 *   CPU ID: Unknown EmscriptenSample.html:1237:13
------------------------- EmscriptenSample.html:1237:13
****************************** EmscriptenSample.html:1237:13
*** Starting EGL Subsystem *** EmscriptenSample.html:1237:13
****************************** EmscriptenSample.html:1237:13
EGL_VERSION = 1.4 Emscripten EGL EmscriptenSample.html:1237:13
EGL_EXTENSIONS = EmscriptenSample.html:1237:13
Registering ResourceManager for type Texture EmscriptenSample.html:1237:13
GLES2RenderSystem::_createRenderWindow "OGRE Emscripten Sample", 800x600 windowed  miscParams: FSAA= currentGLContext=true gamma=No vsync=Yes EmscriptenSample.html:1237:13
bad name in getProcAddress: glActiveShaderProgramEXT,glActiveShaderProgram EmscriptenSample.html:1249:13
...
bad name in getProcAddress: glWeightPathsNV,glWeightPathsNV EmscriptenSample.html:1249:13
GL_VERSION = 2.0.0.0 EmscriptenSample.html:1237:13
GL_VENDOR = Mozilla EmscriptenSample.html:1237:13
GL_RENDERER = Mozilla EmscriptenSample.html:1237:13
GL_EXTENSIONS = GL_ANGLE_instanced_arrays GL_EXT_blend_minmax GL_EXT_color_buffer_half_float GL_EXT_frag_depth GL_EXT_sRGB GL_EXT_shader_texture_lod GL_EXT_texture_filter_anisotropic GL_OES_element_index_uint GL_OES_standard_derivatives GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_vertex_array_object WEBGL_color_buffer_float WEBGL_compressed_texture_etc WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_depth_texture WEBGL_draw_buffers WEBGL_lose_context EmscriptenSample.html:1237:13
************************************** EmscriptenSample.html:1237:13
*** OpenGL ES 2.x Renderer Started *** EmscriptenSample.html:1237:13
************************************** EmscriptenSample.html:1237:13
Shading language version: OpenGL ES GLSL ES 1.00 (WebGL GLSL ES 1.0) EmscriptenSample.html:1237:13
Registering ResourceManager for type GpuProgram EmscriptenSample.html:1237:13
GL ES 2: Using FBOs for rendering to textures EmscriptenSample.html:1237:13
[GLES2] : detectFBOFormats is disabled on this platform (due performance reasons) EmscriptenSample.html:1237:13
[GLES2] : Valid FBO targets PF_A8B8G8R8 EmscriptenSample.html:1237:13
RenderSystem capabilities EmscriptenSample.html:1237:13
------------------------- EmscriptenSample.html:1237:13
RenderSystem Name: OpenGL ES 2.x Rendering Subsystem EmscriptenSample.html:1237:13
GPU Vendor: mozilla EmscriptenSample.html:1237:13
Device Name: Mozilla EmscriptenSample.html:1237:13
Driver Version: 2.0.0.0 EmscriptenSample.html:1237:13
 * Fixed function pipeline: no EmscriptenSample.html:1237:13
 * Anisotropic texture filtering: yes EmscriptenSample.html:1237:13
 * Cube mapping: yes EmscriptenSample.html:1237:13
 * Hardware stencil buffer: yes EmscriptenSample.html:1237:13
   - Stencil depth: 8 EmscriptenSample.html:1237:13
   - Two sided stencil support: yes EmscriptenSample.html:1237:13
   - Wrap stencil values: yes EmscriptenSample.html:1237:13
 * 32-bit index buffers: yes EmscriptenSample.html:1237:13
 * Vertex programs: yes EmscriptenSample.html:1237:13
 * Number of floating-point constants for vertex programs: 1024 EmscriptenSample.html:1237:13
 * Number of integer constants for vertex programs: 1024 EmscriptenSample.html:1237:13
 * Number of boolean constants for vertex programs: 1024 EmscriptenSample.html:1237:13
 * Fragment programs: yes EmscriptenSample.html:1237:13
 * Number of floating-point constants for fragment programs: 1024 EmscriptenSample.html:1237:13
 * Number of integer constants for fragment programs: 1024 EmscriptenSample.html:1237:13
 * Number of boolean constants for fragment programs: 1024 EmscriptenSample.html:1237:13
 * Geometry programs: no EmscriptenSample.html:1237:13
 * Number of floating-point constants for geometry programs: 29301 EmscriptenSample.html:1237:13
 * Number of integer constants for geometry programs: 24421 EmscriptenSample.html:1237:13
 * Number of boolean constants for geometry programs: 27750 EmscriptenSample.html:1237:13
 * Tessellation Hull programs: no EmscriptenSample.html:1237:13
 * Number of floating-point constants for tessellation hull programs: 21317 EmscriptenSample.html:1237:13
 * Number of integer constants for tessellation hull programs: 29791 EmscriptenSample.html:1237:13
 * Number of boolean constants for tessellation hull programs: 30821 EmscriptenSample.html:1237:13
 * Tessellation Domain programs: no EmscriptenSample.html:1237:13
 * Number of floating-point constants for tessellation domain programs: 30068 EmscriptenSample.html:1237:13
 * Number of integer constants for tessellation domain programs: 25970 EmscriptenSample.html:1237:13
 * Number of boolean constants for tessellation domain programs: 26719 EmscriptenSample.html:1237:13
 * Compute programs: no EmscriptenSample.html:1237:13
 * Number of floating-point constants for compute programs: 27745 EmscriptenSample.html:1237:13
 * Number of integer constants for compute programs: 24422 EmscriptenSample.html:1237:13
 * Number of boolean constants for compute programs: 27750 EmscriptenSample.html:1237:13
 * Supported Shader Profiles: glsles EmscriptenSample.html:1237:13
 * Texture Compression: yes EmscriptenSample.html:1237:13
   - DXT: yes EmscriptenSample.html:1237:13
   - VTC: no EmscriptenSample.html:1237:13
   - PVRTC: no EmscriptenSample.html:1237:13
   - ATC: no EmscriptenSample.html:1237:13
   - ETC1: no EmscriptenSample.html:1237:13
   - ETC2: no EmscriptenSample.html:1237:13
   - BC4/BC5: no EmscriptenSample.html:1237:13
   - BC6H/BC7: no EmscriptenSample.html:1237:13
   - ASTC: no EmscriptenSample.html:1237:13
   - Mipmaps for compressed formats: no EmscriptenSample.html:1237:13
 * Hardware Occlusion Query: no EmscriptenSample.html:1237:13
 * User clip planes: no EmscriptenSample.html:1237:13
 * VET_UBYTE4 vertex element type: yes EmscriptenSample.html:1237:13
 * Infinite far plane projection: yes EmscriptenSample.html:1237:13
 * Hardware render-to-texture: yes EmscriptenSample.html:1237:13
 * Floating point textures: yes EmscriptenSample.html:1237:13
 * Non-power-of-two textures: no EmscriptenSample.html:1237:13
 * 1d textures: no EmscriptenSample.html:1237:13
 * Volume textures: no EmscriptenSample.html:1237:13
 * Multiple Render Targets: 1 EmscriptenSample.html:1237:13
   - With different bit depths: no EmscriptenSample.html:1237:13
 * Point Sprites: yes EmscriptenSample.html:1237:13
 * Wide Lines: yes EmscriptenSample.html:1237:13
 * Hardware Gamma: no EmscriptenSample.html:1237:13
 * Extended point parameters: yes EmscriptenSample.html:1237:13
 * Max Point Size: 0 EmscriptenSample.html:1237:13
 * Vertex texture fetch: no EmscriptenSample.html:1237:13
 * Number of texture units: 16 EmscriptenSample.html:1237:13
 * Number of vertex attributes: 16 EmscriptenSample.html:1237:13
 * Stencil buffer depth: 8 EmscriptenSample.html:1237:13
 * Number of vertex blend matrices: 0 EmscriptenSample.html:1237:13
 * Render to Vertex Buffer : no EmscriptenSample.html:1237:13
 * Hardware Atomic Counters: no EmscriptenSample.html:1237:13
 * PBuffer support: no EmscriptenSample.html:1237:13
 * Vertex Array Objects: yes EmscriptenSample.html:1237:13
 * Separate shader objects: no EmscriptenSample.html:1237:13
 * GLSL SSO redeclare interface block: no EmscriptenSample.html:1237:13
 * Debugging/ profiling events: no EmscriptenSample.html:1237:13
 * Map buffer storage: no EmscriptenSample.html:1237:13
DefaultWorkQueue('Root') initialising on thread main. EmscriptenSample.html:1237:13
Particle Renderer Type 'billboard' registered EmscriptenSample.html:1237:13
SceneManagerFactory for type 'OctreeSceneManager' registered. EmscriptenSample.html:1237:13
exception thrown: 8106144 - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch. EmscriptenSample.html:1249:13
printErr
EmscriptenSample.js:643185:7
uncaught exception: 8106144 - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.

paroj
OGRE Team Member
OGRE Team Member
Posts: 1995
Joined: Sun Mar 30, 2014 2:51 pm
x 1075
Contact:

Re: Building Ogre 1.11 with Emscripten

Post by paroj »

you arrived at the segfault because you removed that line. Try using the master branch, the zlib problem should be fixed there.
ProfessorJ
Gnoblar
Posts: 16
Joined: Tue Aug 14, 2007 6:49 am
Location: Australia

Re: Building Ogre 1.11 with Emscripten

Post by ProfessorJ »

Ok, it works.
ProfessorJ
Gnoblar
Posts: 16
Joined: Tue Aug 14, 2007 6:49 am
Location: Australia

Re: Building Ogre 1.11 with Emscripten

Post by ProfessorJ »

I can build the source sample but now I'm trying to link Ogre from another project folder.

I'm getting unresolved symbols for zlib and zzip.

Code: Select all

warning: unresolved symbol: inflate
warning: unresolved symbol: inflateEnd
warning: unresolved symbol: inflateInit_
warning: unresolved symbol: inflateReset
warning: unresolved symbol: zzip_dir_close
warning: unresolved symbol: zzip_dir_open_ext_io
warning: unresolved symbol: zzip_dir_read
warning: unresolved symbol: zzip_dir_stat
warning: unresolved symbol: zzip_dirhandle
warning: unresolved symbol: zzip_error
warning: unresolved symbol: zzip_file_close
warning: unresolved symbol: zzip_file_open
warning: unresolved symbol: zzip_file_read
warning: unresolved symbol: zzip_seek
warning: unresolved symbol: zzip_strerror_of
warning: unresolved symbol: zzip_tell
If I add the build flag -s USE_ZLIB=1

Code: Select all

warning: unresolved symbol: zzip_dir_close
warning: unresolved symbol: zzip_dir_open_ext_io
warning: unresolved symbol: zzip_dir_read
warning: unresolved symbol: zzip_dir_stat
warning: unresolved symbol: zzip_dirhandle
warning: unresolved symbol: zzip_error
warning: unresolved symbol: zzip_file_close
warning: unresolved symbol: zzip_file_open
warning: unresolved symbol: zzip_file_read
warning: unresolved symbol: zzip_seek
warning: unresolved symbol: zzip_strerror_of
warning: unresolved symbol: zzip_tell
Not sure whether to use the build flag because zlib is in the dependenceis folder. I can see that it's being developed on the main branch so I'll keep using trial and error.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1995
Joined: Sun Mar 30, 2014 2:51 pm
x 1075
Contact:

Re: Building Ogre 1.11 with Emscripten

Post by paroj »

on emscripten ogre is linked statically - this means you must link your project against all ogredeps. (zzip, freetype, libz)
Post Reply