kakao / khaiii

Kakao Hangul Analyzer III
Apache License 2.0
1.4k stars 285 forks source link

Ubuntu 22.04 에서 빌드 #115

Open sayzard opened 1 year ago

sayzard commented 1 year ago

Ubuntu 22.04 에서 빌드해보려니 오류가 나서
issue에 올라온 내용들을 참고하여 다음과 같이 빌드하였습니다.

혹시나 필요하신 분이 있으실까 하여 남깁니다.

gcc-10, g++-10을 설치 안하신 경우

$ sudo apt install g++-10 gcc-10
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 11

빌드 전에 gcc-10, g++-10 으로 전환합니다.

$ sudo update-alternatives --config gcc
There are 2 choices for the alternative gcc (providing /usr/bin/gcc).

  Selection    Path             Priority   Status
------------------------------------------------------------
  0            /usr/bin/gcc-11   11        auto mode
* 1            /usr/bin/gcc-10   10        manual mode
  2            /usr/bin/gcc-11   11        manual mode
Press <enter> to keep the current choice[*], or type selection number:
$ sudo update-alternatives --config g++
There are 2 choices for the alternative g++ (providing /usr/bin/g++).

  Selection    Path             Priority   Status
------------------------------------------------------------
  0            /usr/bin/g++-11   11        auto mode
* 1            /usr/bin/g++-10   10        manual mode
  2            /usr/bin/g++-11   11        manual mode

Press <enter> to keep the current choice[*], or type selection number:

clone하고 feature/101으로 switch합니다.

$ git clone https://github.com/kakao/khaiii.git
$ cd khaiii
$ git switch feature/101

이후 문서의 빌드과정을 진행합니다.

$ mkdir build
$ cd build
$ cmake ..

...
danjclegg commented 1 year ago

Thanks! I also had this issue and couldn't downgrade easily to 10, but I found this hack worked, I don't know if it's legitimate or not though, beware! Maybe this helps get to the issue for someone.

The error looks like what's described here: https://stackoverflow.com/questions/71296302/numeric-limits-is-not-a-member-of-std

So applied advice:

vim ../khaiii/src/main/cpp/main.cpp

vim ~/.hunter/_Base/70287b1/6f60971/dffbc08/Install/include/cxxopts.hpp

and add "#include " after other includes

built fine on gcc/g++ 11 on Debian bookworm

Feel free to take this down if it's not good advice :)

hwtheowl commented 1 year ago

정말 감사합니다! 덕분에 잘 진행했습니다