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

[simbody] new port #20565

Merged
merged 25 commits into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions ports/simbody/0001-Use-vcpkg-deps.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 02514a82..67874065 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -529,13 +529,13 @@ endif()
# Intel MKL: mkl_intel_c_dll;mkl_sequential_dll;mkl_core_dll
set(BUILD_USING_OTHER_LAPACK "" CACHE STRING
"If you have your own Lapack and Blas, put libraries here, separated by semicolons (full paths or paths that are on the (DY)LD_LIBRARY_PATH (UNIX) or PATH (Windows)). See LAPACK_BEING_USED to see what's actually being used.")
-if(WIN32)
+if(WIN32 AND FALSE)
set(LAPACK_PLATFORM_DEFAULT lapack;blas)
else()
find_package(BLAS)
find_package(LAPACK)
if(BLAS_FOUND AND LAPACK_FOUND)
- set(LAPACK_PLATFORM_DEFAULT ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
+ set(BUILD_USING_OTHER_LAPACK ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
else()
message(WARNING "Could not find blas/lapack")
endif()
diff --git a/Platform/CMakeLists.txt b/Platform/CMakeLists.txt
index 5dfc381d..0c6ebc81 100644
--- a/Platform/CMakeLists.txt
+++ b/Platform/CMakeLists.txt
@@ -205,7 +205,6 @@ set(PLATFORM_INCLUDE_DIRECTORIES "${PLATFORM_INCLUDE_DIRECTORIES}"
PARENT_SCOPE)

# This needs an outer loop if you add more include directories.
-file(GLOB INCL_FILES "${PLATFORM_INCLUDE_DIRECTORIES}/*.h")
foreach(INCLF ${INCL_FILES})
get_filename_component(INCLF_ROOT ${INCLF} NAME)
install(FILES ${INCLF}
22 changes: 22 additions & 0 deletions ports/simbody/0002-Use-same-install-dir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 67874065..9410900b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -602,7 +602,7 @@ endif()
# root CMakeLists.txt so the cmake config file can see this value.
#
# Also specify where include files are installed.
-if(WIN32)
+if(true)
# Install visualizer to bin, since it needs to be co-located with dll's
set(SIMBODY_VISUALIZER_REL_INSTALL_DIR ${CMAKE_INSTALL_BINDIR})
# Install include files into base include folder since it's a sandbox
@@ -656,7 +656,7 @@ set(PKG_LIBRARIES
${SimTKCOMMON_LIBRARY_NAME}
)

-if(WIN32)
+if(true)
set(SIMBODY_CMAKE_DIR cmake)
elseif(UNIX)
set(SIMBODY_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/simbody/)
44 changes: 44 additions & 0 deletions ports/simbody/0003-Fix-static.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9410900b..cf370e92 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -457,25 +457,31 @@ if(MSVC)
mark_as_advanced(BUILD_LIMIT_PARALLEL_COMPILES)
set(mxcpu ${BUILD_LIMIT_PARALLEL_COMPILES}) # abbreviation

+ if(BUILD_MD)
+ set(CRT "/MD")
+ else()
+ set(CRT "/MT")
+ endif()
+
## C++
set(BUILD_CXX_FLAGS_DEBUG
- "/D _DEBUG /MDd /Od /Ob0 /RTC1 /Zi /GS- ${CL_INST_SET}")
+ "/D _DEBUG ${CRT}d /Od /Ob0 /RTC1 /Zi /GS- ${CL_INST_SET}")
set(BUILD_CXX_FLAGS_RELEASE
- "/D NDEBUG /MD /O2 /Ob2 /Oi /GS- ${CL_INST_SET}")
+ "/D NDEBUG ${CRT} /O2 /Ob2 /Oi /GS- ${CL_INST_SET}")
set(BUILD_CXX_FLAGS_RELWITHDEBINFO
- "/D NDEBUG /MD /O2 /Ob2 /Oi /Zi /GS- ${CL_INST_SET}")
+ "/D NDEBUG ${CRT} /O2 /Ob2 /Oi /Zi /GS- ${CL_INST_SET}")
set(BUILD_CXX_FLAGS_MINSIZEREL
- "/D NDEBUG /MD /O1 /Ob1 /Oi /GS- ${CL_INST_SET}")
+ "/D NDEBUG ${CRT} /O1 /Ob1 /Oi /GS- ${CL_INST_SET}")

## C
set(BUILD_C_FLAGS_DEBUG
- "/D _DEBUG /MDd /Od /Ob0 /RTC1 /Zi /GS- ${CL_INST_SET}")
+ "/D _DEBUG ${CRT}d /Od /Ob0 /RTC1 /Zi /GS- ${CL_INST_SET}")
set(BUILD_C_FLAGS_RELEASE
- "/D NDEBUG /MD /O2 /Ob2 /Oi /GS- ${CL_INST_SET}")
+ "/D NDEBUG ${CRT} /O2 /Ob2 /Oi /GS- ${CL_INST_SET}")
set(BUILD_C_FLAGS_RELWITHDEBINFO
- "/D NDEBUG /MD /O2 /Ob2 /Oi /Zi /GS- ${CL_INST_SET}")
+ "/D NDEBUG ${CRT} /O2 /Ob2 /Oi /Zi /GS- ${CL_INST_SET}")
set(BUILD_C_FLAGS_MINSIZEREL
- "/D NDEBUG /MD /O1 /Ob1 /Oi /GS- ${CL_INST_SET}")
+ "/D NDEBUG ${CRT} /O1 /Ob1 /Oi /GS- ${CL_INST_SET}")

## C++
set(CMAKE_CXX_FLAGS_DEBUG "/MP${mxcpu} ${BUILD_CXX_FLAGS_DEBUG}"
40 changes: 40 additions & 0 deletions ports/simbody/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
vcpkg_fail_port_install(ON_TARGET "uwp")
Ace314159 marked this conversation as resolved.
Show resolved Hide resolved

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO simbody/simbody
REF a8f49c84e98ccf3b7e6f05db55a29520e5f9c176
Ace314159 marked this conversation as resolved.
Show resolved Hide resolved
SHA512 85493e00286163ed8ac6aa71edf8d34701d62ac5e5f472f654faa8852eb7fd569ffc0d76fd2e88bebcd3f79df9e35fc702a029890defb8b0d84d0d0512268960
HEAD_REF master
PATCHES
"0001-Use-vcpkg-deps.patch"
"0002-Use-same-install-dir.patch"
"0003-Fix-static.patch"
NancyLi1013 marked this conversation as resolved.
Show resolved Hide resolved
)
file(REMOVE_RECURSE "${SOURCE_PATH}/Platform/Windows")

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBRARIES)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_DYNAMIC_LIBRARIES)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" BUILD_MD)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_DYNAMIC_LIBRARIES=${BUILD_DYNAMIC_LIBRARIES}
-DBUILD_STATIC_LIBRARIES=${BUILD_STATIC_LIBRARIES}
-DBUILD_MD=${BUILD_MD}
-DINSTALL_DOCS=OFF
-DBUILD_VISUALIZER=OFF
-DBUILD_EXAMPLES=OFF
-DBUILD_TESTING=OFF
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(CONFIG_PATH cmake)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
19 changes: 19 additions & 0 deletions ports/simbody/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "simbody",
"version-string": "3.8-a8f49c84e98ccf3b7e6f05db55a29520e5f9c176",
Ace314159 marked this conversation as resolved.
Show resolved Hide resolved
"description": "High-performance C++ multibody dynamics/physics library for simulating articulated biomechanical and mechanical systems like vehicles, robots, and the human skeleton.",
"homepage": "https://simtk.org/home/simbody",
"supports": "!uwp",
"dependencies": [
"blas",
"lapack",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6144,6 +6144,10 @@
"baseline": "1.8.1",
"port-version": 1
},
"simbody": {
"baseline": "3.8-a8f49c84e98ccf3b7e6f05db55a29520e5f9c176",
"port-version": 0
},
"simde": {
"baseline": "0.7.2",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/s-/simbody.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "7d46849524a870b9e077dec3c51cba0a670ab0ee",
"version-string": "3.8-a8f49c84e98ccf3b7e6f05db55a29520e5f9c176",
"port-version": 0
}
]
}