propeller_optimize_clang.sh NOT working on CentOS Stream release 9 (Fedora)
- Dominant language
- C++
- Stars
- 619
- Forks
- 127
- PR merge metrics
- No merged PRs in 30d
Description
I tried to build propeller on CentOS Stream release 9 with the following command
```
propeller_optimize_clang.sh
```
(the directory propeller_optimize_clang.dir has been created before running the above command).
I got the following the error message:
```
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Protobuf (missing: Protobuf_LIBRARIES) (found version
"3.14.0")
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake/Modules/FindProtobuf.cmake:650 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:10 (find_package)
CMakeLists.txt:841 (execute_perf_protobuf)
```
Fixing the above, I got some errors. Eventually I made it work with the following change:
```
diff --git a/propeller_optimize_clang.sh b/propeller_optimize_clang.sh
index 23e6d05..6f5b584 100755
--- a/propeller_optimize_clang.sh
+++ b/propeller_optimize_clang.sh
@@ -43,8 +43,11 @@ PATH_TO_CREATE_LLVM_PROF=${BASE_PROPELLER_CLANG_DIR}/create_llvm_prof_build
mkdir -p ${PATH_TO_CREATE_LLVM_PROF} && cd ${PATH_TO_CREATE_LLVM_PROF}
git clone --recursive git@github.com:google/autofdo.git
+cd autofdo && git apply /home/yhs/0001-debug.patch && cd ..
mkdir build && cd build
cmake -G Ninja -DCMAKE_INSTALL_PREFIX="." \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLVM_ENABLE_LIBCXX=ON \
-DCMAKE_C_COMPILER="${PATH_TO_TRUNK_LLVM_INSTALL}/bin/clang" \
-DCMAKE_CXX_COMPILER="${PATH_TO_TRUNK_LLVM_INSTALL}/bin/clang++" \
-DLLVM_PATH="${PATH_TO_TRUNK_LLVM_INSTALL}" ../autofdo/
```
and /home/yhs/0001-debug.patch is
```
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b300f00..f418d86 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,7 @@ set(CMAKE_CXX_STANDARD 17)
set(ABSL_PROPAGATE_CXX_STD on)
project(autofdo)
-set (Protobuf_USE_STATIC_LIBS TRUE)
+# set (Protobuf_USE_STATIC_LIBS TRUE)
function (execute_perf_protobuf)
@@ -846,10 +846,10 @@ elseif (${enable_tool} STREQUAL llvm)
message(STATUS "Building tool \"LLVM\" ...")
# Build static binaries.
- set (BUILD_SHARED_LIBS OFF)
- set (CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+ # set (BUILD_SHARED_LIBS OFF)
+ # set (CMAKE_FIND_LIBRARY_SUFFIXES ".a")
# Link static executables.
- set (CMAKE_EXE_LINKER_FLAGS "-static")
+ # set (CMAKE_EXE_LINKER_FLAGS "-static")
build_llvm()
else ()
```
Basically I need to disable static linking and add a couple of options for llvm build.
I also need to add some packages to make it work.
It would be good if we have clear instructions in README file about fedora/centos system.
Contributor guide
Assessment
This issue has not been assessed yet.