kakao/khaiii

cmake .. 오류 질문드립니다.

Parking9 opened this issue · 10 comments

cc1plus: all warnings being treated as errors
make[5]: *** [googlemock/CMakeFiles/gmock.dir/build.make:96: googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o] Error 1
make[5]: *** Waiting for unfinished jobs....
cc1plus: all warnings being treated as errors
make[5]: *** [googlemock/CMakeFiles/gmock_main.dir/build.make:96: googlemock/CMakeFiles/gmock_main.dir/src/gmock-all.cc.o] Error 1
[ 63%] Linking CXX shared library libgtest.so
[ 63%] Built target gtest
make[4]: *** [CMakeFiles/Makefile2:165: googlemock/CMakeFiles/gmock.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs....
make[4]: *** [CMakeFiles/Makefile2:138: googlemock/CMakeFiles/gmock_main.dir/all] Error 2
Scanning dependencies of target gtest_main
[ 72%] Building CXX object googlemock/gtest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[ 81%] Linking CXX shared library libgtest_main.so
[ 81%] Built target gtest_main
make[3]: *** [Makefile:161: all] Error 2
make[2]: *** [CMakeFiles/GTest-Release.dir/build.make:136: GTest-Release-prefix/src/GTest-Release-stamp/GTest-Release-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:125: CMakeFiles/GTest-Release.dir/all] Error 2
make: *** [Makefile:104: all] Error 2

[hunter ** FATAL ERROR **] Build step failed (dir: /root/.hunter/_Base/70287b1/316dcfb/dffbc08/Build/GTest
[hunter ** FATAL ERROR **] [Directory:/root/.hunter/_Base/Download/Hunter/0.23.34/70287b1/Unpacked/cmake/projects/GTest]

------------------------------ WIKI -------------------------------
https://github.com/ruslo/hunter/wiki/error.external.build.failed

CMake Error at /root/.hunter/_Base/Download/Hunter/0.23.34/70287b1/Unpacked/cmake/modules/hunter_wiki.cmake:12 (message):
Call Stack (most recent call first):
/root/.hunter/_Base/Download/Hunter/0.23.34/70287b1/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_wiki)
/root/.hunter/_Base/Download/Hunter/0.23.34/70287b1/Unpacked/cmake/modules/hunter_download.cmake:613 (hunter_fatal_error)
/root/.hunter/_Base/Download/Hunter/0.23.34/70287b1/Unpacked/cmake/projects/GTest/hunter.cmake:244 (hunter_download)
/root/.hunter/_Base/Download/Hunter/0.23.34/70287b1/Unpacked/cmake/modules/hunter_add_package.cmake:62 (include)
CMakeLists.txt:63 (hunter_add_package)

-- Configuring incomplete, errors occurred!

이런 오류가 발생했는데 해결책 아시는 분 계신가요

khaiii는 cmake를 이용해서 빌드하고, hunter라는 패키지 매니저를 사용합니다.

보여주신 오류 메세지는 hunter에서 gtest (google test)를 설치하는 도중 에러가 발생한 것 같습니다. 오류가 난 원인은 없고 온통 "error", "failed"란 말 밖에 없어서 원인을 파악하기 힘드네요.

hunter는 홈 디렉터리에 ".hunter"라는 캐시 디렉터리를 만들고 여기에 패키지들을 다운로드 받고 빌드를 수행하는데요. 이 캐시 디렉터리(/root/.hunter)를 삭제하고 khaiii/build 디렉터리도 삭제하신 다음, 처음부터 다시 빌드해보시는 건 어떨까요?

조언해주신 대로 캐시 디렉터리를 삭제하고 build 디렉터리도 삭제하고 , 깃을 다시 클론 시키고 GTest를 따로 다운한 후 실행해 보았지만 아래와 같은 에러가 발생했습니다.. 위와 똑같은 에러 같구요 혹시 cmake 설치 과정에서 오류가 있는건가요?

cc1plus: all warnings being treated as errors
make[5]: *** [googlemock/CMakeFiles/gmock_main.dir/build.make:109: googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o] Error 1
make[5]: *** Waiting for unfinished jobs....
In file included from /root/.hunter/_Base/70287b1/316dcfb/dffbc08/Build/GTest/Source/googletest/include/gtest/internal/gtest-linked_ptr.h:74,
from /root/.hunter/_Base/70287b1/316dcfb/dffbc08/Build/GTest/Source/googlemock/include/gmock/internal/gmock-port.h:53,
from /root/.hunter/_Base/70287b1/316dcfb/dffbc08/Build/GTest/Source/googlemock/include/gmock/internal/gmock-generated-internal-utils.h:44,
from /root/.hunter/_Base/70287b1/316dcfb/dffbc08/Build/GTest/Source/googlemock/include/gmock/internal/gmock-internal-utils.h:45,
from /root/.hunter/_Base/70287b1/316dcfb/dffbc08/Build/GTest/Source/googlemock/include/gmock/gmock-actions.h:46,
from /root/.hunter/_Base/70287b1/316dcfb/dffbc08/Build/GTest/Source/googlemock/include/gmock/gmock.h:58,
from /root/.hunter/_Base/70287b1/316dcfb/dffbc08/Build/GTest/Source/googlemock/src/gmock-all.cc:40:
/root/.hunter/_Base/70287b1/316dcfb/dffbc08/Build/GTest/Source/googletest/include/gtest/internal/gtest-port.h:908:8: note: because ‘testing::internal::EndsWithMatcher<std::__cxx11::basic_string<wchar_t> >’ has user-provided ‘void testing::internal::EndsWithMatcher::operator=(const testing::internal::EndsWithMatcher&) [with StringType = std::_cxx11::basic_string<wchar_t>]’
908 | void operator=(type const &)
| ^~~~~~~~
/root/.hunter/Base/70287b1/316dcfb/dffbc08/Build/GTest/Source/googlemock/include/gmock/gmock-matchers.h:1320:3: note: in expansion of macro ‘GTEST_DISALLOW_ASSIGN
1320 | GTEST_DISALLOW_ASSIGN
(EndsWithMatcher);
| ^~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[5]: *** [googlemock/CMakeFiles/gmock.dir/build.make:96: googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o] Error 1make[5]: *** Waiting for unfinished jobs....
cc1plus: all warnings being treated as errors
make[5]: *** [googlemock/CMakeFiles/gmock_main.dir/build.make:96: googlemock/CMakeFiles/gmock_main.dir/src/gmock-all.cc.o] Error 1
[ 63%] Linking CXX shared library libgtest.so
[ 63%] Built target gtest
make[4]: *** [CMakeFiles/Makefile2:165: googlemock/CMakeFiles/gmock.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs....
Scanning dependencies of target gtest_main
[ 72%] Building CXX object googlemock/gtest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
make[4]: *** [CMakeFiles/Makefile2:138: googlemock/CMakeFiles/gmock_main.dir/all] Error 2
[ 81%] Linking CXX shared library libgtest_main.so
[ 81%] Built target gtest_main
make[3]: *** [Makefile:161: all] Error 2
make[2]: *** [CMakeFiles/GTest-Release.dir/build.make:136: GTest-Release-prefix/src/GTest-Release-stamp/GTest-Release-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:125: CMakeFiles/GTest-Release.dir/all] Error 2
make: *** [Makefile:104: all] Error 2

[hunter ** FATAL ERROR **] Build step failed (dir: /root/.hunter/_Base/70287b1/316dcfb/dffbc08/Build/GTest
[hunter ** FATAL ERROR **] [Directory:/root/.hunter/_Base/Download/Hunter/0.23.34/70287b1/Unpacked/cmake/projects/GTest]
------------------------------ WIKI -------------------------------
https://github.com/ruslo/hunter/wiki/error.external.build.failed

CMake Error at /root/.hunter/_Base/Download/Hunter/0.23.34/70287b1/Unpacked/cmake/modules/hunter_wiki.cmake:12 (message):
Call Stack (most recent call first):
/root/.hunter/_Base/Download/Hunter/0.23.34/70287b1/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_wiki)
/root/.hunter/_Base/Download/Hunter/0.23.34/70287b1/Unpacked/cmake/modules/hunter_download.cmake:613 (hunter_fatal_error)
/root/.hunter/_Base/Download/Hunter/0.23.34/70287b1/Unpacked/cmake/projects/GTest/hunter.cmake:244 (hunter_download)
/root/.hunter/_Base/Download/Hunter/0.23.34/70287b1/Unpacked/cmake/modules/hunter_add_package.cmake:62 (include)
CMakeLists.txt:63 (hunter_add_package)

-- Configuring incomplete, errors occurred!

컴파일 과정에서 "GTEST_DISALLOW_ASSIGN"라는 매크로에서 warning이 발생한 것 같고, warning을 전부 error로 간주하도록 컴파일 옵션이 설정되어 컴파일 에러가 발생하며 종료한 것 같습니다.

/root/.hunter 디렉터리를 사용하는 것으로 보아 루트 계정을 사용하시는 것 같은데요. 혹시 도커를 사용하고 계신가요?

빌드를 하시는 리눅스 버전(예: 우분투 18.04)과 gcc 버전을 좀 알려 주시면 제가 재현해 보는데 도움이 될 것 같습니다. gcc 버전은 gcc -v 명령으로 확인하실 수 있습니다.

마이크로소프트 스토어에서 배포한 ubuntu를 설치했습니다.
확인해보니 docker는 사용중이지 않습니다.

리눅스 버전은 Ubuntu 20.04 LTS이고
gcc 버전은 gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0 로 확인됩니다.

도와주셔서 감사합니다!

우분투 버전이 많이 높네요. 제가 18.04까지는 빌드를 해봤는데, 20.04에서는 해보지 않아 컴파일러의 버전 차이라고 확정적으로 말씀드리기도 어렵습니다.

당장 테스트할 장비가 마땅치 않아 빠르게는 확인할 수 없고, 죄송합니다만 테스트에 시간이 좀 걸릴 듯 합니다.

혹시 우분투 18.04 장비에서 빌드해보실 수는 없을까요?

우분투 18.04 버전으로 다운받아서 빌드해보니 됐습니다!!
감사합니다

CXXFLAGS="-Wno-error=deprecated-copy" cmake ..

요렇게 빌드하니깐 되는 것 같습니다

The same results occur in the following environment: 🇰🇷 다음 환경에서 동일한 결과가 발생합니다:

  • Linux 4.4.0
  • gcc 9.3.0

It looks like we need to open the issue again. 🇰🇷 이슈를 다시 열어야 될 것 같습니다.

@j2doll

모델 개선이 맘처럼 쉽지 않아 배포를 안한지 상당히 오래 되었습니다.
그간 빌드 환경이 많이 바뀌어 말씀하신 것처럼 한번 손볼 필요가 있을 것 같습니다.
조만간 빌드쪽만 손봐서 배포를 한번 할테니, 조금만 기다려 주시길 바랍니다.

저도 동일하게 발생합니다.

  • Linux version 6.1.9-1-MANJARO
  • gcc (GCC) 12.2.1 20230111