본문 바로가기

Open Source/ProtoBuf

Protocol buffer 설치

[1. 개요]

 

 

[2. 설치 과정]

환경: ubuntu 18.04

 

# apt install autoconf automake libtool curl make g++ unzip

# wget https://github.com/protocolbuffers/protobuf/releases/download/v21.1/protobuf-cpp-3.21.1.tar.gz

# tar -zxf protobuf-cpp-3.21.1.tar.gz

# cd 

# ./autogen.sh

 

# ./configure

==> 디폴트로 /usr/local 에 설치가 된다.

==> --prefix 에 설치 경로를 명시 할 수 있다.

 

# make -j 4

==> 컴파일에 사용 할 코어 개수를 명시한다.

 

# make check

==> 선택 사항

 

# make install

# ldconfig

 

# protoc --version

==> 설치한 protobuf compiler 버전 확인

 

 

[3. 기타 사항]

=> 설치한 protobuf 라이브러리는 보통 아래 경로에서 확인 할 수 있다.

/usr/local/lib

 

=> 설치한 protobuf 컴파일러는 보통 아래 경로에서 확인 할 수 있다.

/usr/local/bin

 

=> 다른 위치에 재설치를 원할 경우, make clean 으로 삭제 후 ./configure 에서 설정 후 다시 설치 하면 된다.

 

 

[4. 참조]

https://github.com/protocolbuffers/protobuf/blob/main/src/README.md