-
Notifications
You must be signed in to change notification settings - Fork 98
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
Trying to compile manifold on a Mac #104
Comments
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 |
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:
|
Thanks for the responses. I tried again with latest version and the emscripten build worked. I look forward to play around with it ! The
|
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? |
I checked again the CPP build log and there is a compile error as well:
the thing is,
|
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. |
In my case, I have |
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. |
With the patch applied, it successfully built. But one of the CPP tests failed:
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. |
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. |
yeah, I just saw it, thanks a lot, will try to dive into it ... |
now we can close this as well, will open later a new issue regarding python bindings |
I am using the latest patches for emscripten on an Intel Mac with MacOS 11.6.5. And I believe to have installed all the dependencies. For Mac there is no
nvcc
. Here is how far I got with the other options:compiling for CPP:
error:
and my attempt for emscripten:
error:
I have CGAL installed (with
brew
). Any advice on how to build it on a Mac ?The text was updated successfully, but these errors were encountered: