idiap / attention-sampling

This Python package enables the training and inference of deep learning models for very large data, such as megapixel images, using attention-sampling
Other
98 stars 18 forks source link

C++ versions less than C++11 are not supported #15

Open discrim opened 4 years ago

discrim commented 4 years ago

Hi,

I am having trouble building this library. It seems that C++ versions less than C++11 are not supported is the key to this error but I am not sure.

Below is the environment I am running this and the entire output when running python3 setup.py build.

Below are some changes I have made to make sure they run properly, which should not interfere with the main procedure.

Below is the entire output when I run python3 setup.py build.

june@DESKTOP-7JTR782:~/as2/attention-sampling-02$ python3 setup.py build
running build
running build_py
running build_ext
Building ats.ops.extract_patches.libpatches
-- Found TensorFlow include: /home/june/.local/lib/python3.6/site-packages/tensorflow/include
-- Found TensorFlow lib: /home/june/.local/lib/python3.6/site-packages/tensorflow/libtensorflow_framework.so
-- Added TensorFlow flags: -D_GLIBCXX_USE_CXX11_ABI=0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/june/as2/attention-sampling-02/ats/ops/extract_patches/build
[ 33%] Building NVCC (Device) object CMakeFiles/patches.dir/patches_generated_extract_patches.cu.o
In file included from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/util/ConfigureVectorization.h:384:0,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/Core:22,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/unsupported/Eigen/CXX11/Tensor:14,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/framework/numeric_types.h:20,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/framework/allocator.h:23,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/framework/op_kernel.h:23,
                 from /home/june/as2/attention-sampling-02/ats/ops/extract_patches/extract_patches.cu:12:
/usr/local/cuda/include/host_defines.h:54:2: warning: #warning "host_defines.h is an internal header file and must not be used directly.  This file will be removed in a future CUDA release.  Please use cuda_runtime_api.h or cuda_runtime.h instead." [-Wcpp]
 #warning "host_defines.h is an internal header file and must not be used directly.  This file will be removed in a future CUDA release.  Please use cuda_runtime_api.h or cuda_runtime.h instead."
  ^
In file included from /usr/include/c++/4.8/atomic:38:0,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/lib/core/refcount.h:19,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/platform/tensor_coding.h:21,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/framework/resource_handle.h:19,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/framework/allocator.h:24,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/framework/op_kernel.h:23,
                 from /home/june/as2/attention-sampling-02/ats/ops/extract_patches/extract_patches.cu:12:
/usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^
In file included from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/absl/base/config.h:66:0,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/absl/strings/string_view.h:31,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/lib/core/stringpiece.h:29,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/platform/tensor_coding.h:22,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/framework/resource_handle.h:19,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/framework/allocator.h:24,
                 from /home/june/.local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/framework/op_kernel.h:23,
                 from /home/june/as2/attention-sampling-02/ats/ops/extract_patches/extract_patches.cu:12:
/home/june/.local/lib/python3.6/site-packages/tensorflow/include/absl/base/policy_checks.h:77:2: error: #error "C++ versions less than C++11 are not supported."
 #error "C++ versions less than C++11 are not supported."
  ^
CMake Error at patches_generated_extract_patches.cu.o.Release.cmake:220 (message):
  Error generating
  /home/june/as2/attention-sampling-02/ats/ops/extract_patches/build/CMakeFiles/patches.dir//./patches_generated_extract_patches.cu.o

CMakeFiles/patches.dir/build.make:82: recipe for target 'CMakeFiles/patches.dir/patches_generated_extract_patches.cu.o' failed
make[2]: *** [CMakeFiles/patches.dir/patches_generated_extract_patches.cu.o] Error 1
CMakeFiles/Makefile2:94: recipe for target 'CMakeFiles/patches.dir/all' failed
make[1]: *** [CMakeFiles/patches.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
  File "setup.py", line 37, in compile
    cwd=extension_dir
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', '-j7']' returned non-zero exit status 2.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "setup.py", line 144, in <module>
    setup_package()
  File "setup.py", line 139, in setup_package
    cmdclass={"build_ext": custom_build_ext}
  File "/home/june/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/june/.local/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 79, in run
    _build_ext.run(self)
  File "/usr/lib/python3/dist-packages/Cython/Distutils/old_build_ext.py", line 185, in run
    _build_ext.build_ext.run(self)
  File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/usr/lib/python3/dist-packages/Cython/Distutils/old_build_ext.py", line 193, in build_extensions
    self.build_extension(ext)
  File "setup.py", line 52, in build_extension
    ext.compile()
  File "setup.py", line 46, in compile
    ) from e
RuntimeError: Couldn't compile and install ats.ops.extract_patches.libpatches
june@DESKTOP-7JTR782:~/as2/attention-sampling-02$

Thanks for the paper and this library. If you need any more information about my environment, please ask me. Any help is welcomed. Thanks!