I am having a hard time running the demo problems using Xcode. I am able to compile and run the examples through the command line (i.e. make all, then ./ExamplePendulum from the terminal),
but I can't seem to get the same program to run using Xcode. I am able to build a project when I include the appropriate .dylib files, however when I run, I get this:
dyld: Library not loaded: libSimTKAtlas_Mac_Intel.dylib
Referenced from: /Users/aSampleUser/ExamplePendulum3/build/Debug/ExamplePendulum3
Reason: image not found
However, I can't seem to find libSimTKAtlas_Mac_Intel.dylib anywhere. Any help would be much appreciated.
using SimTK with XCode (Mac)
- Peter Eastman
- Posts: 2593
- Joined: Thu Aug 09, 2007 1:25 pm
RE: using SimTK with XCode (Mac)
Hi David,
If you can run successfully from the command line but not from Xcode, that probably means it isn't setting the library path correctly. That's the DYLD_LIBRARY_PATH environment variable, which you presumably are setting on the command line since you're able to run successfully? I haven't used Xcode much, but I assume it has a way to specify environment variables when launching programs.
The actual name of the library might be different from what you're seeing. It checks for several different names, so it might be called libSimTKAtlas_Mac_Intel.dylib, libSimTKAtlas.dylib, or possibly some other variations on that.
Peter
If you can run successfully from the command line but not from Xcode, that probably means it isn't setting the library path correctly. That's the DYLD_LIBRARY_PATH environment variable, which you presumably are setting on the command line since you're able to run successfully? I haven't used Xcode much, but I assume it has a way to specify environment variables when launching programs.
The actual name of the library might be different from what you're seeing. It checks for several different names, so it might be called libSimTKAtlas_Mac_Intel.dylib, libSimTKAtlas.dylib, or possibly some other variations on that.
Peter
- David Wagner
- Posts: 10
- Joined: Thu Sep 06, 2007 7:30 am
RE: using SimTK with XCode (Mac)
Hi Peter,
You are right. I am setting the DYLD_LIBRARY_PATH when I run from the command line. I am trying to find a way to get xcode understand the same path. I will keep testing and let you know if I come up with anything...
You are right. I am setting the DYLD_LIBRARY_PATH when I run from the command line. I am trying to find a way to get xcode understand the same path. I will keep testing and let you know if I come up with anything...
- David Wagner
- Posts: 10
- Joined: Thu Sep 06, 2007 7:30 am
RE: using SimTK with XCode (Mac)
Another thought, maybe it will spark some ideas...
When I don't run the command
export DYLD_LIBRARY_PATH=/Developer/SimTK/core/lib
in the terminal before I run the ExamplePendulum program, I get the following error:
dyld: Library not loaded: libSimTKmolmodel.dylib
which is very similar to my error from XCode of:
dyld: Library not loaded: libSimTKAtlas_Mac_Intel.dylib
Do you think they are different for any particular reason?
Thanks,
David
When I don't run the command
export DYLD_LIBRARY_PATH=/Developer/SimTK/core/lib
in the terminal before I run the ExamplePendulum program, I get the following error:
dyld: Library not loaded: libSimTKmolmodel.dylib
which is very similar to my error from XCode of:
dyld: Library not loaded: libSimTKAtlas_Mac_Intel.dylib
Do you think they are different for any particular reason?
Thanks,
David
- David Wagner
- Posts: 10
- Joined: Thu Sep 06, 2007 7:30 am
RE: using SimTK with XCode (Mac)
Ok, I have things working now. Here was the problem (not exactly sure what this means though...).
When I included the libraries from SimTK into the Xcode project, I included all the dynamic libraries (anything with an extension .dylib in the /Developer/SimTK/core/lib folder). This was causing the problem listed above. When I removed the file "libSimTKAtlas.dylib" everything worked. I looked back into the make file for the examples and saw that this dynamic library isn't even used, so I guess I am not missing much (or probably shouldn't have even included it!!)
But this does seem odd that when I include libSimTKAtlas.dylib, everything compiles, but the program actually looks for the dynamic library "libSimTKAtlas_MAC_INTEL.dylib"
Hopefully I will never have to use libSimTKAtlas (I am a fairly new user and don't know what this library is used for).
Hope this helps someone besides me.
When I included the libraries from SimTK into the Xcode project, I included all the dynamic libraries (anything with an extension .dylib in the /Developer/SimTK/core/lib folder). This was causing the problem listed above. When I removed the file "libSimTKAtlas.dylib" everything worked. I looked back into the make file for the examples and saw that this dynamic library isn't even used, so I guess I am not missing much (or probably shouldn't have even included it!!)
But this does seem odd that when I include libSimTKAtlas.dylib, everything compiles, but the program actually looks for the dynamic library "libSimTKAtlas_MAC_INTEL.dylib"
Hopefully I will never have to use libSimTKAtlas (I am a fairly new user and don't know what this library is used for).
Hope this helps someone besides me.
- Peter Eastman
- Posts: 2593
- Joined: Thu Aug 09, 2007 1:25 pm
RE: using SimTK with XCode (Mac)
You actually are using it - you just don't realize it! One of the libraries you link to directly is libSimTKlapack.dylib. When that library is loaded, it searches for and attempts to dynamically load libSimTKAtlas.dylib. So if you call any Lapack routines, or use any SimTK features that use Lapack, you're using Atlas. It's just that the linking is done dynamically.
Peter
Peter