Ошибка при установке экземпляра AWS EC2 Ubuntu 16.04

1

Я пытаюсь установить dlib на EC2 ubuntu 16.04, я пробовал много вариантов, предлагаемых в google, как это, но, получив выше ошибку, я устанавливаю на свою локальную машину, которая была довольно простой и легко установлена. Также я попытался изменить свою среду, поскольку я думал, может быть проблема с совместимостью с версией python, но с python3 тоже получается такая же ошибка. Вывод здесь:

Collecting dlib
  Using cached https://files.pythonhosted.org/packages/df/aa/6a9bb2a763107bb2606d6ee1aa65fcd3b51375a9ef6436e9c9280b0dd63c/dlib-19.15.0.tar.gz
Installing collected packages: dlib
  Running setup.py install for dlib ... error
    Complete output from command /home/ubuntu/newEnv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-xqrlt_6v/dlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-c_7ykc12/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/newEnv/include/site/python3.5/dlib:
    running install
    running build
    running build_py
    package init file 'dlib/__init__.py' not found (or not a regular file)
    running build_ext
    Building extension for Python 3.5.2 (default, Nov 23 2017, 16:37:01)
    Invoking CMake setup: 'cmake /tmp/pip-install-xqrlt_6v/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-xqrlt_6v/dlib/build/lib.linux-x86_64-3.5 -DPYTHON_EXECUTABLE=/home/ubuntu/newEnv/bin/python3 -DCMAKE_BUILD_TYPE=Release'
    -- The C compiler identification is GNU 5.4.0
    -- The CXX compiler identification is GNU 5.4.0
    -- 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
    -- Detecting C compile features
    -- Detecting C compile features - 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
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found PythonInterp: /home/ubuntu/newEnv/bin/python3 (found version "3.5.2")
    -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.5m.so
    -- Performing Test HAS_CPP14_FLAG
    -- Performing Test HAS_CPP14_FLAG - Success
    -- pybind11 v2.2.2
    -- Using CMake version: 3.12.0
    -- Compiling dlib version: 19.15.0
    -- SSE4 instructions can be executed by the host processor.
    -- AVX instructions can be executed by the host processor.
    -- Enabling AVX instructions
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - not found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE
    -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
    -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
    -- Looking for gethostbyname
    -- Looking for gethostbyname - found
    -- Looking for connect
    -- Looking for connect - found
    -- Looking for remove
    -- Looking for remove - found
    -- Looking for shmat
    -- Looking for shmat - found
    -- Looking for IceConnectionNumber in ICE
    -- Looking for IceConnectionNumber in ICE - found
    -- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
    -- Looking for png_create_read_struct
    -- Looking for png_create_read_struct - found
    -- Searching for BLAS and LAPACK
    -- Searching for BLAS and LAPACK
    -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
    -- Checking for module 'cblas'
    --   No package 'cblas' found
    -- Checking for module 'lapack'
    --   Found lapack, version 0.2.18
    -- Looking for sys/types.h
    CMake Warning (dev) at /home/ubuntu/newEnv/lib/python3.5/site-packages/cmake/data/share/cmake-3.12/Modules/CheckIncludeFile.cmake:70 (message):
      Policy CMP0075 is not set: Include file check macros honor
      CMAKE_REQUIRED_LIBRARIES.  Run "cmake --help-policy CMP0075" for policy
      details.  Use the cmake_policy command to set the policy and suppress this
      warning.

      CMAKE_REQUIRED_LIBRARIES is set to:

        /usr/lib/x86_64-linux-gnu/libpng.so;/usr/lib/x86_64-linux-gnu/libz.so

      For compatibility with CMake 3.11 and below this check is ignoring it.
    Call Stack (most recent call first):
      /home/ubuntu/newEnv/lib/python3.5/site-packages/cmake/data/share/cmake-3.12/Modules/CheckTypeSize.cmake:225 (check_include_file)
      /tmp/pip-install-xqrlt_6v/dlib/dlib/cmake_utils/find_blas.cmake:80 (check_type_size)
      /tmp/pip-install-xqrlt_6v/dlib/dlib/CMakeLists.txt:545 (include)
    This warning is for project developers.  Use -Wno-dev to suppress it.

    -- Looking for sys/types.h - found
    -- Looking for stdint.h
    -- Looking for stdint.h - found
    -- Looking for stddef.h
    -- Looking for stddef.h - found
    -- Check size of void*
    -- Check size of void* - done
    -- Found OpenBLAS library
    -- Looking for sgetrf_single
    -- Looking for sgetrf_single - found
    -- Using OpenBLAS built in LAPACK
    -- Looking for cblas_ddot
    -- Looking for cblas_ddot - found
    -- Looking for sgesv
    -- Looking for sgesv - not found
    -- Looking for sgesv_
    -- Looking for sgesv_ - not found
    CUDA_TOOLKIT_ROOT_DIR not found or specified
    -- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "7.5")
    -- Disabling CUDA support for dlib.  DLIB WILL NOT USE CUDA
    -- C++11 activated.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /tmp/pip-install-xqrlt_6v/dlib/build/temp.linux-x86_64-3.5
    Invoking CMake build: 'cmake --build . --config Release -- -j1'
    Scanning dependencies of target dlib
    [  0%] Building CXX object dlib_build/CMakeFiles/dlib.dir/base64/base64_kernel_1.cpp.o
    [  1%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o
    [  2%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_2.cpp.o
    [  3%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bit_stream/bit_stream_kernel_1.cpp.o
    [  3%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_1.cpp.o
    [  4%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_2.cpp.o
    [  5%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_1.cpp.o
    [  6%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_2.cpp.o
    [  6%] Building CXX object dlib_build/CMakeFiles/dlib.dir/md5/md5_kernel_1.cpp.o
    [  7%] Building CXX object dlib_build/CMakeFiles/dlib.dir/tokenizer/tokenizer_kernel_1.cpp.o
    [  8%] Building CXX object dlib_build/CMakeFiles/dlib.dir/unicode/unicode.cpp.o
    [  9%] Building CXX object dlib_build/CMakeFiles/dlib.dir/data_io/image_dataset_metadata.cpp.o
    c++: internal compiler error: Killed (program cc1plus)
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
    dlib_build/CMakeFiles/dlib.dir/build.make:205: recipe for target 'dlib_build/CMakeFiles/dlib.dir/data_io/image_dataset_metadata.cpp.o' failed
    make[2]: *** [dlib_build/CMakeFiles/dlib.dir/data_io/image_dataset_metadata.cpp.o] Error 4
    CMakeFiles/Makefile2:145: recipe for target 'dlib_build/CMakeFiles/dlib.dir/all' failed
    make[1]: *** [dlib_build/CMakeFiles/dlib.dir/all] Error 2
    Makefile:83: recipe for target 'all' failed
    make: *** [all] Error 2
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-xqrlt_6v/dlib/setup.py", line 257, in <module>
        'Topic :: Software Development',
      File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/ubuntu/newEnv/lib/python3.5/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python3.5/distutils/command/install.py", line 583, in run
        self.run_command('build')
      File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.5/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/pip-install-xqrlt_6v/dlib/setup.py", line 133, in run
        self.build_extension(ext)
      File "/tmp/pip-install-xqrlt_6v/dlib/setup.py", line 173, in build_extension
        subprocess.check_call(cmake_build, cwd=build_folder)
      File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j1']' returned non-zero exit status 2

    ----------------------------------------
Command "/home/ubuntu/newEnv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-xqrlt_6v/dlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-c_7ykc12/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/newEnv/include/site/python3.5/dlib" failed with error code 1 in /tmp/pip-install-xqrlt_6v/dlib/

Я не мог понять, что здесь не так? Поскольку такая же команда работает на локальной машине

Теги:
ubuntu-16.04
dlib
amazon-ec2

2 ответа

2

После некоторых исследований и разработок я заметил, что компилятору c++ требуется немного больше оперативной памяти не менее 4 ГБ, поэтому я просто обновляю свой файл ec2 t2.micro до t2.medium, а затем легко устанавливается. В основном это было меньше ошибки RAM.

1

Ваш компилятор C++ разбился. Сравните версию компилятора с рабочей системой с вашей неисправной системой. Ваше решение может быть устаревшим компилятором/цепочкой инструментов.

Ещё вопросы

Сообщество Overcoder
Наверх
Меню