Coder Social home page Coder Social logo

Comments (13)

pca006132 avatar pca006132 commented on July 1, 2024 1

iirc the determinism one failing is expected.

For python binding, manifold-cad is just something I rushed in an afternoon for quick testing (I want to see if this can replace openscad for faster builds), so it is not a proper python binding. You can have a look at https://github.com/pca006132/manifold/tree/pybind11 , which is a proper python binding with numpy support, but you may have to rebase with the emscripten branch first to update the build script.

The branch is using this lazy union: #100 which triggers #102, so it is still a WIP.

from manifold.

elalish avatar elalish commented on July 1, 2024

I haven't even tried this yet myself, so @pca006132 is the most likely to know. I'd guess you're missing some of the steps that Github Actions is doing under the hood: https://github.com/elalish/manifold/pull/103/files#diff-723c1253d0c94075d3d7c80504b08943c02209f016433937ccf803a3ca6eb5fe

from manifold.

pca006132 avatar pca006132 commented on July 1, 2024

Sorry the PR has been force-pushed multiple times today, as it is only working on my computer locally but not in the CI. This should now be fixed. The emscripten build should not require CGAL, so I guess you are using an old version.

There are several things to check:

  1. Are you using the latest version from the PR? I have force-pushed it multiple times today so yours may be outdated.
  2. Did you clone the git submodules? The emscripten build needs those submodules to work.
  3. Did you apply the patch to assimp? The patch removes the -Werror compiler flag in assimp, because there is an unused variable in their code which causes build failure. Command: patch third_party/assimp/code/CMakeLists.txt < assimp.diff

from manifold.

rsaccon avatar rsaccon commented on July 1, 2024

Thanks for the responses. I tried again with latest version and the emscripten build worked. I look forward to play around with it !

The CPP build failed again, this time at the google-test linking:

[ 20%] Linking CXX static library libgtest.a
cd /Users/robertosaccon/cAndCpp/manifold-emscripten/buildCPP/third_party/google_test/googletest-build/googlemock/gtest && /usr/local/Cellar/cmake/3.21.3_1/bin/cmake -P CMakeFiles/gtest.dir/cmake_clean_target.cmake
cd /Users/robertosaccon/cAndCpp/manifold-emscripten/buildCPP/third_party/google_test/googletest-build/googlemock/gtest && /usr/local/Cellar/cmake/3.21.3_1/bin/cmake -E cmake_link_script CMakeFiles/gtest.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar qc libgtest.a CMakeFiles/gtest.dir/src/gtest-all.cc.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib libgtest.a
[ 20%] Built target gtest
make: *** [all] Error 2

from manifold.

pca006132 avatar pca006132 commented on July 1, 2024

Nice, let me know when you can integrate it with some JS stuff! I guess it can now load and export 3D models via assimp, but I haven't really tried that out yet.

Not sure why the CPP build fails, can you try to get some more verbose output for it?

from manifold.

rsaccon avatar rsaccon commented on July 1, 2024

I checked again the CPP build log and there is a compile error as well:

[ 11%] Building CXX object meshIO/CMakeFiles/meshIO.dir/src/meshIO.cpp.o
cd /Users/robertosaccon/cAndCpp/manifold-emscripten/buildCPP/meshIO && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -I/Users/robertosaccon/cAndCpp/manifold-emscripten/meshIO/include -I/Users/robertosaccon/cAndCpp/manifold-emscripten/third_party/thrust -I/Users/robertosaccon/cAndCpp/manifold-emscripten/third_party/glm -I/Users/robertosaccon/cAndCpp/manifold-emscripten/utilities/include -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -mmacosx-version-min=11.6 -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CPP -std=gnu++14 -MD -MT meshIO/CMakeFiles/meshIO.dir/src/meshIO.cpp.o -MF CMakeFiles/meshIO.dir/src/meshIO.cpp.o.d -o CMakeFiles/meshIO.dir/src/meshIO.cpp.o -c /Users/robertosaccon/cAndCpp/manifold-emscripten/meshIO/src/meshIO.cpp
/Users/robertosaccon/cAndCpp/manifold-emscripten/meshIO/src/meshIO.cpp:19:10: fatal error: 'assimp/Exporter.hpp' file not found
#include "assimp/Exporter.hpp"
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.

the thing is, buildWASM/third_party/assimp exists, but there is no buildCPP/third_party/assimp

(base) robertosaccon@MacBook-Pro buildCPP % ls -al  third_party 
total 24
drwxr-xr-x   7 robertosaccon  staff   224 May  6 04:06 .
drwxr-xr-x  16 robertosaccon  staff   512 May  6 04:16 ..
drwxr-xr-x   4 robertosaccon  staff   128 May  6 04:06 CMakeFiles
-rw-r--r--   1 robertosaccon  staff  4813 May  6 04:06 Makefile
-rw-r--r--   1 robertosaccon  staff  1638 May  6 04:06 cmake_install.cmake
drwxr-xr-x   8 robertosaccon  staff   256 May  6 04:06 google_test
drwxr-xr-x   6 robertosaccon  staff   192 May  6 04:06 graphlite

from manifold.

pca006132 avatar pca006132 commented on July 1, 2024

Indeed, the build script will not build assimp if the target is not for emscripten. I thought that users can just use their own local installation. Perhaps we should build that also.

from manifold.

elalish avatar elalish commented on July 1, 2024

Indeed, the build script will not build assimp if the target is not for emscripten. I thought that users can just use their own local installation. Perhaps we should build that also.

Yeah, I left a comment to that effect in your PR. Keeping the build process consistent will probably make our lives easier. You also mentioned here that you'd like to make gtest a submodule as well. That also seems reasonable given all the other submodules you've added. Honestly, maybe graphlite should be a submodule too instead of just being copied in. Seems more legit. I know some people are anti-submodule, but I can't remember the reasons at the moment; hopefully they don't apply to this.

from manifold.

rsaccon avatar rsaccon commented on July 1, 2024

In my case, I have assimp (Version 5.2.3) installed via common MacOS package manager brew. So with current situation, am I supposed to set some environment variable so my local assimp can be found ?

from manifold.

pca006132 avatar pca006132 commented on July 1, 2024

Before I update the PR, you can try the following patch:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac27861..b344ffe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,13 +12,13 @@ set(CMAKE_VERBOSE_MAKEFILE ON)
 set(THRUST_BACKEND "CUDA" CACHE STRING
     "Thrust backend, either \"CUDA\", \"OMP\" or \"CPP\"(single-threaded)"
 )
+set(ASSIMP_INC_DIR 
+    ${PROJECT_SOURCE_DIR}/third_party/assimp/include
+    ${CMAKE_BINARY_DIR}/third_party/assimp/include)
 if(EMSCRIPTEN)
     message("Building for Emscripten")
     set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -sALLOW_MEMORY_GROWTH=1)
     set(THRUST_BACKEND "CPP")
-    set(ASSIMP_INC_DIR 
-        ${PROJECT_SOURCE_DIR}/third_party/assimp/include
-        ${CMAKE_BINARY_DIR}/third_party/assimp/include)
 endif()
 set_property(CACHE THRUST_BACKEND PROPERTY STRINGS CUDA OMP CPP)
 
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index 26877ee..44c3372 100644
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -1,11 +1,9 @@
 add_subdirectory(google_test)
 add_subdirectory(graphlite)
 
-if(EMSCRIPTEN)
-    set(BUILD_SHARED_LIBS off)
-    set(ASSIMP_BUILD_ASSIMP_TOOLS off)
-    set(ASSIMP_BUILD_TESTS off)
-    add_subdirectory(assimp)
-endif()
+set(BUILD_SHARED_LIBS off)
+set(ASSIMP_BUILD_ASSIMP_TOOLS off)
+set(ASSIMP_BUILD_TESTS off)
+add_subdirectory(assimp)

Regarding the MacOS package problem, I am not sure why can't CMake find the include path for assimp. Perhaps the one you installed does not contain header files, i.e. not a dev package? Anyway we should switch to building with submodules so this should not be a problem later.

from manifold.

rsaccon avatar rsaccon commented on July 1, 2024

With the patch applied, it successfully built. But one of the CPP tests failed:

[ RUN      ] Manifold.Determinism
/Users/robertosaccon/cAndCpp/manifold-emscripten/test/mesh_test.cpp:156: Failure
Expected equality of these values:
  num_overlaps
    Which is: 229439
  229611
[  FAILED  ] Manifold.Determinism (98 ms)

About the package problem, there is only one assimp package available with that package manager, so for Mac users it is probably better assimp gets locally built.

Anyway, I am very excited to play around with manifold. I will try to access the lib from python, i guess manifold-cad is currently the best example how it can be done.
EDITED: Uups, python bindings in the work by pca006132, but there is a comment there: "not working yet"

from manifold.

rsaccon avatar rsaccon commented on July 1, 2024

yeah, I just saw it, thanks a lot, will try to dive into it ...

from manifold.

rsaccon avatar rsaccon commented on July 1, 2024

now we can close this as well, will open later a new issue regarding python bindings

from manifold.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.