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

Compiling instructions #1

Open
tokejepsen opened this issue Feb 1, 2021 · 42 comments
Open

Compiling instructions #1

tokejepsen opened this issue Feb 1, 2021 · 42 comments

Comments

@tokejepsen
Copy link

tokejepsen commented Feb 1, 2021

Would be great to have stepped instructions on how to compile this project.

I'll be trying to compile this myself (although I've never compiled a c++ project before), so will document my process as I go along.

Further down the line it would be great to have CI generated releases for supported platforms.

@ihubgit
Copy link

ihubgit commented Feb 2, 2021

second that. I'm on Mac OS and have no idea to make this work. Please provide instructions.

@tokejepsen
Copy link
Author

I tried giving this a go but get stuck on building the executable (on Windows). These are my steps so far;

  1. Clone/Download repository from https://github.com/google/monster-mash.git
  2. Download zip from http://www.netlib.org/voronoi/triangle.zip and place in “third_party/triangle”.
  3. Install build tools from https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019
  4. Install Cmake from https://cmake.org/runningcmake/
  5. Run Cmake-gui pointing to “src” folder.
  6. Cmake-gui asks for SDL2_DIR
  7. Download Simple DirectMedia Layer from https://www.libsdl.org/download-2.0.php and point Cmake-gui “SDL2_DIR” variable to the extracted folder.
  8. Cmake-gui > Configure > Generate. This generates “monstermash.sln” file in the build folder.
  9. In the “Developer Command Prompt for VS 2019” > change directory to build folder > “msbuild monstermash.sln”.

Which produces this error:

C:\Users\tokejepsen\monster-mash\build>msbuild monstermash.sln
Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Build started 03/02/2021 22:27:11.
Project "C:\Users\tokejepsen\monster-mash\build\monstermash.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|x64".
ValidateProjects:
  The project "ALL_BUILD" is not selected for building in solution configuration "Debug|x64".
Project "C:\Users\tokejepsen\monster-mash\build\monstermash.sln" (1) is building "C:\Users\tokejepsen\m
onster-mash\build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
InitializeBuildStatus:
  Creating "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specifie
  d.
CustomBuild:
  Checking Build System
FinalizeBuildStatus:
  Deleting file "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
  Touching "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Done Building Project "C:\Users\tokejepsen\monster-mash\build\ZERO_CHECK.vcxproj" (default targets).

Project "C:\Users\tokejepsen\monster-mash\build\monstermash.sln" (1) is building "C:\Users\tokejepsen\m
onster-mash\build\monstermash.vcxproj.metaproj" (3) on node 1 (default targets).
Project "C:\Users\tokejepsen\monster-mash\build\monstermash.vcxproj.metaproj" (3) is building "C:\Users
\tokejepsen\monster-mash\build\monstermash.vcxproj" (4) on node 1 (default targets).
InitializeBuildStatus:
  Touching "monstermash.dir\Debug\monstermash.tlog\unsuccessfulbuild".
CustomBuild:
  Building Custom Rule C:/Users/tokejepsen/monster-mash/src/CMakeLists.txt
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX64\
  x64\CL.exe /c /I"C:\Users\tokejepsen\monster-mash\src\..\third_party" /I"C:\Users\tokejepsen\monster-
  mash\src\..\third_party\eigen3-mod" /I"C:\Users\tokejepsen\monster-mash\src\..\third_party\eigen3" /I
  "C:\Users\tokejepsen\monster-mash\src\..\third_party\libigl\include" /I"C:\Users\tokejepsen\monster-m
  ash\src\..\third_party\stb" /I"C:\Users\tokejepsen\monster-mash\src\..\third_party\triangle" /I"C:\Us
  ers\tokejepsen\monster-mash\src\..\third_party\zip-mod" /I"C:\Users\tokejepsen\monster-mash\src\..\th
  ird_party\SDL2_gfx" /I"C:\Users\tokejepsen\monster-mash\src\..\third_party\SDL2_gfx-mod" /I"C:\Users\
  tokejepsen\Desktop\SDL2-2.0.14-win32-x64\include" /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D WIN32
  /D _WINDOWS /D ENABLE_DEBUG_CMD_MM /D IMAGE_READ_WRITE /D IMAGE_MINIZ_EXTERNAL /D IMAGE_SCALE /D TRIL
  IBRARY /D NO_TIMER /D IGL_PARALLEL_FOR_FORCE_SERIAL /D EIGEN_MPL2_ONLY /D EIGEN_SPARSESOLVERBASE_H /D
   _SDL2_gfxPrimitives_h /D APP_VERSION= /D USE_SDL_GLES2 /D USE_OPENGL_FOR_DRAWING_INSTEAD_OF_SDL /D "
  CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:i
  nline /GR /std:c++17 /Fo"monstermash.dir\Debug\\" /Fd"monstermash.dir\Debug\vc142.pdb" /Gd /TP /error
  Report:queue  -Wno-sign-compare -Werror=return-type -Wno-narrowing "C:\Users\tokejepsen\monster-mash\
  src\main.cpp" "C:\Users\tokejepsen\monster-mash\src\defengarapl.cpp" "C:\Users\tokejepsen\monster-mas
  h\src\cpanim.cpp" "C:\Users\tokejepsen\monster-mash\src\loadsave.cpp" "C:\Users\tokejepsen\monster-ma
  sh\src\reconstruction.cpp" "C:\Users\tokejepsen\monster-mash\src\mainwindow.cpp" "C:\Users\tokejepsen
  \monster-mash\src\mypainter.cpp" "C:\Users\tokejepsen\monster-mash\src\mywindow.cpp" "C:\Users\tokeje
  psen\monster-mash\src\def3dsdl.cpp" "C:\Users\tokejepsen\monster-mash\third_party\ir3d-utils\regionTo
  Mesh.cpp" "C:\Users\tokejepsen\monster-mash\third_party\ir3d-utils\MeshBuilder.cpp" "C:\Users\tokejep
  sen\monster-mash\third_party\image\imageReadWrite.cpp" "C:\Users\tokejepsen\monster-mash\third_party\
  image\imageScale.cpp" "C:\Users\tokejepsen\monster-mash\third_party\image\imageUtils.cpp" "C:\Users\t
  okejepsen\monster-mash\third_party\miscutils\def3d.cpp" "C:\Users\tokejepsen\monster-mash\third_party
  \miscutils\mesh3d.cpp" "C:\Users\tokejepsen\monster-mash\third_party\miscutils\fsutils.cpp" "C:\Users
  \tokejepsen\monster-mash\third_party\miscutils\opengltools.cpp" "C:\Users\tokejepsen\monster-mash\thi
  rd_party\miscutils\camera.cpp"
  Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29336 for x64
  Copyright (C) Microsoft Corporation.  All rights reserved.
  cl /c /I"C:\Users\tokejepsen\monster-mash\src\..\third_party" /I"C:\Users\tokejepsen\monster-mash\src
  \..\third_party\eigen3-mod" /I"C:\Users\tokejepsen\monster-mash\src\..\third_party\eigen3" /I"C:\User
  s\tokejepsen\monster-mash\src\..\third_party\libigl\include" /I"C:\Users\tokejepsen\monster-mash\src\
  ..\third_party\stb" /I"C:\Users\tokejepsen\monster-mash\src\..\third_party\triangle" /I"C:\Users\toke
  jepsen\monster-mash\src\..\third_party\zip-mod" /I"C:\Users\tokejepsen\monster-mash\src\..\third_part
  y\SDL2_gfx" /I"C:\Users\tokejepsen\monster-mash\src\..\third_party\SDL2_gfx-mod" /I"C:\Users\tokejeps
  en\Desktop\SDL2-2.0.14-win32-x64\include" /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D WIN32 /D _WIND
  OWS /D ENABLE_DEBUG_CMD_MM /D IMAGE_READ_WRITE /D IMAGE_MINIZ_EXTERNAL /D IMAGE_SCALE /D TRILIBRARY /
  D NO_TIMER /D IGL_PARALLEL_FOR_FORCE_SERIAL /D EIGEN_MPL2_ONLY /D EIGEN_SPARSESOLVERBASE_H /D _SDL2_g
  fxPrimitives_h /D APP_VERSION= /D USE_SDL_GLES2 /D USE_OPENGL_FOR_DRAWING_INSTEAD_OF_SDL /D "CMAKE_IN
  TDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /G
  R /std:c++17 /Fo"monstermash.dir\Debug\\" /Fd"monstermash.dir\Debug\vc142.pdb" /Gd /TP /errorReport:q
  ueue  -Wno-sign-compare -Werror=return-type -Wno-narrowing "C:\Users\tokejepsen\monster-mash\src\main
  .cpp" "C:\Users\tokejepsen\monster-mash\src\defengarapl.cpp" "C:\Users\tokejepsen\monster-mash\src\cp
  anim.cpp" "C:\Users\tokejepsen\monster-mash\src\loadsave.cpp" "C:\Users\tokejepsen\monster-mash\src\r
  econstruction.cpp" "C:\Users\tokejepsen\monster-mash\src\mainwindow.cpp" "C:\Users\tokejepsen\monster
  -mash\src\mypainter.cpp" "C:\Users\tokejepsen\monster-mash\src\mywindow.cpp" "C:\Users\tokejepsen\mon
  ster-mash\src\def3dsdl.cpp" "C:\Users\tokejepsen\monster-mash\third_party\ir3d-utils\regionToMesh.cpp
  " "C:\Users\tokejepsen\monster-mash\third_party\ir3d-utils\MeshBuilder.cpp" "C:\Users\tokejepsen\mons
  ter-mash\third_party\image\imageReadWrite.cpp" "C:\Users\tokejepsen\monster-mash\third_party\image\im
  ageScale.cpp" "C:\Users\tokejepsen\monster-mash\third_party\image\imageUtils.cpp" "C:\Users\tokejepse
  n\monster-mash\third_party\miscutils\def3d.cpp" "C:\Users\tokejepsen\monster-mash\third_party\miscuti
  ls\mesh3d.cpp" "C:\Users\tokejepsen\monster-mash\third_party\miscutils\fsutils.cpp" "C:\Users\tokejep
  sen\monster-mash\third_party\miscutils\opengltools.cpp" "C:\Users\tokejepsen\monster-mash\third_party
  \miscutils\camera.cpp"
cl : command line error D8021: invalid numeric argument '/Wno-sign-compare' [C:\Users\tokejepsen\monste
r-mash\build\monstermash.vcxproj]
Done Building Project "C:\Users\tokejepsen\monster-mash\build\monstermash.vcxproj" (default targets) --
 FAILED.

Done Building Project "C:\Users\tokejepsen\monster-mash\build\monstermash.vcxproj.metaproj" (default ta
rgets) -- FAILED.

Done Building Project "C:\Users\tokejepsen\monster-mash\build\monstermash.sln" (default targets) -- FAI
LED.


Build FAILED.

"C:\Users\tokejepsen\monster-mash\build\monstermash.sln" (default target) (1) ->
"C:\Users\tokejepsen\monster-mash\build\monstermash.vcxproj.metaproj" (default target) (3) ->
"C:\Users\tokejepsen\monster-mash\build\monstermash.vcxproj" (default target) (4) ->
(ClCompile target) ->
  cl : command line error D8021: invalid numeric argument '/Wno-sign-compare' [C:\Users\tokejepsen\mons
ter-mash\build\monstermash.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.19

Think this project has not been tested on Windows, just looking at the Cmake compiler messages;

message("Compiling for Linux")

@tokejepsen
Copy link
Author

Would also be nice with maybe just a Dockerfile, which might be easier than compile instructions.

@dvoromar
Copy link
Contributor

Hi, I'm going to add compiling instructions for building on Linux as that is what I use for development. At this state, the project might be non-trivial to compile on other platforms, however, I had success using mingw-w64 for building on Windows in the past.

@tokejepsen
Copy link
Author

Amazing @dvoromar !
If we could get a docker image going, then it'll be easier to continue contributing development efforts, while waiting/figuring out Mac/Windows.

@XxAzeSxX
Copy link

Hi, I'm going to add compiling instructions for building on Linux as that is what I use for development. At this state, the project might be non-trivial to compile on other platforms, however, I had success using mingw-w64 for building on Windows in the past.

could you please add your windows build process aswell would highly appriciate it ^^

@AtomicNixon
Copy link

AtomicNixon commented Feb 28, 2021

Hi, I'm going to add compiling instructions for building on Linux as that is what I use for development. At this state, the project might be non-trivial to compile on other platforms, however, I had success using mingw-w64 for building on Windows in the past.

30 years ago I was inserting machine code into Borland Pascal library files, now I can't tell if I've compiled a program successfully, or how to install the thing if it has compiled. Found and installed relevant SDL2 dev files. Ran Cmake ./src with no errors. Ran make with no errors. make install gives me "make: *** No rule to make target 'install'. Stop." So as I've got 100+ tabs open and it's late I shall take it's advice and Stop for the night.
Wonderful project you've got going here. It would be even more wonderful if it could use a simple line-drawing template as it's input rather than sloppy hand-drawn lines.

Edit: I forgot to mention that this is on Ubuntu 20.04 under Windows 10.

@tokejepsen
Copy link
Author

Wonderful project you've got going here. It would be even more wonderful if it could use a simple line-drawing template as it's input rather than sloppy hand-drawn lines.

Do you mean tracing existing lines?

@nonlin
Copy link

nonlin commented Feb 28, 2021

On windows with VS 2019 I've done all that @tokejepsen has done so far minus the last step.

Instead I got the error "Invalid numeric argument '/Wno-sign-compare'."

In the configuration properties for Command Line under "AdditionalOptions" I then removed all additional options and was able to progress into the complication process.

However I was then greeted with more errors...
Missing define for M_PI which I then added...
'clock_t' is not a member of 'global namespace'.
syntax errors.. lots of them...

It seems these issues stem from the fact that this source was probably compiled for Linux and not for Windows inside Visual Studio. I'll keep trying to lower the error count but yeah doing this on windows when it was originally for Linux is going to be more difficult.

@XxAzeSxX
Copy link

On windows with VS 2019 I've done all that @tokejepsen has done so far minus the last step.

Instead I got the error "Invalid numeric argument '/Wno-sign-compare'."

In the configuration properties for Command Line under "AdditionalOptions" I then removed all additional options and was able to progress into the complication process.

However I was then greeted with more errors...
Missing define for M_PI which I then added...
'clock_t' is not a member of 'global namespace'.
syntax errors.. lots of them...

It seems these issues stem from the fact that this source was probably compiled for Linux and not for Windows inside Visual Studio. I'll keep trying to lower the error count but yeah doing this on windows when it was originally for Linux is going to be more difficult.

can you give me the link to your fork as soon as you're done i will prob automate it after you're done making it run on VS

@MihaiAnca13
Copy link

I’ve managed to compile it on Linux. Unfortunately, it doesn’t work as showcased in the video.

You need to cmake src/ and cmake --build .. No need to install. This will produce a monstermash executable. I can post all issues I had and how I solved them if people are interested. When trying to compile on Windows, it fails because of the incompatibility with the filesystem library.

When I run the ‘monstermash’ executable it comes up with: “Failed to load texture” no matter where the executable and the ‘data’ folders are. In the code, you can see it's looking for the texture in the data folder, supposedly located 2 folders up.

Regardless, the window created has no GUI, and after finding the shortcuts in the code, I’ve managed to get it started. The script only runs on one CPU, being incredibly slow. Having no texture either, made it impossible to use at all.

How can we run it on all available CPUs and hopefully making use of some GPU power as well? Also, how do we enable the GUI showcased in the presentation video?

Thanks in advance!

@tokejepsen
Copy link
Author

How can we run it on all available CPUs and hopefully making use of some GPU power as well? Also, how do we enable the GUI showcased in the presentation video?

The UI has been build for WASM, so you could give the WIP docker container a try.
Think for a local application, it'll need a different UI frontend.

@MihaiAnca13
Copy link

I don't mind running it as a web application, but how do I link the monstermash executable with the things inside the src/ui folder?

@tokejepsen
Copy link
Author

I tested @rahulpowar docker file yesterday and it worked, so you can look at what the docker file is doing; https://github.com/rahulpowar/monster-mash/blob/main/Dockerfile

BTW this is the wip docker container; #3

@MihaiAnca13
Copy link

Thanks @tokejepsen!

What about the CPU/GPU utilisation problem?

@tokejepsen
Copy link
Author

What about the CPU/GPU utilisation problem?

Havent actually looked at the CPU/GPU usage, sorry. Would be good if you could report on your findings with the docker container!

@MihaiAnca13
Copy link

No problem! Will update you as soon as I do.

@rahulpowar
Copy link

What about the CPU/GPU utilisation problem?

Havent actually looked at the CPU/GPU usage, sorry. Would be good if you could report on your findings with the docker container!

My container only builds the web version. I have not tried the native linux binary.

@tokejepsen
Copy link
Author

@MihaiAnca13 the wip docker container is at a working state, so you can check out the PR branch to test with.

@dvoromar
Copy link
Contributor

dvoromar commented Mar 1, 2021

@XxAzeSxX @MihaiAnca13

I only tried to compile this version on Linux. There was an early development version that used Qt for UI. That version appeared in some demo video clips, however, it is now deprecated and no longer being developed.

@AtomicNixon
Copy link

Wonderful project you've got going here. It would be even more wonderful if it could use a simple line-drawing template as it's input rather than sloppy hand-drawn lines.

Do you mean tracing existing lines?

Yes. Something like a basic bitmap to raster routine.

@tokejepsen
Copy link
Author

Yes. Something like a basic bitmap to raster routine.

This is probably good for a separate issue, so the idea does not get lost in the compiling discussion.

@Yishun99
Copy link

Yishun99 commented Mar 4, 2021

mypainter.cpp:202:5: error: ‘SDL_PixelFormatEnum’ was not declared in th$s scope
@dvoromar @tokejepsen Hi, have you encountered this error and how did you solve it?

@tokejepsen
Copy link
Author

@DouYishun could you elaborate? What platform are you compiling to?

@Yishun99
Copy link

Yishun99 commented Mar 4, 2021

Linux, and libsdl2 was installed using apt-get.

@tokejepsen
Copy link
Author

Havent had this, but havent tried compiling to Linux as much as Emscripten.

If you could post a reproducible then we can test it out.

@MihaiAnca13
Copy link

mypainter.cpp:202:5: error: ‘SDL_PixelFormatEnum’ was not declared in th$s scope
@dvoromar @tokejepsen Hi, have you encountered this error and how did you solve it?

Yes, I had that as well!

The SDL2 library has the struct, but it's not named for some reason. You need to go where the SDL2 library is installed, find the file that has that structure, and just insert the name in the front.

@tokejepsen
Copy link
Author

@dvoromar how do you enable debugging messages from DEBUG_CMD_MM?
Seems like the -g (https://emscripten.org/docs/tools_reference/emcc.html#emcc-g) flag is already added to the build, but I dont see any of these messages; https://github.com/google/monster-mash/blob/main/src/CMakeLists.txt#L80

@yangzhifu-git
Copy link

I have downloaded sdl2-devel-2.0.14-vc.zip and used cmake to point to this folder, but still cannot find it with cmake @tokejepsen

@dvoromar
Copy link
Contributor

dvoromar commented Mar 7, 2021

@dvoromar how do you enable debugging messages from DEBUG_CMD_MM?
Seems like the -g (https://emscripten.org/docs/tools_reference/emcc.html#emcc-g) flag is already added to the build, but I dont see any of these messages; https://github.com/google/monster-mash/blob/main/src/CMakeLists.txt#L80

That macro can be enabled by defining ENABLE_DEBUG_CMD_MM. By default, it's enabled in desktop build but disabled in emscripten one. Have a look at the following:

ENABLE_DEBUG_CMD_MM

@tokejepsen
Copy link
Author

@dvoromar how do you enable debugging messages from DEBUG_CMD_MM?
Seems like the -g (https://emscripten.org/docs/tools_reference/emcc.html#emcc-g) flag is already added to the build, but I dont see any of these messages; https://github.com/google/monster-mash/blob/main/src/CMakeLists.txt#L80

That macro can be enabled by defining ENABLE_DEBUG_CMD_MM. By default, it's enabled in desktop build but disabled in emscripten one. Have a look at the following:

ENABLE_DEBUG_CMD_MM

Tried enabling ENABLE_DEBUG_CMD_MM but it does not come through the emscripten build. Got any ideas? Have you got debug messages enabled on the website demo?

@pierrebrice54
Copy link

Thank you for the docker notes.

With slight modifications, they can help compile on Ubuntu 18.04 to run as a Linux web application using the following work arounds. (Would expect a similar compilation experience with 20.04.)

-Create build directory in monster-mash folder, say buildems.
mkdir \buildems && cd \buildems

-Run cmake to setup configuration as indicated by the docker notes
cmake ../src -D CMAKE_C_COMPILER=emcc -D CMAKE_CXX_COMPILER=em++ -D CMAKE_BUILD_TYPE=Release.

-Run make to build.
make

--I run into the 'SDL_PixelFormatEnum not declared" error while compiling mypainter.cpp, so I declared it in 'mypainter.h'.
private:
...
enum SDL_PixelFormatEnum {SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888};

--I also ran into an 'FE_UNDERFLOW" not defined" error while compiling polar_dec.cpp, so I added the following line on top of that file:
#define FE_UNDERFLOW 8

-Move the build files to your web server root folder. I am running the Apache2 web server. So I did the following:
cp -r buildems /var/www/html
mkdir /var/www/html/buildems/includes
cp /src/ui/main.* /var/www/html/buildems/includes
cp /third-party/emscripten-ui/module.js /var/www/html/buildems/incudes
cp /third-party/FileSaver/FileSaver.js /var/www/html/buildems/includes

Once that done, you should be able to access the web application by pointing your browser to /buildems/monstermash.html.

@albertotono
Copy link

albertotono commented Jul 6, 2021

How can you run monstermash on your local desktop ( Linux, Ubuntu 20.4) after you have built it successfully with cmake?

After I run:

cmake -DCMAKE_BUILD_TYPE=Release ../../src && make

I got this

Compiling for Linux
CMake Warning (dev) at /usr/share/cmake-3.16/Modules/FindOpenGL.cmake:275 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:104 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

MM version: 210705
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alberto/monster-mash/build/Release
/usr/bin/cmake -S/home/alberto/monster-mash/src -B/home/alberto/monster-mash/build/Release --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/alberto/monster-mash/build/Release/CMakeFiles /home/alberto/monster-mash/build/Release/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/alberto/monster-mash/build/Release'
make -f CMakeFiles/monstermash.dir/build.make CMakeFiles/monstermash.dir/depend
make[2]: Entering directory '/home/alberto/monster-mash/build/Release'
cd /home/alberto/monster-mash/build/Release && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/alberto/monster-mash/src /home/alberto/monster-mash/src /home/alberto/monster-mash/build/Release /home/alberto/monster-mash/build/Release /home/alberto/monster-mash/build/Release/CMakeFiles/monstermash.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/alberto/monster-mash/build/Release'
make -f CMakeFiles/monstermash.dir/build.make CMakeFiles/monstermash.dir/build
make[2]: Entering directory '/home/alberto/monster-mash/build/Release'
make[2]: Nothing to be done for 'CMakeFiles/monstermash.dir/build'.
make[2]: Leaving directory '/home/alberto/monster-mash/build/Release'
[100%] Built target monstermash
make[1]: Leaving directory '/home/alberto/monster-mash/build/Release'
/usr/bin/cmake -E cmake_progress_start /home/alberto/monster-mash/build/Release/CMakeFiles 0

It seems it everything working well.

If I go to build/Release and use make I have this:

/usr/bin/cmake -S/home/alberto/monster-mash/src -B/home/alberto/monster-mash/build/Release --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/alberto/monster-mash/build/Release/CMakeFiles /home/alberto/monster-mash/build/Release/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/alberto/monster-mash/build/Release'
make -f CMakeFiles/monstermash.dir/build.make CMakeFiles/monstermash.dir/depend
make[2]: Entering directory '/home/alberto/monster-mash/build/Release'
cd /home/alberto/monster-mash/build/Release && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/alberto/monster-mash/src /home/alberto/monster-mash/src /home/alberto/monster-mash/build/Release /home/alberto/monster-mash/build/Release /home/alberto/monster-mash/build/Release/CMakeFiles/monstermash.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/alberto/monster-mash/build/Release'
make -f CMakeFiles/monstermash.dir/build.make CMakeFiles/monstermash.dir/build
make[2]: Entering directory '/home/alberto/monster-mash/build/Release'
make[2]: Nothing to be done for 'CMakeFiles/monstermash.dir/build'.
make[2]: Leaving directory '/home/alberto/monster-mash/build/Release'
[100%] Built target monstermash
make[1]: Leaving directory '/home/alberto/monster-mash/build/Release'
/usr/bin/cmake -E cmake_progress_start /home/alberto/monster-mash/build/Release/CMakeFiles 0

Not sure how I can start sketching on it.

@micwoj92
Copy link

micwoj92 commented Jul 6, 2021

@albertotono You need the web version.

@albertotono
Copy link

Thanks @micwoj92 for the quick reply. With the web version, even after installing emsdk and set up the proper PATH.

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/home/alberto/emsdk/upstream/emscripten/emcc -DCMAKE_CXX_COMPILER=/home/alberto/emsdk/upstream/emscripten/em++ ../../src && make

I get this message:

-- The CXX compiler identification is unknown
-- The C compiler identification is unknown
-- Check for working CXX compiler: /home/alberto/emsdk/upstream/emscripten/em++
-- Check for working CXX compiler: /home/alberto/emsdk/upstream/emscripten/em++ -- broken
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:53 (message):
  The C++ compiler

    "/home/alberto/emsdk/upstream/emscripten/em++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/alberto/monster-mash/build/Release/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/make cmTC_93620/fast && /usr/bin/make -f CMakeFiles/cmTC_93620.dir/build.make CMakeFiles/cmTC_93620.dir/build
    make[1]: Entering directory '/home/alberto/monster-mash/build/Release/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_93620.dir/testCXXCompiler.cxx.o
    /home/alberto/emsdk/upstream/emscripten/em++     -o CMakeFiles/cmTC_93620.dir/testCXXCompiler.cxx.o -c /home/alberto/monster-mash/build/Release/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    em++: error: BINARYEN_ROOT is set to empty value in /home/alberto/emsdk/upstream/emscripten/.emscripten
    make[1]: *** [CMakeFiles/cmTC_93620.dir/build.make:66: CMakeFiles/cmTC_93620.dir/testCXXCompiler.cxx.o] Error 1
    make[1]: Leaving directory '/home/alberto/monster-mash/build/Release/CMakeFiles/CMakeTmp'
    make: *** [Makefile:121: cmTC_93620/fast] Error 2
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:17 (project)


-- Configuring incomplete, errors occurred!
See also "/home/alberto/monster-mash/build/Release/CMakeFiles/CMakeOutput.log".
See also "/home/alberto/monster-mash/build/Release/CMakeFiles/CMakeError.log".
(base) alberto@tensorbook:~/monster-mash/build/Release$ 

@micwoj92
Copy link

micwoj92 commented Jul 6, 2021

@albertotono from emscripten official documentation
https://emscripten.org/docs/building_from_source/configuring_emscripten_settings.html

"In most cases it is necessary to edit the generated file and modify at least the LLVM_ROOT and BINARYEN_ROOT settings to point to the correct location of your local LLVM and Binaryen installations respectively."

At least that should be the solution based on the error you had em++: error: BINARYEN_ROOT is set to empty value in /home/alberto/emsdk/upstream/emscripten/.emscripten

@albertotono
Copy link

albertotono commented Jul 6, 2021

Thanks @micwoj92. I solved with the docker container for now.

building with docker build . -t monstermash from here and I also access it with chrome.

http://localhost:8000/monstermash.html

Screenshot from 2021-07-06 16-13-56
(some icons missing now)

Since now we can export a gltf format, do you know if with these settings we could build a WebXR viewer?

@micwoj92
Copy link

micwoj92 commented Jul 6, 2021

I don't know much about (3d) graphics stuff.

@anjuiboson
Copy link

anjuiboson commented Jul 8, 2021

HI,
Run time Linux operating system fully slow and this error messages are show,

"
monstermash.js:4592 emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up.

module.js:29 Calling stub instead of sigaction()
"

@lone83
Copy link

lone83 commented Oct 3, 2021

anyone have a working solution for a windows compiler for this?

@pablodalma93
Copy link

Thanks @micwoj92. I solved with the docker container for now.

building with docker build . -t monstermash from here and I also access it with chrome.

http://localhost:8000/monstermash.html

Screenshot from 2021-07-06 16-13-56 (some icons missing now)

Since now we can export a gltf format, do you know if with these settings we could build a WebXR viewer?

I built and run the dockerfile in Ubuntu and nothing happened, supposedly I should see something if I type localhost:8000 in any web browser?

This was referenced Jan 5, 2023
@txirrindulari
Copy link

Thank you for the docker notes.

With slight modifications, they can help compile on Ubuntu 18.04 to run as a Linux web application using the following work arounds. (Would expect a similar compilation experience with 20.04.)

* Install emscrispten as indicated by the docker notes.
  cd /opt && git clone https://github.com/emscripten-core/emsdk.git && cd emsdk && ./emsdk install latest && ./emsdk activate latest

* Clone monster-mash.
  git clone https://github.com/google/monster-mash.git

-Create build directory in monster-mash folder, say buildems. mkdir \buildems && cd \buildems

-Run cmake to setup configuration as indicated by the docker notes cmake ../src -D CMAKE_C_COMPILER=emcc -D CMAKE_CXX_COMPILER=em++ -D CMAKE_BUILD_TYPE=Release.

-Run make to build. make

--I run into the 'SDL_PixelFormatEnum not declared" error while compiling mypainter.cpp, so I declared it in 'mypainter.h'. private: ... enum SDL_PixelFormatEnum {SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888};

--I also ran into an 'FE_UNDERFLOW" not defined" error while compiling polar_dec.cpp, so I added the following line on top of that file: #define FE_UNDERFLOW 8

-Move the build files to your web server root folder. I am running the Apache2 web server. So I did the following: cp -r buildems /var/www/html mkdir /var/www/html/buildems/includes cp /src/ui/main.* /var/www/html/buildems/includes cp /third-party/emscripten-ui/module.js /var/www/html/buildems/incudes cp /third-party/FileSaver/FileSaver.js /var/www/html/buildems/includes

Once that done, you should be able to access the web application by pointing your browser to /buildems/monstermash.html.

Thank you. It works now for me.
And from bash in the /build/Release/ folder where I copy the files you said, I run python3 -m http.server 8886 and xdg-open http://0.0.0.0:8886/monstermash.html

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