Mac OS X install error: No available formula for gtest
Hi Everybody!
I am trying to install ROS Electric on OS X Lion. I follow this tutorial but when I execute the command
rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=electric&variant=desktop-full&overlay=no"
I get the following error:
...
Bootstrapping ROS build
Detected ros_comm bootstrapping it too.
Using environment variable ROS_OS_OVERRIDE name = osxbrew version = lion
[ rosmake ] Packages requested are: ['ros', 'ros_comm']
[ rosmake ] Logging to directory/Users/martin_peris/.ros/rosmake/rosmake_output-20120827-171936
[ rosmake ] Expanded args ['ros', 'ros_comm'] to:
['rosunit', 'rospack', 'rosmake', 'rosemacs', 'rosdep', 'roscreate', 'rosclean', 'rosboost_cfg', 'rosbash', 'test_rospack', 'test_rosmake', 'test_roslib', 'test_rosdep', 'test_roscreate', 'roslib', 'roslang', 'rosbuild', 'mk', 'xmlrpcpp', 'roswtf', 'rostime', 'message_filters', 'cpp_common', 'topic_tools', 'rostopic', 'rostest', 'rosservice', 'rosparam', 'rosout', 'rosnode', 'rosmsg', 'rosmaster', 'roslaunch', 'rosgraph', 'rosconsole', 'rosbagmigration', 'rosbag', 'test_topic_tools', 'test_roswtf', 'test_rostopic', 'test_rostime', 'test_rostest', 'test_rosservice', 'test_rospy', 'test_rosparam', 'test_rosnode', 'test_rosmsg', 'test_rosmaster', 'test_roslib_comm', 'test_roslaunch', 'test_rosgraph', 'test_roscpp_serialization_perf', 'test_roscpp_serialization', 'test_roscpp', 'test_rosbag', 'test_ros', 'test_crosspackage', 'perf_roscpp', 'roscore_migration_rules', 'std_srvs', 'std_msgs', 'rosgraph_msgs', 'rospy', 'roslisp', 'roscpp_traits', 'roscpp_serialization', 'roscpp']
[ rosmake ] Generating Install Script using rosdep then executing. This may take a minute, you will be prompted for permissions. . .
Using environment variable ROS_OS_OVERRIDE name = osxbrew version = lion
Executing script below with cwd=/var/folders/yz/rvk6x5qs5vd2h4bfp83xwm3r0000gn/T
{{{
#!/bin/bash
#Packages ['gtest']
brew install gtest --universal
}}}
Error: No available formula for gtest
Failed to install gtest!
[ rosmake ] rosdep install failed: Rosdep install failed
Traceback (most recent call last):
File "/usr/local/bin/rosinstall", line 16, in <module>
sys.exit(not rosinstall_main(sys.argv))
File "/Library/Python/2.7/site-packages/rosinstall/rosinstall_cli.py", line 228, in rosinstall_main
options.catkinpp)
File "/Library/Python/2.7/site-packages/rosinstall/rosinstall_cmd.py", line 100, in cmd_generate_ros_files
subprocess.check_call("source %s && rosmake ros%s --rosdep-install%s" % (os.path.join(path, 'setup.sh'), ros_comm_insert, rosdep_yes_insert), shell=True, executable='/bin/bash')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 504, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'source /Users/martin_peris/ros/setup.sh && rosmake ros ros_comm --rosdep-install' returned non-zero exit status 1
Martin-iMac:~ martin_peris$ brew install gtest --universal
Error: No available formula for gtest
I have been researching a bit and it seems like gtest formula has been removed from hombrew. Any Ideas? workarounds? suggestions?
UPDATE
As long as I can not answer my own questions, I post a (suboptimal) solution to my problem. I created manually the file /usr/local/Library/Formula/gtest.rb with the contents:
require 'formula'
class Gtest < Formula
url 'http://googletest.googlecode.com/files/gtest-1.5.0.tar.gz'
homepage 'http://code.google.com/p/googletest/'
md5 '7e27f5f3b79dd1ce9092e159cdbd0635'
def options
[
["--universal", "Build for both 32 & 64 bit Intel."],
]
end
def install
ENV.universal_binary if ARGV.build_universal?
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
# gtest-config tries to be clever in locating libraries, but Homebrew's
# Cellar confuses it. This lets `gtest-config --libs` work correctly
inreplace 'scripts/gtest-config', '`dirname $0`', '$bindir'
system "make install"
end
end
I have no longer problems with gtest, but now the installation fails for another reason. I guess I should start a new question for that.
Thanks!!
The above formula as it is, gave some errors relating to md5 being not supported anymore. Replacing md5 with sha256 and updating the key number in front to match that for the current file, allowed brew to download the files, but eventually gave gtest compile errors relating to TR1_TUPLE
I got rid of the TR1_TUPLE error using system "./configure CPPFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1”,... in the formula above. However the build for test still fails and but now it does not give any details on what the error is.