diff --git a/3rd_party/sapien-vulkan-2 b/3rd_party/sapien-vulkan-2 index 76aa31b8..49f37594 160000 --- a/3rd_party/sapien-vulkan-2 +++ b/3rd_party/sapien-vulkan-2 @@ -1 +1 @@ -Subproject commit 76aa31b8b646c3bb3f54d45d35bc8efb2398f486 +Subproject commit 49f37594365b69cc615b64d222b97a4ca0f56aaf diff --git a/CMakeLists.txt b/CMakeLists.txt index 450a763c..53a4794a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,11 @@ cmake_minimum_required(VERSION 3.18 FATAL_ERROR) project(sapien LANGUAGES C CXX) +if(MSVC) + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) +endif() + + set(CMAKE_CXX_STANDARD 20) if(MSVC) @@ -49,7 +54,10 @@ list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(physx5) include(zlib) -include(grpc) + +# TODO: re-enable render server +# include(grpc) + include(eigen) include(vulkan) include(cereal) @@ -84,7 +92,8 @@ file(GLOB_RECURSE SAPIEN_SRC "src/*.h" "src/*.cpp" "src/*.cc") add_library(sapien SHARED ${SAPIEN_SRC}) target_link_libraries(sapien PUBLIC eigen svulkan2 cereal) -target_link_libraries(sapien PRIVATE physx5 spdlog::spdlog easy_profiler grpc++ ${CMAKE_DL_LIBS} assimp::assimp) +target_link_libraries(sapien PRIVATE physx5 spdlog::spdlog easy_profiler # grpc++ + ${CMAKE_DL_LIBS} assimp::assimp) if (UNIX) target_link_libraries(sapien PRIVATE stdc++fs) diff --git a/cmake/physx5.cmake b/cmake/physx5.cmake index 156e8439..590e33cd 100644 --- a/cmake/physx5.cmake +++ b/cmake/physx5.cmake @@ -36,7 +36,7 @@ endif() if (WIN32) target_include_directories(physx5 SYSTEM INTERFACE $) - target_link_directories(physx5 INTERFACE $) + target_link_directories(physx5 INTERFACE $) target_link_libraries(physx5 INTERFACE PhysXVehicle2_static_64.lib PhysXExtensions_static_64.lib PhysXVehicle_static_64.lib PhysX_static_64.lib PhysXPvdSDK_static_64.lib diff --git a/include/sapien/component/sapien_renderer/deformable_mesh_component.h b/include/sapien/component/sapien_renderer/deformable_mesh_component.h index 3bbf52fc..e7385f1c 100644 --- a/include/sapien/component/sapien_renderer/deformable_mesh_component.h +++ b/include/sapien/component/sapien_renderer/deformable_mesh_component.h @@ -7,7 +7,9 @@ #include "sapien/serialize.h" #include +#ifdef SAPIEN_CUDA #include +#endif namespace sapien { namespace component { @@ -49,9 +51,11 @@ class CudaDeformableMeshComponent : public Component { svulkan2::scene::Object *mObject{}; +#ifdef SAPIEN_CUDA vk::UniqueSemaphore mSem{}; cudaExternalSemaphore_t mCudaSem{}; uint64_t mSemValue{0}; +#endif }; } // namespace component diff --git a/include/sapien/component/system.h b/include/sapien/component/system.h index d9be3a0a..0936f599 100644 --- a/include/sapien/component/system.h +++ b/include/sapien/component/system.h @@ -1,6 +1,8 @@ #pragma once #include #include +#include +#include namespace sapien { namespace component { diff --git a/python/py_package/__init__.pyi b/python/py_package/__init__.pyi index 717be871..4ed5f773 100644 --- a/python/py_package/__init__.pyi +++ b/python/py_package/__init__.pyi @@ -61,5 +61,5 @@ __all__ = [ def set_log_level(level: str) -> None: pass -__version__ = '3.0.0.dev20231103' +__version__ = '3.0.0.dev20231104' SceneConfig = sapien.pysapien.physx.PhysxSceneConfig diff --git a/setup.py b/setup.py index c2bde545..bc78d999 100644 --- a/setup.py +++ b/setup.py @@ -101,8 +101,11 @@ def build_sapien(sapien_source_dir, sapien_build_dir): else: cmake_args += ["-DSAPIEN_CUDA=OFF"] - cmake_args += ["-DCMAKE_BUILD_TYPE=" + cfg] - cmake_args += ["-DCMAKE_INSTALL_PREFIX=" + install_dir] + cmake_args += [ + f"-DCMAKE_BUILD_TYPE={cfg}", + f"-DCMAKE_INSTALL_PREFIX={install_dir}", + "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded", + ] env = os.environ.copy() subprocess.check_call( @@ -162,6 +165,7 @@ def build_pinocchio(self, ext): cmake_args = [ f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$<1:{extdir}>", f"-DPYTHON_EXECUTABLE={sys.executable}", + f"-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded", ] if args.debug: cfg = "Debug" @@ -193,6 +197,7 @@ def build_pybind(self, ext): cmake_args = [ f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$<1:{extdir}>", f"-DPYTHON_EXECUTABLE={sys.executable}", + f"-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded", ] if args.debug: cfg = "Debug" diff --git a/src/component/sapien_renderer/deformable_mesh_component.cpp b/src/component/sapien_renderer/deformable_mesh_component.cpp index 11425bdf..4df97051 100644 --- a/src/component/sapien_renderer/deformable_mesh_component.cpp +++ b/src/component/sapien_renderer/deformable_mesh_component.cpp @@ -4,8 +4,6 @@ #include "sapien/entity.h" #include "sapien/scene.h" -#include - namespace sapien { namespace component { @@ -14,6 +12,7 @@ CudaDeformableMeshComponent::CudaDeformableMeshComponent(uint32_t maxVertexCount mEngine = SapienRenderEngine::Get(); mMesh = std::make_shared(maxVertexCount, maxTriangleCount); +#ifdef SAPIEN_CUDA vk::SemaphoreTypeCreateInfo timelineCreateInfo(vk::SemaphoreType::eTimeline, 0); vk::SemaphoreCreateInfo createInfo{}; vk::ExportSemaphoreCreateInfo exportCreateInfo( @@ -34,8 +33,8 @@ CudaDeformableMeshComponent::CudaDeformableMeshComponent(uint32_t maxVertexCount throw std::runtime_error("Failed to export semaphore to CUDA: " + std::string(cudaGetErrorName(err))); } +#endif - // TODO: set material mMaterial = std::make_shared(); } diff --git a/src/component/sapien_renderer/sapien_renderer_default.cpp b/src/component/sapien_renderer/sapien_renderer_default.cpp index 4e5ad6c8..dedbab3f 100644 --- a/src/component/sapien_renderer/sapien_renderer_default.cpp +++ b/src/component/sapien_renderer/sapien_renderer_default.cpp @@ -79,11 +79,13 @@ void SapienRendererDefault::internalSetShaderSearchPath(std::string const &dir) } void SapienRendererDefault::setImguiIniFilename(std::string const &filename) { - svulkan2::renderer::GuiWindow::gImguiIniFileLocation = filename; + svulkan2::renderer::GuiWindow::setImguiIniFileLocation(filename); + // svulkan2::renderer::GuiWindow::gImguiIniFileLocation = filename; } std::string SapienRendererDefault::getImguiIniFilename() { - return svulkan2::renderer::GuiWindow::gImguiIniFileLocation; + return svulkan2::renderer::GuiWindow::getImguiIniFileLocation(); + // return svulkan2::renderer::GuiWindow::gImguiIniFileLocation; } } // namespace component