DKU-StarLab / leveldb-study

LevelDB Analysis, Backgrounds, Practice and Tuning
https://sslab.dankook.ac.kr/leveldb-wiki/
35 stars 15 forks source link

Question) leveldb Installation error at mac os #7

Closed ha-seungwon closed 2 years ago

ha-seungwon commented 2 years ago

base) haseung-won@haseung-won-ui-MacBookAir build % cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build .

-- git Version: v1.5.3-7d0d9061

-- Version: 1.5.3

-- Performing Test HAVE_THREAD_SAFETY_ATTRIBUTES -- failed to compile

-- Performing Test HAVE_STD_REGEX -- success

-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile

-- Performing Test HAVE_POSIX_REGEX -- success

-- Performing Test HAVE_STEADY_CLOCK -- success

-- Configuring done

-- Generating done

-- Build files have been written to: /Users/haseung-won/leveldb_release/build

Consolidate compiler generated dependencies of target leveldb

[ 35%] Built target leveldb

Consolidate compiler generated dependencies of target leveldbutil

[ 37%] Built target leveldbutil

Consolidate compiler generated dependencies of target gtest

[ 39%] Built target gtest

Consolidate compiler generated dependencies of target gtest_main

[ 41%] Built target gtest_main

Consolidate compiler generated dependencies of target gmock

[ 43%] Built target gmock

Consolidate compiler generated dependencies of target leveldb_tests

[ 66%] Built target leveldb_tests

Consolidate compiler generated dependencies of target c_test

[ 68%] Built target c_test

Consolidate compiler generated dependencies of target env_posix_test

[ 70%] Built target env_posix_test

Consolidate compiler generated dependencies of target benchmark

[ 71%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/complexity.cc.o

/Users/haseung-won/leveldb_release/third_party/benchmark/src/complexity.cc:85:10

: error: variable 'sigma_gn' set but not used [-Werror,-Wunused-but-set-variable]

  double sigma_gn = 0.0;

         ^

1 error generated.

make[2]: *** [third_party/benchmark/src/CMakeFiles/benchmark.dir/complexity.cc.o] Error 1

make[1]: *** [third_party/benchmark/src/CMakeFiles/benchmark.dir/all] Error 2

make: *** [all] Error 2 

밑 부분에서 시그마 변수 오류가 발생해서 문의 드립니다.

이틀동안 구글링하고 찾아보았는데 문제 해결을 하지 못해서 이렇게 질문 드립니다. 

현재 맥북에서 작업 환경을 구축하고 있는데 apt 명령어가 없어서 build essential 을 설치하지 못했습니다. 혹시 이게 문제가 될지 질문 드립니다. ( 구글링 당시에는 home brew 팩으로 해결이 가능하다고 그래서 넘어가긴 했습니당.)

​ 그리고 debug 모드에서는 정상적으로 설치가 되어서 성능 테스트 까지도 돌려봤는데 release 모드에서만 에러가 발생했습니다ㅠㅠㅠ

혹시 이 에러에 대하여 아시는게 있으시면 답변 부탁드립니다.  감사합니다.

seehwan commented 2 years ago

에러메시지를 읽어보면 사용되지 않는 변수인데 선언되었다고 나와있네요. 변수를 지워보시죠. ^^

2022년 7월 15일 (금) 오후 5:07, ha-seungwon @.***>님이 작성:

base) @.*** build % cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build .

-- git Version: v1.5.3-7d0d9061

-- Version: 1.5.3

-- Performing Test HAVE_THREAD_SAFETY_ATTRIBUTES -- failed to compile

-- Performing Test HAVE_STD_REGEX -- success

-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile

-- Performing Test HAVE_POSIX_REGEX -- success

-- Performing Test HAVE_STEADY_CLOCK -- success

-- Configuring done

-- Generating done

-- Build files have been written to: /Users/haseung-won/leveldb_release/build

Consolidate compiler generated dependencies of target leveldb

[ 35%] Built target leveldb

Consolidate compiler generated dependencies of target leveldbutil

[ 37%] Built target leveldbutil

Consolidate compiler generated dependencies of target gtest

[ 39%] Built target gtest

Consolidate compiler generated dependencies of target gtest_main

[ 41%] Built target gtest_main

Consolidate compiler generated dependencies of target gmock

[ 43%] Built target gmock

Consolidate compiler generated dependencies of target leveldb_tests

[ 66%] Built target leveldb_tests

Consolidate compiler generated dependencies of target c_test

[ 68%] Built target c_test

Consolidate compiler generated dependencies of target env_posix_test

[ 70%] Built target env_posix_test

Consolidate compiler generated dependencies of target benchmark

[ 71%] Building CXX object third_party/benchmark/src/CMakeFiles/benchmark.dir/complexity.cc.o

/Users/haseung-won/leveldb_release/third_party/benchmark/src/complexity.cc:85:10

: error: variable 'sigma_gn' set but not used [-Werror,-Wunused-but-set-variable]

double sigma_gn = 0.0;

     ^

1 error generated.

make[2]: *** [third_party/benchmark/src/CMakeFiles/benchmark.dir/complexity.cc.o] Error 1

make[1]: *** [third_party/benchmark/src/CMakeFiles/benchmark.dir/all] Error 2

make: *** [all] Error 2

밑 부분에서 시그마 변수 오류가 발생해서 문의 드립니다.

이틀동안 구글링하고 찾아보았는데 문제 해결을 하지 못해서 이렇게 질문 드립니다.

현재 맥북에서 작업 환경을 구축하고 있는데 apt 명령어가 없어서 build essential 을 설치하지 못했습니다. 혹시 이게 문제가 될지 질문 드립니다. ( 구글링 당시에는 home brew 팩으로 해결이 가능하다고 그래서 넘어가긴 했습니당.)

​ 그리고 debug 모드에서는 정상적으로 설치가 되어서 성능 테스트 까지도 돌려봤는데 release 모드에서만 에러가 발생했습니다ㅠㅠㅠ

혹시 이 에러에 대하여 아시는게 있으시면 답변 부탁드립니다. 감사합니다.

— Reply to this email directly, view it on GitHub https://github.com/DKU-StarLab/leveldb-study/issues/7, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXMDCMXBVVRPVFYTQG3ZQTVUEL2PANCNFSM53UYDT6Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--


Seehwan Yoo Ph. D.

Associate professor

Dept. of Mobile Systems Eng.

Dankook University,

South Korea 16890

Email: firstname DOT lastname AT DANKOOK DOT AC DOT KR

Tel: +82-31-8005-3240

min-guk commented 2 years ago

leveldb를 clone할 때 third_party는 --recurse-submodules로 가져오는데, 아마 환경이 달라서 문제가 생기는 것 같네요. release mode로 빌드를 하면, 에러를 허용하지 않도록 빡세게 gcc flag가 설정되어 있는 것 같습니다.

4가지 방법이 있을 것 같습니다.

  1. 유시환 교수님 말씀처럼 해당 변수를 제거하고 빌드한다.
  2. CMakelists.txt에서 gcc -Werror/-Wunused-but-set-variable flag를 제거하고 빌드한다.
  3. debug mode로 빌드하여 사용한다.
  4. 리눅스를 사용한다.
ha-seungwon commented 2 years ago

@seehwan @korea-choi 답변 감사드립니다!!!!😀

min-guk commented 2 years ago

맥북에서 release mode로 빌드가 안되시던 분들은 leveldb/third_party/benchmarks/CMakeLists.txt에서 werror flag 제거하시면 정상적으로 빌드 가능합니다.