5

I am trying to follow these directions to install Google Protocol Buffers. After creating the script, I try to run it with the following command:

$ ./build-proto-ios.sh

I receive the following output:

mkdir: ios-build: File exists
Platform is iPhoneSimulator
./build-proto-ios.sh: line 40: ./configure: No such file or directory
make: error: unable to find utility "make", not a developer tool or in PATH
make: error: unable to find utility "make", not a developer tool or in PATH
cp: src/.libs/libprotobuf-lite.a: No such file or directory
Platform is iPhoneOS
./build-proto-ios.sh: line 40: ./configure: No such file or directory
make: error: unable to find utility "make", not a developer tool or in PATH
make: error: unable to find utility "make", not a developer tool or in PATH
cp: src/.libs/libprotobuf-lite.a: No such file or directory
Platform is iPhoneOS
./build-proto-ios.sh: line 40: ./configure: No such file or directory
make: error: unable to find utility "make", not a developer tool or in PATH
make: error: unable to find utility "make", not a developer tool or in PATH
cp: src/.libs/libprotobuf-lite.a: No such file or directory
make: error: unable to find utility "make", not a developer tool or in PATH
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: ios-build/libprotobuf-lite-armv7.a (No such file or directory)

So, I looked for information on:

unable to find utility "make", not a developer tool or in PATH

I found this information for installing the Xcode command line tools, because I thought that might be the cause. But even after installing the latest command line tools for OS X Mavericks, I'm still getting this error.

Any ideas?

Community
  • 1
  • 1
Patricia
  • 5,019
  • 14
  • 72
  • 152
  • 1
    At your shell prompt, try `which make` – David Berry May 23 '14 at 18:41
  • Tried both of those. It's in the PATH – Patricia May 23 '14 at 18:57
  • 1
    `/usr/bin/make` is just a forwarder that forwards to the make at the path in quellish's answer. Make sure that you have access to that path. Try his `xcrun make` and see what that produces, I'm guessing it won't work, but maybe :) The error message that you're seeing is when the forwarder can't find an appropriate real binary to use. – David Berry May 23 '14 at 19:00

4 Answers4

5

1) xcode-select -p -> /Applications/Xcode.app/Contents/Developer

2) sudo xcode-select --switch /Library/Developer/CommandLineTools

3) xcode-select -p -> /Library/Developer/CommandLineTools

4) eval "$(rbenv init -)"

5) rbenv install 2.5.3

6) rbenv local 2.5.3

Also, see that xcode is properly updated

Jabbi Syed
  • 161
  • 2
  • 3
1

Make is included with Xcode. You do not need to install the command line tools to use it. It lives inside the Xcode application:

/Applications/Xcode.app/Contents/Developer/usr/bin/make

And can be accessed using xcrun.

xcrun make

This can still fail if for some reason the active developer directory is not set, or is incorrect. This can happen if you have moved Xcode, for instance.

Set it using xcode-select

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

Check to see that you can access make using those methods from a command line session. If you can, the proto buffers build scripts are likely the problem.

quellish
  • 21,123
  • 4
  • 76
  • 83
1

Looks like that's not your actual problem. When the script is running, it's looking for the included make in the iOS 6 folder... which probably doesn't exist.

Check out https://gist.github.com/PR3x/0fde040902ed4e9a1a61 for a script that will build protobuf as a fat library for you. Just place it in a new folder, chmod +x, and run. (Based on https://stackoverflow.com/a/19582682/939927)

One thing to note is that you'll need to change all of your generated .pb.* files to use the ::google_public: namespace instead of ::google:, as Apple uses that internally.

Another thing to note is that this only works for 32-bit ARM and the simulator. 64-bit ARM (iPhone 5s) doesn't build yet.

Good luck!

Community
  • 1
  • 1
PR3x
  • 111
  • 5
  • For future people finding this answer: in the script on lines `17` and `20`, change the SDK to whatever/whichever you're using. – PR3x May 23 '14 at 22:00
0

For me, it was because of the wrong path of SDKROOT. This solution worked for me.

xport SDKROOT=$(xcrun -sdk macosx --show-sdk-path