CentOS는 컴파일된 부스트 라이브러리를 인식하지 못합니다.

CentOS는 컴파일된 부스트 라이브러리를 인식하지 못합니다.

다음 단계를 사용하여 Boost를 구축하고 설치했습니다.

# Boostrap and install
JOBS=`grep -c ^processor /proc/cpuinfo`
wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.bz2
tar xf boost_1_67_0.tar.bz2
cd boost_1_63_0
./bootstrap.sh
./b2 -d1 -j${JOBS} --with-thread --with-filesystem --with-python --with-regex -sHAVE_ICU=1 --with-program_options --with-system link=shared release toolset=gcc stage
./b2 -d1 -j${JOBS} --with-thread --with-filesystem --with-python --with-regex -sHAVE_ICU=1 --with-program_options --with-system link=shared release toolset=gcc install
sudo bash -c "echo '/usr/local/lib' > /etc/ld.so.conf.d/boost.conf"
sudo ldconfig

그런 다음 부스트를 사용하는 mapnik을 빌드해 봅니다. 나는 결제한다맵닉실행 ./bootstrap.sh하고 ./configure. "부스트 파일 시스템에 필요한 헤더 또는 공유 라이브러리를 찾을 수 없습니다"라는 오류가 발생합니다. 구성의 부스트 섹션은 다음과 같습니다.

Searching for boost libs and headers... (cached) 
Found boost libs: mason_packages/.link/lib
Found boost headers: mason_packages/.link/include
Checking for C++ header file boost/version.hpp... yes
Checking for Boost version >= 1.61... yes
Found boost lib version... 
Checking for C++ library boost_system... no
Could not find required header or shared library for boost system
Checking for C++ library boost_filesystem... no
Could not find required header or shared library for boost filesystem
Checking for C++ library boost_regex... yes
Checking for C++ library boost_program_options... yes
ValueError: invalid literal for int() with base 10: '':
  File "/root/src/mapnik/SConstruct", line 1600:
    boost_version = [int(x) for x in env.get('BOOST_LIB_VERSION_FROM_HEADER').split('_')]

(빌드 단계는 다음과 같습니다. 케이산)

시스템이 부스트 라이브러리 1.67을 찾지 못하는 이유는 무엇입니까? 부스트 1.63을 설치한 기억이 없습니다. 1.67을 컴파일하고 설치했는데 빌드 시스템에서 이를 사용하지 않습니다. 시스템은 어디에서 시스템의 부스트를 찾나요? /usr/local/lib 및 /usr/lib64에서 모든 libboost_* 파일을 삭제했지만 시스템이 부스트를 찾는 위치는 여전히 알 수 없습니다. 새로 컴파일된 소프트웨어에 대해 시스템에 알리는 방법에 대한 팁을 줄 수 있는 사람이 있습니까?

답변1

여기 Cent OS 7 사용자도 선택적 종속성을 사용하여 Mapnik을 빌드하려고 시도하고 있지만 내 업데이트된 Boost 빌드를 인식하는 것 같습니다. 아마도 당신은 이미 이 문제를 극복했거나, 회피했거나, 잊어버렸을 것입니다. 그러나 나는 이것이 당신이나 다른 누군가에게 도움이 될 수 있도록 어쨌든 언급합니다.

내가 읽은 바로는 Mapnik이 make/install 단계에서 종속성을 인식하기 위해 동일한 컴파일러를 사용하여 종속성을 구축하기를 원하거나 필요로 하는 것과 거의 같습니다. 그러나 이 접근 방식을 사용하면 실제로 기본 컴파일러 대신 사용하기 위해 셸 세션에서 지정해야 하는 기본이 아닌 대체 컴파일러가 생성됩니다.

나는 이 접근 방식을 사용하여 컴파일러를 업데이트하고 Boost를 빌드한 다음 Mapnik을 구성했습니다. 그래서 그것은 당신에게 도움이 될 수 있습니다.

중요한. 두 번째 단계에 나타나는 export CC=및 지침을 구체적으로 기록해 두십시오 . export CXX=여기가 기본 컴파일러를 재정의하는 곳이므로 대부분/모든 종속성이 이 컴파일러로 구축되어야 하는 것 같습니다.

먼저, c++14를 지원하는 gcc6 시리즈에서 업데이트된 gcc/g++ 컴파일러를 받으세요.

## Instructions modified from here, I just changed the gcc version.. 
## https://linuxhostsupport.com/blog/how-to-install-gcc-on-centos-7/
## 
cd /root/downloads
screen -U -S gcc
wget http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-6.5.0/gcc-6.5.0.tar.gz
tar zxf gcc-6.5.0.tar.gz
cd gcc-6.5.0
## Install bzip2 if you don't have it yet..
yum install bzip2
## Install gcc prereqs..
./contrib/download_prerequisites
./configure --disable-multilib --enable-languages=c,c++
make -j 4
make install

다음으로 소스에서 Boost를 빌드하고 설치합니다. 이 접근 방식을 사용하면 Boost를 두 번째로 설치할 수 있습니다. 그러나 Mapnik의 구성 단계에서 이를 지정하려면 위치를 알아야 합니다.

## Create temporary links to the new gcc/g++ compiler resources.
## These disappear with your shell session but need to be in effect for both the Boost and Mapnik builds.
## 
export CC=/usr/local/bin/gcc
export CXX=/usr/local/bin/g++

cd /root/downloads
wget https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz
tar -xzf boost_1_*
cd boost_1_*
## This prefix variable sets the install location for boost, knowing this location is important. 
## This was the location suggested by the instructions I followed, which I've lost, but this seems to be a standard alternative location.
./bootstrap.sh --prefix=/opt/boost
./b2 install --prefix=/opt/boost --with=all

이제 Boost가 설치되어 여기에 있습니다./opt/boost/

이 시점에서 Mapnik을 빌드하고 설치할 때 아래와 같이 구성 단계에서 업데이트된 Boost 버전을 지정할 수 있습니다.

이건 중요하다-재부팅했거나 로그아웃했다가 다시 로그인한 경우 Mapnik이 Boost!를 빌드하는 데 사용한 것과 동일한 컴파일러로 빌드되도록 하려면 두 번째 단계 상단에 나타나는 export CC=및 지침을 반복해야 합니다.export CXX=

./configure BOOST_LIBS=/opt/boost/lib BOOST_INCLUDES=/opt/boost/includes

이것이 누군가에게 도움이 되기를 바랍니다!

관련 정보