c++ quickstart: zlib installation ignores CMAKE_INSTALL_PREFIX?
- Dominant language
- HTML
- Stars
- 479
- Forks
- 545
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 5
Description
When installing gRPC with "install from submodules" option here:
https://github.com/grpc/grpc.io/blame/810f55bec86dcf8c726e890ecbc315368ca18575/content/docs/languages/cpp/quickstart.md#L104
What I've done is this:
```
cmake -DCMAKE_INSTALL_PREFIX=$HOME/grpc_install -DgRPC_INSTALL=ON ../..
make -j
make install
```
Build worked normally, but it seems that when installing dependencies from submodules,
zlib is ignoring the CMAKE_INSTALL_PREFIX (it tries to install under /usr/local/lib) - at least on linux.
```
CMake Error at third_party/zlib/cmake_install.cmake:60 (file):
file INSTALL cannot copy file
"/usr/local/google/home/jtattermusch/github/grpc/cmake/build/third_party/zlib/libz.so.1.2.11"
to "/usr/local/lib/libz.so.1.2.11": Permission denied.
Call Stack (most recent call first):
cmake_install.cmake:2356 (include)
```
So it looks like the quickstart instructions don't always work?
because most linux distros have zlib-dev package available, I was able to fix the problem by setting -DgRPC_ZLIB_PROVIDER=package (= don't install zlib from submodule, but look for the system-installed zlib).
@chalin I'm surprised the instructions worked for you. How did you test?
Contributor guide
Assessment
This issue has not been assessed yet.