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

Remove btk references #3280

Merged
merged 8 commits into from Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions Bindings/CMakeLists.txt
Expand Up @@ -3,9 +3,6 @@ if(BUILD_PYTHON_WRAPPING OR BUILD_JAVA_WRAPPING)
endif()

# Flags are both Python and Java bindings will use.
if(WITH_BTK)
set(SWIG_FLAGS "-DWITH_BTK")
endif()
if(WITH_EZC3D)
set(SWIG_FLAGS "-DWITH_EZC3D")
endif()
Expand Down
2 changes: 1 addition & 1 deletion Bindings/Java/Matlab/tests/CMakeLists.txt
Expand Up @@ -92,7 +92,7 @@ OpenSimAddMatlabTest(AccessSubcomponents testAccessSubcomponents.m)
OpenSimAddMatlabTest(Simbody testSimbody.m)
OpenSimAddMatlabTest(osimTableStruct testosimTableStruct.m)
OpenSimAddMatlabTest(testOsimVec3 testOsimVec3.m)
if(WITH_BTK OR WITH_EZC3D)
if(WITH_EZC3D)
OpenSimAddMatlabTest(testOsimC3D testOsimC3D.m)
endif()
OpenSimAddMatlabTest(testOsimList2MatlabCell testOsimList2MatlabCell.m)
Expand Down
2 changes: 1 addition & 1 deletion Bindings/Java/tests/CMakeLists.txt
Expand Up @@ -143,7 +143,7 @@ OpenSimAddJavaTest(TestTables)
OpenSimAddJavaTest(TestModelBuilding)
OpenSimAddJavaTest(TestEditMarkers)
OpenSimAddJavaTest(TestIKInterfaces)
if(WITH_BTK OR WITH_EZC3D)
if(WITH_EZC3D)
OpenSimAddJavaTest(TestC3DFileAdapter)
endif()
OpenSimAddJavaTest(TestReporter)
Expand Down
2 changes: 1 addition & 1 deletion Bindings/common.i
Expand Up @@ -420,7 +420,7 @@ namespace OpenSim {
%include <OpenSim/Common/CSVFileAdapter.h>
%include <OpenSim/Common/XsensDataReader.h>

#if defined WITH_EZC3D || defined (WITH_BTK)
#if defined (WITH_EZC3D)
%include <OpenSim/Common/C3DFileAdapter.h>

%extend OpenSim::C3DFileAdapter {
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -11,6 +11,7 @@ v4.4.1

- Made `Component::getSocketNames` a `const` member method (previously: non-const)
- Modifed the swig interface files to make OpenSim::PathPointSet adopt new PathPoints inserted into it. (Issue #3276)
- Remove references to obsoleted dependency BTK, use ezc3d exclusively.
- Fixed an issue with IPOPT libraries when building OpenSim with `OPENSIM_WITH_CASADI = ON` but `OPENSIM_WITH_TROPTER = OFF` (Issue #3267).

v4.4
Expand Down
42 changes: 6 additions & 36 deletions CMakeLists.txt
Expand Up @@ -135,7 +135,7 @@ from the internet, we turn this option OFF." ON)
set(SIMBODY_HOME $ENV{SIMBODY_HOME} CACHE
PATH "The location of the Simbody installation to use; you can change this. Set as empty to let CMake search for Simbody automatically.")

option(OPENSIM_COPY_DEPENDENCIES "Copy Simbody, ezc3d and BTK into the
option(OPENSIM_COPY_DEPENDENCIES "Copy Simbody and ezc3d into the
OpenSim installation. This should be set to ON when making a relocatable
distribution, and should be set to OFF when packaging for Homebrew, Debian,
etc. On Linux and macOS: we use relative RPATHs when ON, and absolute RPATHs
Expand All @@ -144,7 +144,7 @@ BUILD_PYTHON_WRAPPING is ON, so if this OFF, a warning is thrown." ON)
mark_as_advanced(OPENSIM_COPY_DEPENDENCIES)

option(OPENSIM_PYTHON_STANDALONE "Make the Python package standalone, meaning
the OpenSim (and Simbody, ezc3d and BTK) shared libraries it depends on are copied
the OpenSim (and Simbody and ezc3d) shared libraries it depends on are copied
into the package. If you are building OpenSim on the same machine on which you
plan to use it, you can leave this OFF. If you are distributing OpenSim to
other computers, you should turn this ON. If macOS, this option affects how
Expand Down Expand Up @@ -640,9 +640,9 @@ if(UNIX) # Linux and macOS
# Add the automatically determined parts of the RPATH which point
# to directories outside the build tree to the install RPATH.
# If we are copying Simbody into OpenSim's installation, then
# there's no need to link to the libraries in Simbody's, ezc3d's or BTK's
# there's no need to link to the libraries in Simbody's or ezc3d's
# original installations. Furthermore, we may be distributing OpenSim
# to other computers that will not have our original Simbody, ezc3d or BTK
# to other computers that will not have our original Simbody or ezc3d
# installations, and so the RPATH would point to a nonexistant
# directory on others' computers.
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
Expand Down Expand Up @@ -696,11 +696,10 @@ endif()


set(OPENSIM_C3D_PARSER None CACHE STRING
"Compile OpenSim with a C3D parser ? ezc3d or BTK provide C3D reading.")
set_property(CACHE OPENSIM_C3D_PARSER PROPERTY STRINGS "ezc3d" "BTK" "None")
"Compile OpenSim with a C3D parser ? ezc3d provide C3D reading.")
set_property(CACHE OPENSIM_C3D_PARSER PROPERTY STRINGS "ezc3d" "None")
if(${OPENSIM_C3D_PARSER} STREQUAL "ezc3d")
set(WITH_EZC3D true)
set(WITH_BTK false)
set(ezc3d_hint "${OPENSIM_DEPENDENCIES_DIR}/ezc3d/lib/cmake/ezc3d")
find_package(ezc3d REQUIRED HINTS "${ezc3d_hint}")
add_definitions(-DWITH_EZC3D)
Expand All @@ -716,32 +715,12 @@ if(${OPENSIM_C3D_PARSER} STREQUAL "ezc3d")
OpenSimInstallDependencyLibraries(ezc3d "${ezc3d_DIR}/../../../bin"
"${ezc3d_DIR}/../../../lib" "${OPENSIM_INSTALL_PYTHONDIR}/opensim")
endif()
elseif(${OPENSIM_C3D_PARSER} STREQUAL "BTK")
set(WITH_EZC3D false)
unset(ezc3d_LIBRARY_DIR CACHE)
unset(ezc3d_LIBRARY)
unset(ezc3d_INCLUDE_DIR CACHE)
set(WITH_BTK true)

# If compiling with BTK, find and use it.
find_package(BTK
REQUIRED
HINTS "${OPENSIM_DEPENDENCIES_DIR}/BTK/share/btk-0.4dev")
include(${BTK_USE_FILE})
add_definitions(-DWITH_BTK)
OpenSimCopyDependencyDLLsForWin(DEP_NAME BTK
DEP_BIN_DIR ${BTK_INSTALL_PREFIX}/bin)
if(BUILD_PYTHON_WRAPPING AND OPENSIM_PYTHON_STANDALONE)
OpenSimInstallDependencyLibraries(BTK "${BTK_INSTALL_PREFIX}"
"${BTK_LIBRARY_DIRS}" "${OPENSIM_INSTALL_PYTHONDIR}/opensim")
endif()

else()
set(WITH_EZC3D false)
unset(ezc3d_LIBRARY_DIR CACHE)
unset(ezc3d_LIBRARY)
unset(ezc3d_INCLUDE_DIR CACHE)
set(WITH_BTK false)
endif()

find_package(spdlog REQUIRED
Expand Down Expand Up @@ -956,15 +935,6 @@ if(${OPENSIM_COPY_DEPENDENCIES})
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endif()

# BTK
# ---
if(NOT WIN32)
# LIB: .so files on Linux, .dylib on macOS
file(GLOB btk_desired_lib_files "${BTK_LIBRARY_DIRS}/*BTK*")
install(FILES ${btk_desired_lib_files}
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endif()

# spdlog
# ------
install(DIRECTORY "${spdlog_DIR}/../../../"
Expand Down
6 changes: 3 additions & 3 deletions DEVELOPING.md
Expand Up @@ -74,7 +74,7 @@ documentation online.

The layout of the distribution on Windows is as follows:

- `bin/` OpenSim, SimTK, and BTK DLLs, opensim-cmd.exe, simbody-visualizer.exe
- `bin/` OpenSim and SimTK DLLs, opensim-cmd.exe, simbody-visualizer.exe
- `cmake/` OpenSimConfig.cmake, etc.
- `sdk/`
- `APIExamples/`: C++ examples.
Expand All @@ -99,7 +99,7 @@ if `OPENSIM_INSTALL_UNIX_FHS` is `ON`, as follows:
- `include/`
- `OpenSim/` OpenSim (and Lepton) headers.
- `simbody/` Simbody headers.
- `lib/` (on some Linux variants, `lib/<arch>/`) OpenSim, SimTK, and BTK shared libraries.
- `lib/` (on some Linux variants, `lib/<arch>/`) OpenSim and SimTK shared libraries.
- `cmake/` OpenSimConfig.cmake, SimbodyConfig.cmake, etc.
- `python2.7/site-packages/` OpenSim Python bindings.
- `libexec/simbody/simbody-visualizer`
Expand Down Expand Up @@ -151,7 +151,7 @@ interchangeably.

There are two types of dependencies: public, or those exposed through OpenSim's
API (e.g., Simbody), and private, or those used internally by OpenSim
(e.g., BTK and ezc3d):
(e.g., ezc3d):

- **private**: OpenSim's binary distribution need only contain the
dependency's dynamic libraries.
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Common/Adapters.h
Expand Up @@ -27,7 +27,7 @@
#include "STOFileAdapter.h"
#include "CSVFileAdapter.h"

#if defined (WITH_EZC3D) || defined (WITH_BTK)
#if defined (WITH_EZC3D)

#include "C3DFileAdapter.h"

Expand Down