From 609edcbf04ef8fe222e30af5e56bb210f4265188 Mon Sep 17 00:00:00 2001 From: Michael Sherman Date: Fri, 23 Aug 2013 10:47:22 -0700 Subject: [PATCH 01/12] Update README.md Modified README.md to describe the purpose of the Simbody3.3 branch, which is to make only changes needed for integration with Gazebo. --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f8db3d17a..2cf350d4d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,13 @@ -simbody +Simbody 3.3 (Gazebo integration branch) ======= -[Move to GitHub in progress.] +This branch is for modification of the Simbody build/release process as needed for +inegration with Open Source Robotics Foundation's Gazebo robot simulator. Once this +is working we will merge those changes back into the master branch. -Source code for the Simbody libraries, examples, and build system. +Other than build/release changes, this branch is feature frozen. + +======= Simbody is a high-performance, open-source toolkit for simulation of articulated mechanisms, including biological structures, robots, vehicles, From d49db583d1855dc6c727aadb760a235f0d71cbc8 Mon Sep 17 00:00:00 2001 From: sherm1 Date: Fri, 23 Aug 2013 11:43:28 -0700 Subject: [PATCH 02/12] Removed "(development)" note in version number for Doxygen. --- Doxyfile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doxyfile.in b/Doxyfile.in index 486a5bf77..1c6cbc985 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -32,7 +32,7 @@ PROJECT_NAME = @PROJECT_NAME@ # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = "3.3 (development)" +PROJECT_NUMBER = "3.3" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer From d7baf74e3afa944f1dc7dbd4ee3e570db62b8250 Mon Sep 17 00:00:00 2001 From: sherm1 Date: Thu, 29 Aug 2013 14:23:02 -0700 Subject: [PATCH 03/12] Modified MobilizedBody::lock() and lockAt() methods to immediately modify q and/or u in the state to satisfy the requested lock, rather than waiting until the next prescribe() call. This satisfies Kevin He's request in Simbody issue #20. --- .../include/simbody/internal/MobilizedBody.h | 46 +++++++++++++------ Simbody/src/MobilizedBody.cpp | 38 +++++++++------ 2 files changed, 57 insertions(+), 27 deletions(-) diff --git a/Simbody/include/simbody/internal/MobilizedBody.h b/Simbody/include/simbody/internal/MobilizedBody.h index 613895f60..a2ff2c39a 100644 --- a/Simbody/include/simbody/internal/MobilizedBody.h +++ b/Simbody/include/simbody/internal/MobilizedBody.h @@ -194,7 +194,11 @@ to specified values, accelerations udot are prescribed to zero, and positions will remain free. If you lock position (the default locking level) then the generalized coordinates q are prescribed to specified values and the speeds u and accelerations udot are prescribed to zero. Prescribed values may be obtained -from the current state, or set explicitly. +from the current state, or set explicitly. The lock() and lockAt() methods when +called at position level will modify q in the given state if necessary to +satisfy the locked position, and will set u to zero. When called at velocity +level they will modify u if necessary to satisfied the locked velocity, but will +leave q unchanged. You can also specify that a mobilizer is locked by default (at acceleration, velocity, or position level). In that case the prescribed value is recorded @@ -204,32 +208,46 @@ state at that time. If this mobilizer is driven by a Motion object, locking overrides that while the lock is active; when unlocked the Motion object resumes control. **/ /**@{**/ -/** Lock the contained mobilizer's position or velocity, or lock the +/** Lock this mobilizer's position or velocity at its current value, or lock the acceleration to zero, depending on the \p level parameter. The prescribed -position or velocity is taken from \p state and recorded. If the mobilizer was -already locked, the new lock specification overrides it. The \p state must -already have been realized to at least Stage::Model and will be lowered to -Stage::Model on return since a lock is an Instance-stage change. **/ +position or velocity is taken from \p state and recorded. If the lock is at +the position (q) level then the generalized speeds u for this mobilizer are set +to zero in the \p state. If the mobilizer was already locked, the new lock +specification overrides it. The \p state must already have been realized to at +least Stage::Model and will be lowered to Stage::Model on return since a lock is +an Instance-stage change. **/ void lock(State& state, Motion::Level level=Motion::Position) const; /** Lock this mobilizer's q, u, or udot to the given scalar \p value, depending -on \p level. This is only permitted for mobilizers that have just a single -q, u, or udot, such as a Pin or Slider mobilizer. **/ +on \p level. When locking at the position level (the default), this mobilizer's +q in \p state is set to \p value, and u in \p state is set to zero. When locking +at velocity level, this mobilizer's u in \p state is set to \p value but the q +is left unchanged. This signature of lockAt(), taking \p value as a scalar, is +only permitted for mobilizers that have just a single q and u, such as a Pin or +Slider mobilizer. See the other signatures of lockAt() for multi-coordinate +mobilizers. **/ void lockAt(State& state, Real value, Motion::Level level=Motion::Position) const; /** Lock this mobilizer's q, u, or udot to the given Vector \p value, depending -on \p level. The Vector must be the expected length, either nq=getNumQ() for -the default Motion::Position level, or nu=getNumU() for Motion::Velocity or -Motion::Acceleration levels. +on \p level. When locking at the position level (the default), this mobilizer's +q's in \p state is set to \p value, and its u's in \p state are set to zero. +When locking at velocity level, this mobilizer's u's in \p state are set to +\p value but its q's are left unchanged. The Vector must be the expected length, +either nq=getNumQ() for the default Motion::Position level, or nu=getNumU() for +Motion::Velocity or Motion::Acceleration levels. @see getNumQ(), getNumU() **/ void lockAt(State& state, const Vector& value, Motion::Level level=Motion::Position) const; /** Lock this mobilizer's q, u, or udot to the given Vec\ \p value, -depending on the \p level. The size N of the given Vec must match the expected -length, either nq=getNumQ() for the default Motion::Position level, or -nu=getNumU() for Motion::Velocity or Motion::Acceleration levels. +depending on the \p level. When locking at the position level (the default), +this mobilizer's q's in \p state is set to \p value, and its u's in \p state are +set to zero. When locking at velocity level, this mobilizer's u's in \p state +are set to \p value but its q's are left unchanged. The size N of the given Vec +must match the expected length, either nq=getNumQ() for the default +Motion::Position level, or nu=getNumU() for Motion::Velocity or +Motion::Acceleration levels. @see getNumQ(), getNumU() **/ template SimTK_SIMBODY_EXPORT // instantiated in library void lockAt(State& state, const Vec& value, diff --git a/Simbody/src/MobilizedBody.cpp b/Simbody/src/MobilizedBody.cpp index 74e16273f..ea9857519 100644 --- a/Simbody/src/MobilizedBody.cpp +++ b/Simbody/src/MobilizedBody.cpp @@ -608,7 +608,8 @@ void MobilizedBodyImpl::findMobilizerUs } // Set the lock level and record the current q or u if needed so we can -// ensure that the state is prescribed to the recorded value. +// ensure that the state is prescribed to the recorded value. When locking +// q, set u to zero now. // Can't do this until *after* realize(Model) because that's when the q's and // u's are sized and the lock-by-default coordinates are recorded, and this // should override those. @@ -619,23 +620,27 @@ lock(State& state, Motion::Level level) const { SBInstanceVars& iv = getMyMatterSubsystemRep().updInstanceVars(state); iv.mobilizerLockLevel[getMyMobilizedBodyIndex()] = level; + UIndex uStart; int nu; findMobilizerUs(state, uStart, nu); + const UIndex uEnd(uStart+nu); + if (level == Motion::Position) { + Vector& u = state.updU(); // set generalized speeds to zero + for (UIndex ux=uStart; ux != uEnd; ++ux) + u[ux] = 0; const Vector& q = state.getQ(); assert(iv.lockedQs.size() == q.size()); QIndex qStart; int nq; findMobilizerQs(state, qStart, nq); const QIndex qEnd(qStart+nq); for (QIndex qx=qStart; qx != qEnd; ++qx) iv.lockedQs[qx] = q[qx]; - } else if (level == Motion::Velocity) { + } + else if (level == Motion::Velocity) { const Vector& u = state.getU(); assert(iv.lockedUs.size() == u.size()); - UIndex uStart; int nu; findMobilizerUs(state, uStart, nu); - const UIndex uEnd(uStart+nu); for (UIndex ux=uStart; ux != uEnd; ++ux) iv.lockedUs[ux] = u[ux]; - } else if (level == Motion::Acceleration) { - UIndex uStart; int nu; findMobilizerUs(state, uStart, nu); - const UIndex uEnd(uStart+nu); + } + else if (level == Motion::Acceleration) { for (UIndex ux=uStart; ux != uEnd; ++ux) iv.lockedUs[ux] = 0; } @@ -648,23 +653,30 @@ lockAt(State& state, int n, const Real* value, Motion::Level level) const { SBInstanceVars& iv = getMyMatterSubsystemRep().updInstanceVars(state); iv.mobilizerLockLevel[getMyMobilizedBodyIndex()] = level; + UIndex uStart; int nu; findMobilizerUs(state, uStart, nu); + const UIndex uEnd(uStart+nu); if (level == Motion::Position) { + Vector& u = state.updU(); // set generalized speeds to zero + for (UIndex ux=uStart; ux != uEnd; ++ux) + u[ux] = 0; + Vector& q = state.updQ(); QIndex qStart; int nq; findMobilizerQs(state, qStart, nq); + const QIndex qEnd(qStart+nq); SimTK_ERRCHK3_ALWAYS(n==nq, "MobilizedBody::lockAt()", "Supplied value had wrong length %d for locking at " "%s level; should have been nq=%d.", n, Motion::nameOfLevel(level), nq); - for (int i=0; i < nq; ++i) - iv.lockedQs[QIndex(qStart+i)] = value[i]; - } else if (level == Motion::Velocity || level == Motion::Acceleration) { - UIndex uStart; int nu; findMobilizerUs(state, uStart, nu); + for (QIndex qx=qStart; qx != qEnd; ++qx) + q[qx] = iv.lockedQs[qx] = *value++; // set qs now & remember + } + else if (level == Motion::Velocity || level == Motion::Acceleration) { SimTK_ERRCHK3_ALWAYS(n==nu, "MobilizedBody::lockAt()", "Supplied value had wrong length %d for locking at " "%s level; should have been nu=%d.", n, Motion::nameOfLevel(level), nu); - for (int i=0; i < nu; ++i) - iv.lockedUs[UIndex(uStart+i)] = value[i]; + for (UIndex ux=uStart; ux != uEnd; ++ux) + iv.lockedUs[ux] = *value++; } } From 77e78ab5a1321ffb9847f6ab6d51484c9b3f45d4 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Fri, 30 Aug 2013 22:09:53 +0200 Subject: [PATCH 04/12] 3.3 version release --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index fdd52d104..55a5b3c85 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ -simbody (3.0-1~quantal) quantal; urgency=high +simbody (3.3-1~quantal) quantal; urgency=high - * Release 3.0 + * Release 3.3 -- Jose Luis Rivero Thu, 22 Aug 2013 16:23:00 -0700 From 0793cbd164b21df46cf5b8732184afd880ac291b Mon Sep 17 00:00:00 2001 From: Michael Sherman Date: Mon, 2 Sep 2013 19:40:00 -0700 Subject: [PATCH 05/12] Added .travis.yml file to simbody-3.3 branch; copied from Chris Dembia's contribution to master branch. --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..8bc0a0bb0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: cpp +compiler: + - gcc +install: + - sudo apt-get update + - sudo apt-get install liblapack-dev liblas-dev + - cmake . -DBUILD_EXAMPLES=off -DBUILD_VISUALIZER=off && make +script: ctest From 93ba7cc417fe6bd61b9dbd92c61dfa6a2258af03 Mon Sep 17 00:00:00 2001 From: Michael Sherman Date: Mon, 2 Sep 2013 20:33:09 -0700 Subject: [PATCH 06/12] Ask Travis to build with clang as well as gcc. (cherry picked from commit 1fe03caa08052f76ab5d619da2c7a232b7a3b5a9) --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 8bc0a0bb0..524a92f80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: cpp compiler: - gcc + - clang install: - sudo apt-get update - sudo apt-get install liblapack-dev liblas-dev From da167d2ed3a8151dcd814bba5b5ae59a60c88f19 Mon Sep 17 00:00:00 2001 From: Michael Sherman Date: Mon, 2 Sep 2013 21:29:14 -0700 Subject: [PATCH 07/12] Fix clang warnings. --- Simbody/src/SimbodyMatterSubsystemRep.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Simbody/src/SimbodyMatterSubsystemRep.cpp b/Simbody/src/SimbodyMatterSubsystemRep.cpp index 3a28ea770..252960f67 100644 --- a/Simbody/src/SimbodyMatterSubsystemRep.cpp +++ b/Simbody/src/SimbodyMatterSubsystemRep.cpp @@ -765,6 +765,10 @@ realizeSubsystemInstanceImpl(const State& s) const { case Motion::Discrete: case Motion::Fast: break; // nothing to do for these here + default: + SimTK_ASSERT1_ALWAYS(!"qMethod", + "SimbodyMatterSubsystemRep::realizeSubsystemInstanceImpl(): " + "Unrecognized qMethod %d.", (int)instanceInfo.qMethod); } // Assign u's to appropriate index vectors for convenient @@ -786,6 +790,10 @@ realizeSubsystemInstanceImpl(const State& s) const { case Motion::Discrete: case Motion::Fast: break; // nothing to do for these here + default: + SimTK_ASSERT1_ALWAYS(!"uMethod", + "SimbodyMatterSubsystemRep::realizeSubsystemInstanceImpl(): " + "Unrecognized uMethod %d.", (int)instanceInfo.uMethod); } // Assign udots to appropriate index vectors for convenient @@ -808,6 +816,10 @@ realizeSubsystemInstanceImpl(const State& s) const { case Motion::Discrete: case Motion::Fast: break; // nothing to do for these here + default: + SimTK_ASSERT1_ALWAYS(!"udotMethod", + "SimbodyMatterSubsystemRep::realizeSubsystemInstanceImpl(): " + "Unrecognized udotMethod %d.", (int)instanceInfo.udotMethod); } // Any non-Free udot needs a prescribed force (tau) slot. From 61fa9b78a50dc01406eb1c823b6d05510b8993e9 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Tue, 3 Sep 2013 19:15:46 +0200 Subject: [PATCH 08/12] Fix dependency: liblas -> libblas --- debian/control | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/debian/control b/debian/control index a6b1ad8ec..c24e189a3 100644 --- a/debian/control +++ b/debian/control @@ -9,11 +9,8 @@ Build-Depends: debhelper (>= 9), freeglut3-dev, libxi-dev, libxmu-dev, - libcurl4-gnutls-dev, - libdap-dev, - libgdal1-dev, liblapack-dev, - liblas-dev + libblas-dev Vcs-Browser: https://github.com/simbody/simbody Vcs-Git: git://github.com/simbody/simbody.git Homepage: https://simtk.org/home/simbody @@ -38,11 +35,8 @@ Section: libdevel Depends: freeglut3-dev, libxi-dev, libxmu-dev, - libcurl4-gnutls-dev, - libdap-dev, - libgdal1-dev, liblapack-dev, - liblas-dev, + libblas-dev, libsimbody3.3 (= ${binary:Version}), ${misc:Depends} Multi-Arch: same From 430435706ac6500ea2a77dc0344c8fd0ee1a602b Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Tue, 3 Sep 2013 19:23:39 +0200 Subject: [PATCH 09/12] Remove libblass dependency --- debian/control | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/debian/control b/debian/control index c24e189a3..d0bbc957e 100644 --- a/debian/control +++ b/debian/control @@ -9,8 +9,7 @@ Build-Depends: debhelper (>= 9), freeglut3-dev, libxi-dev, libxmu-dev, - liblapack-dev, - libblas-dev + liblapack-dev Vcs-Browser: https://github.com/simbody/simbody Vcs-Git: git://github.com/simbody/simbody.git Homepage: https://simtk.org/home/simbody @@ -36,7 +35,6 @@ Depends: freeglut3-dev, libxi-dev, libxmu-dev, liblapack-dev, - libblas-dev, libsimbody3.3 (= ${binary:Version}), ${misc:Depends} Multi-Arch: same From dd1b1a9eabbf87fc7a973b53b16da8381a2f1f5e Mon Sep 17 00:00:00 2001 From: John Hsu Date: Wed, 4 Sep 2013 14:49:09 -0700 Subject: [PATCH 10/12] prevent NaN generation when gravity is (0, 0, 0) and we switch from body is excluded to body is not excluded in gravity force appliction. This is necessary as the rest of the code skips updates when gravity is special cased to zero. --- Simbody/src/Force_Gravity.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Simbody/src/Force_Gravity.cpp b/Simbody/src/Force_Gravity.cpp index e4f95f942..de620fc9d 100644 --- a/Simbody/src/Force_Gravity.cpp +++ b/Simbody/src/Force_Gravity.cpp @@ -330,7 +330,10 @@ setBodyIsExcluded(State& state, MobilizedBodyIndex mobod, impl.setMobodIsImmune(state, mobod, isExcluded); // The zero must be precalculated if the body is immune to gravity. SpatialVec& F = impl.updForceCache(state).F_GB[mobod]; - if (isExcluded) F.setToZero(); else F.setToNaN(); + if (isExcluded || getMagnitude(state) == 0) + F.setToZero(); + else + F.setToNaN(); } return *this; } From 7023a2b188e7f4be42302cd8c0105fe193c94868 Mon Sep 17 00:00:00 2001 From: Steven Peters Date: Tue, 1 Oct 2013 23:12:38 -0700 Subject: [PATCH 11/12] fix #38: use CMAKE_INSTALL_PREFIX SimTK_INSTALL_PREFIX was previously used for specifying the install prefix and CMAKE_INSTALL_PREFIX. This commit changes to use CMAKE_INSTALL_PREFIX instead. --- CMakeLists.txt | 32 ++++++++++--------- Platform/CMakeLists.txt | 6 ++-- SimTKcommon/sharedTarget/CMakeLists.txt | 12 +++---- SimTKcommon/staticTarget/CMakeLists.txt | 12 +++---- SimTKmath/sharedTarget/CMakeLists.txt | 12 +++---- SimTKmath/staticTarget/CMakeLists.txt | 12 +++---- .../Visualizer/VisualizerGUI/CMakeLists.txt | 4 +-- Simbody/sharedTarget/CMakeLists.txt | 12 +++---- Simbody/staticTarget/CMakeLists.txt | 12 +++---- debian/rules | 2 +- 10 files changed, 59 insertions(+), 57 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8968e2f0f..bcf0f1a04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,7 +173,7 @@ SET(BUILD_PLATFORM "${PLATFORM_NAME}:${PLATFORM_ABI}" CACHE STRING # Make sure "sandbox" input & output directories are set. During # SimTK Core build, the build system will set them. Otherwise, we'll # set them to sensible local values. -# If SimTK_INSTALL_PREFIX is set then +# If CMAKE_INSTALL_PREFIX is set then # it is a sandbox installation area, otherwise we want to install # in /usr/local/simbody or %ProgramFiles%\Simbody. # @@ -183,14 +183,24 @@ SET(BUILD_PLATFORM "${PLATFORM_NAME}:${PLATFORM_ABI}" CACHE STRING # older system you might have to set it manually. SET(LIB64) +# For backward compatibility, use SimTK_INSTALL_PREFIX if +# CMAKE_INSTALL_PREFIX hasn't been set. +IF(NOT CMAKE_INSTALL_PREFIX) + IF(SimTK_INSTALL_PREFIX) + SET(CMAKE_INSTALL_PREFIX ${SimTK_INSTALL_PREFIX} CACHE STRING + "Install path prefix." FORCE) + mark_as_advanced(CMAKE_INSTALL_PREFIX) + ENDIF() +ENDIF() + # C compiler is gcc on Linux, gcc or cc on Mac where command line tools # are installed from XCode. May be clang in Mac 10.8 or later. IF(${CMAKE_C_COMPILER} MATCHES "cc" OR ${CMAKE_C_COMPILER} MATCHES "clang") - IF(NOT SimTK_INSTALL_PREFIX) - SET(SimTK_INSTALL_PREFIX "/usr/local/simbody" + IF(NOT CMAKE_INSTALL_PREFIX) + SET(CMAKE_INSTALL_PREFIX "/usr/local/simbody" CACHE PATH "Install directory") - ENDIF(NOT SimTK_INSTALL_PREFIX) + ENDIF(NOT CMAKE_INSTALL_PREFIX) # As of Ubuntu 12, 64 bit libraries are in lib, not lib64 #IF(${CMAKE_SIZEOF_VOID_P} EQUAL 8) @@ -214,21 +224,13 @@ ELSE() # Windows endif() ENDIF() - IF(NOT SimTK_INSTALL_PREFIX) - SET(SimTK_INSTALL_PREFIX "${PROGFILEDIR}/Simbody" + IF(NOT CMAKE_INSTALL_PREFIX) + SET(CMAKE_INSTALL_PREFIX "${PROGFILEDIR}/Simbody" CACHE PATH "Install directory") - ENDIF(NOT SimTK_INSTALL_PREFIX) + ENDIF(NOT CMAKE_INSTALL_PREFIX) ENDIF() -# CMake installs go into CMAKE_INSTALL_PREFIX, which is always -# set to something incorrect by CMake. We'll use SimTK_INSTALL_PREFIX -# instead which is passed in by the build system or set above. -SET(CMAKE_INSTALL_PREFIX ${SimTK_INSTALL_PREFIX} CACHE STRING - "Install path prefix." FORCE) -# User should set SimTK_INSTALL_PREFIX, so suppress cmake's -mark_as_advanced(CMAKE_INSTALL_PREFIX) - # On Mac, we'll use the defaults for the architecture and deployment target. # This works OK on OSX 10.8. For older systems, or if you want to build for # an older deployment target, or 32 bit or univeral binaries, you may have diff --git a/Platform/CMakeLists.txt b/Platform/CMakeLists.txt index 585e54298..6ebeb96a1 100644 --- a/Platform/CMakeLists.txt +++ b/Platform/CMakeLists.txt @@ -64,13 +64,13 @@ FOREACH(LIBF ${LIB_FILES}) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - DESTINATION ${SimTK_INSTALL_PREFIX}/bin) + DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) ELSE() INSTALL(FILES ${LIBF} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ - DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64}) + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64}) ENDIF() ENDFOREACH() @@ -93,6 +93,6 @@ FOREACH(INCLF ${INCL_FILES}) PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ - DESTINATION ${SimTK_INSTALL_PREFIX}/include ) + DESTINATION ${CMAKE_INSTALL_PREFIX}/include ) ENDFOREACH() diff --git a/SimTKcommon/sharedTarget/CMakeLists.txt b/SimTKcommon/sharedTarget/CMakeLists.txt index 4e108305b..7edccc8c4 100644 --- a/SimTKcommon/sharedTarget/CMakeLists.txt +++ b/SimTKcommon/sharedTarget/CMakeLists.txt @@ -22,9 +22,9 @@ IF(BUILD_UNVERSIONED_LIBRARIES) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin ) + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ) ENDIF(BUILD_UNVERSIONED_LIBRARIES) IF(BUILD_VERSIONED_LIBRARIES) @@ -46,9 +46,9 @@ IF(BUILD_VERSIONED_LIBRARIES) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin ) + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ) ENDIF(BUILD_VERSIONED_LIBRARIES) diff --git a/SimTKcommon/staticTarget/CMakeLists.txt b/SimTKcommon/staticTarget/CMakeLists.txt index f47d41756..a34d8e8a0 100644 --- a/SimTKcommon/staticTarget/CMakeLists.txt +++ b/SimTKcommon/staticTarget/CMakeLists.txt @@ -18,9 +18,9 @@ IF(BUILD_UNVERSIONED_LIBRARIES) INSTALL(TARGETS ${STATIC_TARGET} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ - ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin ) + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ) ENDIF(BUILD_UNVERSIONED_LIBRARIES) IF(BUILD_VERSIONED_LIBRARIES) @@ -37,7 +37,7 @@ IF(BUILD_VERSIONED_LIBRARIES) INSTALL(TARGETS ${STATIC_TARGET_VN} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ - ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin ) + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ) ENDIF(BUILD_VERSIONED_LIBRARIES) diff --git a/SimTKmath/sharedTarget/CMakeLists.txt b/SimTKmath/sharedTarget/CMakeLists.txt index 74d7009d7..c87abf5b0 100644 --- a/SimTKmath/sharedTarget/CMakeLists.txt +++ b/SimTKmath/sharedTarget/CMakeLists.txt @@ -44,9 +44,9 @@ IF(BUILD_UNVERSIONED_LIBRARIES) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin) + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) ENDIF(BUILD_UNVERSIONED_LIBRARIES) @@ -71,8 +71,8 @@ IF(BUILD_VERSIONED_LIBRARIES) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin) + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) ENDIF(BUILD_VERSIONED_LIBRARIES) diff --git a/SimTKmath/staticTarget/CMakeLists.txt b/SimTKmath/staticTarget/CMakeLists.txt index fecb5531d..cc10ddb4f 100644 --- a/SimTKmath/staticTarget/CMakeLists.txt +++ b/SimTKmath/staticTarget/CMakeLists.txt @@ -45,9 +45,9 @@ IF(BUILD_UNVERSIONED_LIBRARIES) PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ - ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin) + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) ENDIF(BUILD_UNVERSIONED_LIBRARIES) @@ -71,8 +71,8 @@ IF(BUILD_VERSIONED_LIBRARIES) PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ - ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin) + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) ENDIF(BUILD_VERSIONED_LIBRARIES) diff --git a/Simbody/Visualizer/VisualizerGUI/CMakeLists.txt b/Simbody/Visualizer/VisualizerGUI/CMakeLists.txt index 50de1909c..960f5c628 100644 --- a/Simbody/Visualizer/VisualizerGUI/CMakeLists.txt +++ b/Simbody/Visualizer/VisualizerGUI/CMakeLists.txt @@ -36,7 +36,7 @@ INSTALL(TARGETS ${GUI_NAME} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - DESTINATION ${SimTK_INSTALL_PREFIX}/bin) + DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) # on Windows we also have to copy and later install the glut32.dll IF(WIN32) @@ -47,5 +47,5 @@ IF(WIN32) COMMENT "Copying glut32.dll" VERBATIM) INSTALL(FILES ${glut32libdir}/glut32.dll - DESTINATION ${SimTK_INSTALL_PREFIX}/bin) #same as GUI + DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) #same as GUI ENDIF() diff --git a/Simbody/sharedTarget/CMakeLists.txt b/Simbody/sharedTarget/CMakeLists.txt index 0be2d1b08..03838da9c 100644 --- a/Simbody/sharedTarget/CMakeLists.txt +++ b/Simbody/sharedTarget/CMakeLists.txt @@ -26,9 +26,9 @@ IF(BUILD_UNVERSIONED_LIBRARIES) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin) + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) ENDIF(BUILD_UNVERSIONED_LIBRARIES) @@ -57,8 +57,8 @@ IF(BUILD_VERSIONED_LIBRARIES) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin) + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) ENDIF(BUILD_VERSIONED_LIBRARIES) diff --git a/Simbody/staticTarget/CMakeLists.txt b/Simbody/staticTarget/CMakeLists.txt index 170ac554d..113dfde2b 100644 --- a/Simbody/staticTarget/CMakeLists.txt +++ b/Simbody/staticTarget/CMakeLists.txt @@ -26,9 +26,9 @@ IF(BUILD_UNVERSIONED_LIBRARIES) PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ - ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin) + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) ENDIF(BUILD_UNVERSIONED_LIBRARIES) @@ -56,8 +56,8 @@ IF(BUILD_VERSIONED_LIBRARIES) PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ - ARCHIVE DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - LIBRARY DESTINATION ${SimTK_INSTALL_PREFIX}/lib${LIB64} - RUNTIME DESTINATION ${SimTK_INSTALL_PREFIX}/bin) + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB64} + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) ENDIF(BUILD_VERSIONED_LIBRARIES) diff --git a/debian/rules b/debian/rules index cd66610dc..9a66bccc9 100755 --- a/debian/rules +++ b/debian/rules @@ -8,7 +8,7 @@ override_dh_auto_configure: dh_auto_configure -- \ - -DSimTK_INSTALL_PREFIX:PATH=/usr \ + -DCMAKE_INSTALL_PREFIX:PATH=/usr \ -DBUILD_EXAMPLES:BOOL=False override_dh_auto_install: From ca24c54d0b7f284bd7933480c8b6a0641f21ea43 Mon Sep 17 00:00:00 2001 From: Steven Peters Date: Wed, 2 Oct 2013 15:39:59 -0700 Subject: [PATCH 12/12] Issue #38: fix use of SimTK_INSTALL_PREFIX Fix the use of SimTK_INSTALL_PREFIX for backward compatibility. --- CMakeLists.txt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bcf0f1a04..e90340f7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,12 +185,9 @@ SET(LIB64) # For backward compatibility, use SimTK_INSTALL_PREFIX if # CMAKE_INSTALL_PREFIX hasn't been set. -IF(NOT CMAKE_INSTALL_PREFIX) - IF(SimTK_INSTALL_PREFIX) - SET(CMAKE_INSTALL_PREFIX ${SimTK_INSTALL_PREFIX} CACHE STRING - "Install path prefix." FORCE) - mark_as_advanced(CMAKE_INSTALL_PREFIX) - ENDIF() +IF(SimTK_INSTALL_PREFIX AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + SET(CMAKE_INSTALL_PREFIX ${SimTK_INSTALL_PREFIX} CACHE PATH + "Install path prefix." FORCE) ENDIF() # C compiler is gcc on Linux, gcc or cc on Mac where command line tools