disable remove rpath from third party protoc #10939
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题分析
在厂内环境编译paddle的时候,需要用gcc482,third_part protoc也是用gcc482编译的,链接的是gcc482的高版本的glibc,但是cmake在install protoc到third_part/install/protobuf/bin下的时候,把protoc中的rpath给删掉了,
删除rpath之前:
![image](https://user-images.githubusercontent.com/3048612/40544876-4c3aa91a-605c-11e8-9beb-38381db21c80.png)
删除之后:
![image](https://user-images.githubusercontent.com/3048612/40544913-6b374044-605c-11e8-9543-b153012fe7fd.png)
这时候执行protoc会寻找系统默认路径下的glibc,版本太低就会报错:
![image](https://user-images.githubusercontent.com/3048612/40544836-25afd28e-605c-11e8-8871-6b170e318ba3.png)
解决方案
这个PR是禁止cmake install的时候删除rpath。