problem building OpenSim from source

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Michael Sherman
Posts: 800
Joined: Fri Apr 01, 2005 6:05 pm

Re: problem building OpenSim from source

Post by Michael Sherman » Wed Dec 24, 2014 11:34 am

Congratulations, Kevin -- that looks like a good build!

I'm not sure about the testOptimizationExample failure. That has always been a touchy test case that has required some tweaking in different releases to get it to pass reliably. So I'm not as worried about it as I would be some of the other tests. I still don't understand why it failed in your build, but I'll let someone else comment on why that might be; it will be highly dependent on the particular source versions you used.

In the meanwhile I would consider this a usable build.

Regards,
Sherm

User avatar
Stephanie Hachem
Posts: 34
Joined: Wed Oct 26, 2016 12:40 pm

Re: problem building OpenSim from source

Post by Stephanie Hachem » Sun Jan 29, 2017 8:39 am

aymanh wrote:Hi Kevin,

Thanks for the update.

Let's focus on one issue (Debug) since that's what you actually need.
According to the build log first error, VS couldn't locate SimTKcommon_d (and later on all other SimTK debug libraries). The important questions are:
1. Were these files created in the install directory of Simbody ?
2. If yes, then you need to find out why OpenSim build couldn't locate them. Possible reasons: not rerunning CMake after Simbody install, different names of libs, or CMake finding wrong installation of Simbody.
3. If no, then you should go back to the Simbody build/install and find out why these .lib files were not generated.

Hope this helps,
-Ayman
Hello,

I appear to be having the same issue. I'm running Windows 10 on a 64 bit machine, using a non source installation of OpenSim 3.3. I've worked through the Creating a Customized Muscle Model tutorial with the MuscleExample folder using CMake 3.6.3 and Visual Studio Community in Release configuration and x64. However, trying to build the MuscleExample folder with Debug (I got Debug through changing the MuscleExample folder's 'CMakeLists.txt') gives me the following output:

1>------ Build started: Project: ZERO_CHECK, Configuration: Debug x64 ------
1> Checking Build System
1> CMake does not need to re-run because C:/OpenSim 3.3/sdk/APIExamples/MuscleExample/build_6/CMakeFiles/generate.stamp is up-to-date.
2>------ Build started: Project: MuscleExampleTargettt, Configuration: Debug x64 ------
2> Building Custom Rule C:/OpenSim 3.3/sdk/APIExamples/MuscleExample/CMakeLists.txt
2> CMake does not need to re-run because C:\OpenSim 3.3\sdk\APIExamples\MuscleExample\build_6\CMakeFiles\generate.stamp is up-to-date.
2> FatigableMuscle.cpp
2> mainFatigue.cpp
2> Generating Code...
2>LINK : fatal error LNK1104: cannot open file 'osimCommon_d.lib'
3>------ Build started: Project: ALL_BUILD, Configuration: Debug x64 ------
3> Building Custom Rule C:/OpenSim 3.3/sdk/APIExamples/MuscleExample/CMakeLists.txt
3> CMake does not need to re-run because C:\OpenSim 3.3\sdk\APIExamples\MuscleExample\build_6\CMakeFiles\generate.stamp is up-to-date.
========== Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

osimCommon_d.lib doesn't exist in neither my installation (not built from source) of OpenSim 3.3, nor in any of the versions (tags) as searchable on GitHub for OpenSim. (Which leads me to wonder: were _d.lib files removed in some version of OpenSim? I couldn't find mention of that happening in any of the documentation at [http://simtk-confluence.stanford.edu/] but I thought it might be worth mentioning/asking.) This LINK error for osimCommon_d.lib has also popped up when building other programs from Simtk meant for OpenSim 3.3, which are built smoothly in Release configuration but have such errors in Debug configuration. I have also reproduced this error (builds for Release, not for Debug) on another 64 bit computer running Windows 10, using CMake 3.6.3, Visual Studio Community 2015, and OpenSim 3.3 as the first computer did.

As suggested in the above quote, I could try Visual Studio 2013, but since this forum was a few years ago, I currently have Visual Studio Community 2015 running and am not sure if the older and newer softwares will conflict.

Another possible fix I've encountered online was in OpenSim's GitHub issues [https://github.com/opensim-org/opensim-core/issues/462], however the first solution suggested (the CMake 'hack' for the time being) required the OpenSim installation to have a top-level CMakeLists.txt, which OpenSim 3.3 doesn't appear to have. Moreover, the actual solution may have been found, but I'm not sure how it works or how to apply the solution to my situation, and I believe the fix is to be part of OpenSim 4.0, whereas the programs from Simtk I'm trying to use were programmed for OpenSim 3.3.

Any help would be greatly appreciated! :) It is a bit urgent.

Stephanie

User avatar
Thomas Uchida
Posts: 1773
Joined: Wed May 16, 2012 11:40 am

Re: problem building OpenSim from source

Post by Thomas Uchida » Sun Jan 29, 2017 5:10 pm

using a non source installation of OpenSim 3.3
Last time I checked, the "non-source installations" of OpenSim do not come with Debug libraries. If you need a Debug build, I think you will need to build it locally. You might try using one of the "tagged" releases here: https://github.com/opensim-org/opensim-core/tags. For some reason, there isn't a tag for v3.3; the source code for v3.3 can be found here: https://simtk.org/frs/?group_id=91 (under the "OpenSim Source Code" heading).

User avatar
Stephanie Hachem
Posts: 34
Joined: Wed Oct 26, 2016 12:40 pm

Re: problem building OpenSim from source

Post by Stephanie Hachem » Sat Feb 04, 2017 12:18 pm

Hello,

You're right, the non-source installation (if that's the right terminology for it) doesn't have the debug libraries. After reading your post, I tried to rebuild OpenSim 3.3 with Simbody 3.5.3 locally, and encountered no errors except at the last step, at which I'm supposed to check that the local build was added to my user's/system's PATH. Unfortunately, it wasn't. Do you have any ideas what could be causing this? I also have OpenSim 3.3, installed via the installer and confirmed to be working properly, on the same computer I built locally on, but I didn't think that would interfere with the local build.

Stephanie

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: problem building OpenSim from source

Post by Dimitar Stanev » Sat Feb 04, 2017 12:29 pm

You have to define two things.

A variable OpenSim_DIR and Simbody_DIR that must point to \cmake folder where you installed your libraries. That is for CMake to find the libraries automatically for you.

In addition you have to add the path to the dlls to PATH variable so that the system can find them at run time. Also if you are using different version of OpenSim, make sure to change the order of path variable so that it will not link the wrong dll. Sometimes I work in the opensim-core/master branch and I have the dll's path first in the list. Alternatively when I want to build with OpenSim3.3 then I change the order. You can use Rapid Environment Editor in Windows.
Untitled.png
Untitled.png (21.18 KiB) Viewed 485 times

User avatar
Stephanie Hachem
Posts: 34
Joined: Wed Oct 26, 2016 12:40 pm

Re: problem building OpenSim from source

Post by Stephanie Hachem » Mon Apr 10, 2017 12:37 pm

Hello,

Sorry for the very late reply, I didn't know I hadn't replied to this forum until stumbling upon it today. I believe I did get the local build of OpenSim to run, but am currently using the pre-built installation because it seems to work fine for the applications I need OpenSim for. Thanks for all the help!

Thanks again,
Stephanie

POST REPLY