protobuf 2.5.0 버전 환경구성
Maven을 통해 hadoop을 빌드하는 과정에서 protobuf 2.5.0 버전을 사용해야하는 경우가 생겼습니다. M2 맥 환경에서 brew를 통해 설치를 하면 23.3이 설치되었고, 2.5.0을 별도로 설치할 수 있는 방법은 없었습니다. 그래서 직접 protobuf 2.5.0 버전 바이너리 파일을 받아 빌드를 진행하였습니다.
https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
위 홈페이지에 접속하여 protobuf-2.5.0.tar.gz 파일을 다운 받습니다.
압축을 해제 한 후 컴파일 명령어를 실행합니다.
압축을 해제 한 protobuf-2.5.0 경로에서 아래 명령어를 실행합니다.
./configure --prefix==(원하는 경로)
make & make install
** 여기서 make & make install을 하는 과정에서 오류가 생깁니다.

위 오류를 해결하기 위해 파일을 추가 및 수정합니다.
위 사이트를 참고하여 파일에 대한 작업을 합니다.
1. atomicops_internals_arm64_gcc.h 파일 추가
위 사이트에 있는 git에서 src/google/protobuf/stubs/atomicops_internals_arm64_gcc.h 부분의 내용을 복사하여
../protobuf-2.5.0/src/google/protobuf/stubs/ 이 경로에 atomicops_internals_arm64_gcc.h 라는 파일을 추가합니다.
2. ../protobuf-2.5.0/src/google/protobuf/stubs/atomicops.h 파일 수정

#elif defined(GOOGLE_PROTOBUF_ARCH_AARCH64)
#include <google/protobuf/stubs/atomicops_internals_arm64_gcc.h>
두 줄을 181, 182번째 줄에 추가합니다.
3. ../protobuf-2.5.0/src/google/protobuf/stubs/platform_macros.h 파일 수정

59번째 줄 다음에 이 내용을 추가합니다.
#elif defined(__arm64__)
#define GOOGLE_PROTOBUF_ARCH_ARM 1
#define GOOGLE_PROTOBUF_ARCH_64_BIT 1
#elif defined(__aarch64__)
#define GOOGLE_PROTOBUF_ARCH_AARCH64 1
#define GOOGLE_PROTOBUF_ARCH_64_BIT 1
위 3가지 설정을 적용한 후 make clean all 명령어를 사용하여 make 작업을 초기화 하고 컴파일 작업을 다시 진행합니다.
컴파일 작업 후 protobuf 환경변수 설정을 합니다.
export PROTOC_HOME=(protobuf 설치경로)
export PATH=$PROTOC_HOME/bin:$PATH
환경변수 적용 후 protoc --version 명령어를 통해 조회를 하게되면, libprotoc 2.5.0 이 출력됩니다.