licode學習之編譯篇--2


今天在一個新的centos系統上面,結果編譯git報錯:

/usr/bin/perl Makefile.PL PREFIX='/usr/local/git' INSTALL_BASE='' --localedir='/usr/local/git/share/locale'
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 3.
BEGIN failed--compilation aborted at Makefile.PL line 3.
make[1]: *** [perl.mak] Error 2
make: *** [perl/perl.mak] Error 2

看樣子沒有perl,安裝perl

yum install perl

安裝之后,還是不行。參考:https://blog.csdn.net/tspangle/article/details/11798951

輸入命令:

[root@localhost git-1.8.2.3]# yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
[root@localhost git-1.8.2.3]# ./configure 
[root@localhost git-1.8.2.3]# make
[root@localhost git-1.8.2.3]# make install
[root@localhost git-1.8.2.3]# ln -s /usr/local/bin/git /usr/bin/git
[root@localhost git-1.8.2.3]# yum -y update  nss

OK,重新完成git安裝。

執行 ./installUbuntuDeps.sh

curl: (7) Failed to connect to 2001:470:eb26:54::1: Network is unreachable
tar (child): opus-1.1.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
./installUbuntuDeps.sh: line 152: cd: opus-1.1: No such file or directory
./installUbuntuDeps.sh: line 153: ./configure: No such file or directory
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target `install'.  Stop.

curl: (7) Failed to connect to 2001:470:eb26:54::1: Network is unreachable
tar (child): opus-1.1.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

真是每次錯誤都不一樣啊。

[root@localhost scripts]# vim installUbuntuDeps.sh
install_opus(){
  [ -d $LIB_DIR ] || mkdir -p $LIB_DIR
  cd $LIB_DIR
  if [ ! -f ./opus-1.1.tar.gz ]; then
    curl -OL http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz
    tar -zxvf opus-1.1.tar.gz
    cd opus-1.1
    ./configure --prefix=$PREFIX_DIR
    make $FAST_MAKE -s V=0
    make install
  else
    echo "opus already installed"
  fi
  cd $CURRENT_DIR
}

 http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz 這個地址訪問不了導致,好吧,換另外一個能牆的網絡,下載下來

看代碼里面,是將prefix設置為PREFIX_DIR變量,將gz文件放到LIB_DIR目錄,這兩個目錄是多少,得仔細研究下。

修改initUbuntuDeps.sh相關部分代碼為

install_opus(){
  [ -d $LIB_DIR ] || mkdir -p $LIB_DIR
  cd $LIB_DIR
  if [ ! -f ./opus-1.1.tar.gz ]; then
    echo "This is myself info. LIB_DIR:$LIB_DIR, PREFIX_DIR:$PREFIX_DIR"
    curl -OL http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz
    tar -zxvf opus-1.1.tar.gz
    cd opus-1.1
    ./configure --prefix=$PREFIX_DIR
    make $FAST_MAKE -s V=0
    make install
  else
    echo "opus already installed"
  fi
  cd $CURRENT_DIR
}

再次執行:

./installUbuntuDeps.sh
This is myself info. LIB_DIR:/home/test/licode-master/scripts/./../build/libdeps, PREFIX_DIR:/home/test/licode-master/scripts/./../build/libdeps/build/

打印出來目錄以后,將下載的opus源碼放到路徑下

再次執行installUbuntuDeps.sh

yasm還有一些其他軟件沒有安裝報錯

根據 https://blog.csdn.net/tanga842428/article/details/73277739 添加eperl源

這次執行,新安裝了好多依賴的包,這是一個好現象

No package libvpx. available.
install_mediadeps(){
  install_opus
  yum -qq install yasm libvpx. libx264. if [ -d $LIB_DIR ]; then
    cd $LIB_DIR
    if [ ! -f ./v11.9.tar.gz ]; then
      curl -O -L https://github.com/libav/libav/archive/v11.9.tar.gz
      tar -zxvf v11.9.tar.gz
      cd libav-11.9
      PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig ./configure --prefix=$PREFIX_DIR --enable-shared --enable-gpl --enable-libvpx --enable-libx264 --enable-libopus --disable-doc
      make $FAST_MAKE -s V=0
      make install
    else
      echo "libav already installed"
    fi
    cd $CURRENT_DIR
  else
    mkdir -p $LIB_DIR
    install_mediadeps
  fi

}

原來在腳本里面多寫了個點,將之刪掉,搜索整個文檔,將vpx.中的點刪掉,再執行一次

OK,總算是沒有看到非常嚴重的錯誤了

該編譯C++庫代碼了

 

[root@localhost scripts]# ./installErizo.sh

[root@localhost scripts]# ./installErizo.sh
Installing erizo...
generating release
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.23")
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:20 (message):
gcc version must be >= 5 and is 4.4.7

告訴我gcc版本必須大於5。但是centos中yum的版本里面沒有5,試着讓其降低版本吧

[root@localhost scripts]# vim ../erizo/src/CMakeLists.txt
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
  execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
    OUTPUT_VARIABLE GCC_VERSION)
  if (GCC_VERSION VERSION_LESS 5)
    message(FATAL_ERROR "gcc version must be >= 5 and is ${GCC_VERSION}")
  endif()

  execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
    OUTPUT_VARIABLE CXX_VERSION)
  if (CXX_VERSION VERSION_LESS 5)
    message(FATAL_ERROR "g++ version must be >= 5 and is ${CXX_VERSION}")
  endif()
endif()

將里面的5改為4,讓其版本降低

[root@localhost scripts]# ./installErizo.sh 
Installing erizo...
generating release
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- checking for module 'glib-2.0'
--   package 'glib-2.0' not found
CMake Error at /home/test/licode-master/erizo/cmake/FindGlib.cmake:36 (message):
  pkg-config is needed
Call Stack (most recent call first):
  CMakeLists.txt:64 (find_package)
[root@localhost scripts]# yum install glib2-devel
[root@localhost scripts]# ./installErizo.sh 
Installing erizo...
generating release
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- checking for module 'glib-2.0'
--   found glib-2.0, version 2.28.8
-- Found glib-2.0: /usr/include/glib-2.0, /usr/lib64/libglib-2.0.so;/usr/lib64/libgobject-2.0.so;/usr/lib64/libgthread-2.0.so
CMake Error at /usr/share/cmake/Modules/FindBoost.cmake:1138 (message):
  Unable to find the requested Boost libraries.

  Unable to find the Boost header files.  Please set BOOST_ROOT to the root
  directory containing Boost or BOOST_INCLUDEDIR to the directory containing
  Boost's headers.
Call Stack (most recent call first):
  CMakeLists.txt:69 (find_package)


CMake Error at CMakeLists.txt:7 (message):
  lib not found: NICE-NOTFOUND check README
Call Stack (most recent call first):
  CMakeLists.txt:81 (test_lib)
[root@localhost scripts]# yum install doxygen
[root@localhost scripts]# yum install boost-devel
[root@localhost scripts]# ./installErizo.sh 
Installing erizo...
generating release
-- Found Doxygen: /usr/bin/doxygen (found version "1.6.1") 
-- Found glib-2.0: /usr/include/glib-2.0, /usr/lib64/libglib-2.0.so;/usr/lib64/libgobject-2.0.so;/usr/lib64/libgthread-2.0.so
-- Boost version: 1.41.0
-- Found the following Boost libraries:
--   thread
--   regex
--   system
CMake Error at CMakeLists.txt:7 (message):
  lib not found: NICE-NOTFOUND check README
Call Stack (most recent call first):
  CMakeLists.txt:81 (test_lib)

安裝了doxygen,boost后,報錯,找不到NICE庫。

下一篇再繼續處理這個問題吧


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM