-
Notifications
You must be signed in to change notification settings - Fork 2.9k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
MacOS homebrew installer - request for update with support for pybullet #1107
Comments
Simply use pip install pybullet.
That works on Mac, Windows and Linux and doesn't need cmake nor Bullet to
be installed.
…On Tuesday, 9 May 2017, Andrew Hundt ***@***.***> wrote:
I'm trying to update the Homebrew/homebrew-core
<https://github.com/Homebrew/homebrew-core> repository with this new
bullet.rb
<https://github.com/ahundt/homebrew-core/blob/bullet/Formula/bullet.rb>
install script, which is modified to support pybullet with these changes
<ahundt/homebrew-core@fd91540>
in a ahundt/homebrew-core bullet branch
<https://github.com/ahundt/homebrew-core/tree/bullet>, but there appears
to be bugs in bullet's own CMake script for setting Python and NumPy
variables on OSX, triggering CMake build error and selecting the incorrect
python library version.
I attempt to install with the following command:
brew uninstall bullet --ignore-dependencies; brew install bullet --with-demo --with-double-precision --with-framework -v
The formula (aka ruby install script) repository should be in the
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula folder if
brew is installed.
My updated version of the script generates this cmake command:
cmake
..
-DCMAKE_C_FLAGS_RELEASE=-DNDEBUG
-DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/bullet/2.86.1_1
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_FIND_FRAMEWORK=LAST
-DCMAKE_VERBOSE_MAKEFILE=ON
-Wno-dev
-DHAVE_CLOCK_GETTIME:INTERNAL=0
-DINSTALL_EXTRA_LIBS=ON
-DBUILD_UNIT_TESTS=OFF
-DUSE_DOUBLE_PRECISION=ON
-DBUILD_BULLET2_DEMOS=ON
-DBUILD_PYBULLET_MAC_USE_PYTHON_FRAMEWORK=ON
-DBUILD_PYBULLET=ON
-DBUILD_PYBULLET_NUMPY=ON
-DBUILD_PYBULLET_CLSOCKET=ON
-DBUILD_PYBULLET_ENET=ON
-DPYTHON_EXECUTABLE=/usr/local/opt/python/bin/python
-DPYTHON_LIBRARIES=/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
-DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7
-DPYTHON_NUMPY_INCLUDE_DIR=/usr/local/lib/python2.7/site-packages/numpy/core/include
-DBUILD_ENET=ON
-DBUILD_CLSOCKET=ON
-DBUILD_SHARED_LIBS=ON
-DFRAMEWORK=ON
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/bullet/2.86.1_1/Frameworks
-DCMAKE_INSTALL_NAME_DIR=/usr/local/Cellar/bullet/2.86.1_1/Frameworks
The command above produces the linker error below. This is most likely due
to the attempt at linking python 3 with /usr/local/Frameworks/Python.
framework/Versions/3.6/lib/libpython3.6m.dylib despite python 2 being
specified:
[ 80%] Linking CXX shared library pybullet.dylib
cd /Users/athundt/source/bullet3/build_cmake/examples/pybullet && /usr/local/Cellar/cmake/3.8.1/bin/cmake -E cmake_link_script CMakeFiles/pybullet.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DNDEBUG -dynamiclib -Wl,-headerpad_max_install_names -compatibility_version 2.87.0 -current_version 2.87.0 -o pybullet.2.87.dylib -install_name /Users/athundt/source/bullet3/build_cmake/examples/pybullet/pybullet.2.87.dylib CMakeFiles/pybullet.dir/pybullet.c.o CMakeFiles/pybullet.dir/__/SharedMemory/IKTrajectoryHelper.cpp.o CMakeFiles/pybullet.dir/__/ExampleBrowser/InProcessExampleBrowser.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/TinyRendererVisualShapeConverter.cpp.o CMakeFiles/pybullet.dir/__/OpenGLWindow/SimpleCamera.cpp.o CMakeFiles/pybullet.dir/__/TinyRenderer/geometry.cpp.o CMakeFiles/pybullet.dir/__/TinyRenderer/model.cpp.o CMakeFiles/pybullet.dir/__/TinyRenderer/tgaimage.cpp.o CMakeFiles/pybullet.dir/__/TinyRenderer/our_gl.cpp.o CMakeFiles/pybullet.dir/__/TinyRenderer/TinyRenderer.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/InProcessMemory.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/PhysicsClient.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/PhysicsServer.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/PhysicsServerExample.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/SharedMemoryInProcessPhysicsC_API.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/PhysicsServerSharedMemory.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/PhysicsDirect.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/PhysicsDirectC_API.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/PhysicsServerCommandProcessor.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/PhysicsClientSharedMemory.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/PhysicsClientSharedMemory_C_API.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/PhysicsClientC_API.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/Win32SharedMemory.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/PosixSharedMemory.cpp.o CMakeFiles/pybullet.dir/__/Utils/b3ResourcePath.cpp.o CMakeFiles/pybullet.dir/__/Utils/RobotLoggingUtil.cpp.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/tinyxml/tinystr.cpp.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/tinyxml/tinyxml.cpp.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/tinyxml/tinyxmlerror.cpp.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/tinyxml/tinyxmlparser.cpp.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/Wavefront/tiny_obj_loader.cpp.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/stb_image/stb_image.cpp.o CMakeFiles/pybullet.dir/__/Importers/ImportColladaDemo/LoadMeshFromCollada.cpp.o CMakeFiles/pybullet.dir/__/Importers/ImportObjDemo/LoadMeshFromObj.cpp.o CMakeFiles/pybullet.dir/__/Importers/ImportObjDemo/Wavefront2GLInstanceGraphicsShape.cpp.o CMakeFiles/pybullet.dir/__/Importers/ImportMJCFDemo/BulletMJCFImporter.cpp.o CMakeFiles/pybullet.dir/__/Importers/ImportURDFDemo/BulletUrdfImporter.cpp.o CMakeFiles/pybullet.dir/__/Importers/ImportURDFDemo/MyMultiBodyCreator.cpp.o CMakeFiles/pybullet.dir/__/Importers/ImportURDFDemo/URDF2Bullet.cpp.o CMakeFiles/pybullet.dir/__/Importers/ImportURDFDemo/UrdfParser.cpp.o CMakeFiles/pybullet.dir/__/Importers/ImportURDFDemo/urdfStringSplit.cpp.o CMakeFiles/pybullet.dir/__/Importers/ImportMeshUtility/b3ImportMeshUtility.cpp.o CMakeFiles/pybullet.dir/__/MultiThreading/b3PosixThreadSupport.cpp.o CMakeFiles/pybullet.dir/__/MultiThreading/b3Win32ThreadSupport.cpp.o CMakeFiles/pybullet.dir/__/MultiThreading/b3ThreadSupportInterface.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/PhysicsClientUDP.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/PhysicsClientUDP_C_API.cpp.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/enet/win32.c.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/enet/unix.c.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/enet/callbacks.c.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/enet/compress.c.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/enet/host.c.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/enet/list.c.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/enet/packet.c.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/enet/peer.c.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/enet/protocol.c.o CMakeFiles/pybullet.dir/__/SharedMemory/PhysicsClientTCP.cpp.o CMakeFiles/pybullet.dir/__/SharedMemory/PhysicsClientTCP_C_API.cpp.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/clsocket/src/SimpleSocket.cpp.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/clsocket/src/ActiveSocket.cpp.o CMakeFiles/pybullet.dir/__/ThirdPartyLibs/clsocket/src/PassiveSocket.cpp.o ../ExampleBrowser/libBulletExampleBrowserLib.2.87.dylib ../../Extras/Serialize/BulletWorldImporter/libBulletWorldImporter.2.87.dylib ../../src/BulletSoftBody/libBulletSoftBody.2.87.dylib ../../Extras/InverseDynamics/libBulletInverseDynamicsUtils.2.87.dylib ../../src/BulletInverseDynamics/libBulletInverseDynamics.2.87.dylib ../OpenGLWindow/libOpenGLWindow.dylib ../ThirdPartyLibs/Gwen/libgwen.dylib ../ThirdPartyLibs/BussIK/libBussIK.dylib ../../src/Bullet3Common/libBullet3Common.2.87.dylib /usr/local/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib -framework Cocoa -framework OpenGL ../../Extras/Serialize/BulletFileLoader/libBulletFileLoader.2.87.dylib ../../src/BulletDynamics/libBulletDynamics.2.87.dylib ../../src/BulletCollision/libBulletCollision.2.87.dylib ../../src/LinearMath/libLinearMath.2.87.dylib
Undefined symbols for architecture x86_64:
"_PyCObject_AsVoidPtr", referenced from:
__import_array in pybullet.c.o
"_PyCObject_Type", referenced from:
__import_array in pybullet.c.o
"_PyInt_FromLong", referenced from:
_pybullet_connectPhysicsServer in pybullet.c.o
_pybullet_loadSDF in pybullet.c.o
_pybullet_loadBullet in pybullet.c.o
_pybullet_loadMJCF in pybullet.c.o
_pybullet_getNumBodies in pybullet.c.o
_pybullet_getBodyUniqueId in pybullet.c.o
_pybullet_getNumConstraints in pybullet.c.o
...
"_PyString_FromString", referenced from:
_pybullet_getBodyInfo in pybullet.c.o
_pybullet_getJointInfo in pybullet.c.o
_pybullet_getVisualShapeData in pybullet.c.o
"_Py_InitModule4_64", referenced from:
_initpybullet in pybullet.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [examples/pybullet/pybullet.2.87.dylib] Error 1
make[1]: *** [examples/pybullet/CMakeFiles/pybullet.dir/all] Error 2
make: *** [all] Error 2
#1106 <#1106> is also a
related issue.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1107>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAsR3KJ6Uw2ZsTrVgLXQEFe8DcIt_lo_ks5r4BaZgaJpZM4NU7R4>
.
|
As mentioned in #1106 I use ROS and TensorFlow, which means using both the C/C++ & Python APIs, and I was hoping to use a single installation for integrating both. Wouldn't that be best handled via the CMake install process? |
Isn't the python 2 on Mac OSX just 32bit? Your cmake seems to compiles in 64bit mode. Could that be the cause of the linker errors? |
It is the 64 bit python installed by homebrew:
If I remove the manually specified python include/lib paths the cmake find script does appear to mix and match finding python2 and python3 headers/libraries. For that item, perhaps incorporating a more robust cmake implementation that finds python could be the way to go? |
Well, I think pip install pybullet is the way to go. Perhaps it is better to remove cmake support to build pybullet, since even if you build pybullet, you still have to make sure python finds the module. That is exactly what pip does. You can also run python setup.py install in the root of Bullet. I wouldn't waste time trying to get cmake building pybullet. |
If you run the script ./build_cmake_pybullet_double.sh you should get pybullet build. |
Okay pip is working well enough, I'll close this. Thanks! |
Well, I'm still curious why ./build_cmake_pybullet_double.sh fails for you. |
Sure here is the output, I deleted the First run cmake output (detects incorrect python):
second run output, linking failed:
|
Okay I've started narrowing this down. I believe the problem is due to bugs in the python find scripts. For instance with default settings from the pybullet cmake shell script I get the following error:
I added
However, I'm running python 2.7 as installed by homebrew.
So, essentially the CMake find script has some bugs, I'll see if I can find a replacement version and put it in. |
Thanks for looking into this, it would be good to have this working. |
A specific python version can now be selected by setting PYTHON_VERSION_PANGOLIN. The python library version must now match the interpreter version exactly. If all required python dependencies are found, pangolin python utilities are now enabled by default. Changes incorporate the following BSD licensed cmake code: https://github.com/BVLC/caffe/blob/32bf5c7ad804ad683aa5ea9382209e9284451e5f/CMakeScripts/FindNumPy.cmake https://github.com/NikolausDemmel/CMake/pull/2/files https://github.com/Kitware/CMake/blob/86578eccf2e82286248796bad1032cd0e3a5e1e2/Modules/SelectLibraryConfigurations.cmake Based on my pull request for the same python cmake issues in pybullet: bulletphysics/bullet3#1131 bulletphysics/bullet3#1107
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I'm trying to update the Homebrew/homebrew-core repository with this new bullet.rb install script, which is modified to support pybullet with these changes in a ahundt/homebrew-core bullet branch, but there appears to be bugs in bullet's own CMake script for setting Python and NumPy variables on OSX, triggering CMake build error and selecting the incorrect python library version.
I attempt to install with the following command:
The formula (aka ruby install script) repository should be in the
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
folder if homebrew is installed.My updated version of the script generates this cmake command:
The command above produces the linker error below. This is most likely due to the attempt at linking python 3 with
/usr/local/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib
despite python 2 being specified:#1106 is also a related issue.
The text was updated successfully, but these errors were encountered: