rioyokotalab / caffe2

Caffe2 is a lightweight, modular, and scalable deep learning framework.
https://caffe2.ai
Other
2 stars 0 forks source link

[warsaw] Caffe2 setup #3

Closed Hiroki11x closed 7 years ago

Hiroki11x commented 7 years ago

I'd like to install protobuf which is depended library

cd $SRC_DIR
wget https://github.com/google/protobuf/archive/v3.3.0.tar.gz
tar zxvf v3.3.0.tar.gz
cd protobuf-3.3.0
./autogen.sh
./configure --prefix=$LOCAL_DIR/protobuf-3.3.0
make -j 64
make install

I want to do,

./autogen.sh

If there is no autoconf, an error will be displayed

therefore

cd $SRC_DIR
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.gz
tar zxvf autoconf-2.68.tar.gz
cd autoconf-2.68
./configure --prefix=$LOCAL_DIR/autoconf-2.68
make -j 64
make check -j 64
make install -j 64

install to $LOCAL_DIR/autoconf-2.68

edit ~/.bashrc and add following sentence

# For autoconf
export PATH=$LOCAL_DIR/autoconf-2.68:$PATH
export PATH=$LOCAL_DIR/autoconf-2.68/bin:$PATH

then, I tried

./autogen.sh

the error occured like below

+ autoreconf -f -i -Wall,no-obsolete
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Can't exec "aclocal": Permission denied at $LOCAL_DIR/autoconf-2.68/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: Permission denied

aclocal is in automake? I have not reinstalled automake yet, but Permission denied means is it necessary to reinstalled ?

cf. http://blog.csdn.net/ldl22847/article/details/8572406

Hiroki11x commented 7 years ago
$ cd  protobuf-3.3.0
$ ./autogen.sh 
+ autoreconf -f -i -Wall,no-obsolete
configure.ac:30: error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
Hiroki11x commented 7 years ago

https://rcmdnk.com/blog/2017/04/03/computer-linux/

この記事同様に、

$ /usr/bin/autoconf
aclocal.m4:17: warning: this file was generated for autoconf 2.68.
You have another version of autoconf.  It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.
configure.ac:94: error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.

となった

https://rcmdnk.com/blog/2014/12/30/computer-automake/

を参考に

Makefile.amを書き換えたやり直してもダメ

libtoolをinstallして(http://www.bnote.net/linux/libtool_inst.shtml) ./autogen し直してもダメ

Hiroki11x commented 7 years ago

Boost

wget https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.tar.gz
  tar -zxf boost_1_63_0.tar.gz
  cd boost_1_63_0
  ./bootstrap.sh --prefix=$LOCAL_DIR/boost_1_63_0 --with-toolset=gcc
  ./b2 -j 64
  ./b2 install --prefix=$LOCAL_DIR/boost_1_63_0

Gflags

wget https://github.com/gflags/gflags/archive/v2.2.0.tar.gz -O gflags_2.2.0.tar.gz
  tar -xf gflags_2.2.0.tar.gz
  cd gflags-2.2.0
  mkdir build
  cd build
  cmake -DCMAKE_INSTALL_PREFIX=$LOCAL_DIR/gflags-2.2.0 \
    -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON ..
  cd ..
  make -j $J
  make install

opencv

wget https://github.com/Itseez/opencv/archive/2.4.13.zip -O opencv-2.4.13.zip
  unzip opencv-2.4.13.zip
  cd opencv-2.4.13
  mkdir build
  cd build
  cmake -DCMAKE_INSTALL_PREFIX=$LOCAL_DIR/opencv-2.4.13 \
        -DCMAKE_BUILD_TYPE=RELEASE \
        -D CUDA_NVCC_FLAGS='-std=c++11' \
        -DCUDA_ARCH_BIN="2.0 2.1(2.0) 3.0 3.5 3.7 5.0 5.2 6.0 6.1" \
        -DWITH_FFMPEG=OFF \
        -DCMAKE_CXX_FLAGS=-D_FORCE_INLINES \
        -DCUDA_TOOLKIT_ROOT_DIR=$CUDA_ROOT \
        ..
  make -j $J
  make install

snappy

wget https://github.com/google/snappy/releases/download/1.1.4/snappy-1.1.4.tar.gz
  tar zxvf snappy-1.1.4.tar.gz
  cd snappy-1.1.4
  ./autogen.sh
  ./configure --prefix=$LOCAL_DIR/snappy-1.1.4
  make -j $J
  make install

lmdb

wget https://github.com/LMDB/lmdb/archive/LMDB_0.9.18.tar.gz
  tar zxvf LMDB_0.9.18.tar.gz
  cd lmdb-LMDB_0.9.18/libraries/liblmdb
  make -j $J
  make install prefix= $LOCAL_DIR/lmdb-LMDB_0.9.18

nccl

wget https://github.com/NVIDIA/nccl/archive/v1.3.4-1.tar.gz \
       -O nccl-1.3.4.tar.gz
  tar zxvf nccl-1.3.4.tar.gz
  cd nccl-1.3.4-1
  make CUDA_HOME=$CUDA_ROOT PREFIX=$LOCAL_DIR/nccl-1.3.4-1 install

Glog

 wget https://github.com/google/glog/archive/v0.3.4.tar.gz -O glog-0.3.4.tar.gz
  tar zxvf glog-0.3.4.tar.gz
  cd glog-0.3.4
  ./configure --prefix=$LOCAL_DIR/glog-0.3.4  --with-gflags=.
  make -j $J
  make install

Succeeded

Hiroki11x commented 7 years ago

ATLAS

wget http://www.netlib.org/lapack/lapack-3.6.1.tgz
  wget https://sourceforge.net/projects/math-atlas/files/Stable/3.10.3/atlas3.10.3.tar.bz2
  tar zxjf atlas3.10.3.tar.bz2
  cd ATLAS
  mkdir build
  cd build
  ../configure -b 64 --prefix=$LOCAL_DIR/ATLAS --shared --with-netlib-lapack-tarfile=../../lapack-3.6.1.tgz
  make -j $J
  make install

when I tried

make -j 32

The following error occured

gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) 
/usr/bin/gnatgcc -V 2>&1  >> bin/INSTALL_LOG/ERROR.LOG
gnatgcc: error: unrecognized command line option ‘-V’
gnatgcc: fatal error: no input files
compilation terminated.
make[4]: [error_report] Error 4 (ignored)
/usr/bin/gnatgcc --version 2>&1  >> bin/INSTALL_LOG/ERROR.LOG
tar cf error_UNKNOWNx8664AVXMAC.tar Make.inc bin/INSTALL_LOG/*
bzip2 error_UNKNOWNx8664AVXMAC.tar
make[4]: Leaving directory `/home/hiroki11x/env/src/ATLAS/build'
make[3]: Leaving directory `/home/hiroki11x/env/src/ATLAS/build'
make[2]: Leaving directory `/home/hiroki11x/env/src/ATLAS/build/bin'
Error report error_<ARCH>.tgz has been created in your top-level ATLAS
directory.  Be sure to include this file in any help request.
cat: ../../CONFIG/error.txt: No such file or directory
cat: ../../CONFIG/error.txt: No such file or directory
make[1]: *** [build] Error 255
make[1]: Leaving directory `/home/hiroki11x/env/src/ATLAS/build'
make: *** [build] Error 2
Hiroki11x commented 7 years ago

hdf5

  wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.0-patch1/src/hdf5-1.10.0-patch1.tar.bz2
  tar xvjf hdf5-1.10.0-patch1.tar.bz2
  cd hdf5-1.10.0-patch1
  ./configure --prefix=$LOCAL_DIR/hdf5-1.10.0-patch1 \
              --enable-fortran \
              --enable-cxx
  make -j $J
  make install