Juniper / grpc-c

C implementation of gRPC layered on top of core library
BSD 3-Clause "New" or "Revised" License
220 stars 59 forks source link

No rule to make target '/usr/local/lib/libprotobuf.a' #16

Open brianLeeson opened 7 years ago

brianLeeson commented 7 years ago

Following build instructions for grpc-c.

autoreconf --install
git submodule update --init
mkdir build && cd build
../configure
make
sudo make `install`

../configure runs and completes make fails:

g++ -DHAVE_CONFIG_H -I. -I../../compiler -I..    -I../../compiler -I../../compiler/../third_party/protobuf-c -I../../compiler/../third_party/protobuf-c/protobuf-c -g -O2 -MT main.o -MD -MP -MF $depbase.Tpo -c -o main.o ../../compiler/main.cc &&\
mv -f $depbase.Tpo $depbase.Po
make[2]: *** No rule to make target '/usr/local/lib/libprotobuf.a', needed by 'protoc-gen-grpc-c'.  Stop.
make[2]: Leaving directory '/home/grpc-c/build/compiler'
Makefile:464: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/grpc-c/build'
Makefile:375: recipe for target 'all' failed
make: *** [all] Error 2

I believe that I have the correct versions of the dependencies installed. What could be causing this error? Why wouldn't the MAKEFILE have a required rule? Any help would be appreciated.

I doubt it is related, but after running autoreconf --install I get : aclocal: warning: couldn't open directory 'm4': No such file or directory and then it continues on as normal.

mattrichards commented 7 years ago

@brianLeeson From playing around with this project, it seems that the build system assumes Protobuf was installed with its prefix as /usr/local. So, if you installed Protobuf under /usr or somewhere under /opt, you'll get this error.

I edited compiler/Makefile.am to fix the path to where libprotobuf.a was installed on my system to work around this in the short term. Probably there is some way to use pkg-config to have the correct path determined from the system configuration.