Tag Archives: shell

Linux solves nohup: ignoring input and appending output to “nohup. Out” and nohup: ignoring input redirection error to standard output

1. Direct execution document

nohup ./test.sh

Prompt appears:

 Ignore the input and append the output to the "nohup.out"

And input the output result into the default file nohup. Out

2. Redirecting standard output to a file

nohup ./test.sh > a.txt

Prompt appears:

 nohup: Ignore input redirection errors to the standard output

Output the result to the specified file a.txt

3. Redirecting standard error output to a file

nohup ./test.sh > a.txt 2>&1 &

No hint

MOTR compiling error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_R

Key error information

/usr/local/include/c++/8.2.0/bits/basic_string.tcc:1067:1: error: cannot call member function 'void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char32_t; _Traits = std::
char_traits<char32_t>; _Alloc = std::allocator<char32_t>]' without object
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1423, in _run_ninja_build
    check=True)
  File "/home/miniconda3/envs/motr/lib/python3.7/subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

Solution:

/usr/local/include/c++/8.2.0/bits/basic_string.tcc Line 1067

__p->_M_set_sharable();

Change to:

(*__p)._M_set_sharable();

Attachment: the overall error report is as follows

which: no hipcc in (/home/miniconda3/envs/motr/bin:/home/miniconda3/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/bin:/usr/bin:/home/bin:/usr/local/sbin:/usr/sbin)
running build
running build_py
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/functions
copying functions/__init__.py -> build/lib.linux-x86_64-3.7/functions
copying functions/ms_deform_attn_func.py -> build/lib.linux-x86_64-3.7/functions
creating build/lib.linux-x86_64-3.7/modules
copying modules/__init__.py -> build/lib.linux-x86_64-3.7/modules
copying modules/ms_deform_attn.py -> build/lib.linux-x86_64-3.7/modules
running build_ext
building 'MultiScaleDeformableAttention' extension
creating /github/MOTR/models/ops/build/temp.linux-x86_64-3.7
creating /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/nfs
creating /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/nfs/volume-95-4
creating /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/nfs/volume-95-4/liushuai
creating /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/github
creating /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/github/MOTR
creating /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/github/MOTR/models
creating /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/github/MOTR/models/ops
creating /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/github/MOTR/models/ops/src
creating /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/github/MOTR/models/ops/src/cpu
creating /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/github/MOTR/models/ops/src/cuda
/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/utils/cpp_extension.py:220: UserWarning:

                               !! WARNING !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (c++) is not compatible with the compiler Pytorch was
built with for this platform, which is g++ on linux. Please
use g++ to to compile your extension. Alternatively, you may
compile PyTorch from source using c++, and then you can also use
c++ to compile your extension.

See https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md for help
with compiling PyTorch from source.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                              !! WARNING !!

  platform=sys.platform))
Emitting ninja build file /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/3] c++ -MMD -MF /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/github/MOTR/models/ops/src/cpu/ms_deform_attn_cpu.o.d -pthread -B /home/miniconda3/envs/motr/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/github/MOTR/models/ops/src -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/TH -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/miniconda3/envs/motr/include/python3.7m -c -c /github/MOTR/models/ops/src/cpu/ms_deform_attn_cpu.cpp -o /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/github/MOTR/models/ops/src/cpu/ms_deform_attn_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=MultiScaleDeformableAttention -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
[2/3] c++ -MMD -MF /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/github/MOTR/models/ops/src/vision.o.d -pthread -B /home/miniconda3/envs/motr/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/github/MOTR/models/ops/src -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/TH -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/miniconda3/envs/motr/include/python3.7m -c -c /github/MOTR/models/ops/src/vision.cpp -o /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/github/MOTR/models/ops/src/vision.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=MultiScaleDeformableAttention -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from /github/MOTR/models/ops/src/vision.cpp:11:
/github/MOTR/models/ops/src/ms_deform_attn.h: In function 'at::Tensor ms_deform_attn_forward(const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, int)':
/github/MOTR/models/ops/src/ms_deform_attn.h:29:20: warning: 'at::DeprecatedTypeProperties& at::Tensor::type() const' is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many ca
ses (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead
and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
     if (value.type().is_cuda())
                    ^
In file included from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/ATen/Tensor.h:11,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/ATen/Context.h:4,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/ATen/ATen.h:5,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/all.h:4,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/extension.h:4,
                 from /github/MOTR/models/ops/src/cpu/ms_deform_attn_cpu.h:12,
                 from /github/MOTR/models/ops/src/ms_deform_attn.h:13,
                 from /github/MOTR/models/ops/src/vision.cpp:11:
/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/ATen/core/TensorBody.h:262:30: note: declared here
   DeprecatedTypeProperties & type() const {
                              ^~~~
In file included from /github/MOTR/models/ops/src/vision.cpp:11:
/github/MOTR/models/ops/src/ms_deform_attn.h: In function 'std::vector<at::Tensor> ms_deform_attn_backward(const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const
at::Tensor&, int)':
/github/MOTR/models/ops/src/ms_deform_attn.h:51:20: warning: 'at::DeprecatedTypeProperties& at::Tensor::type() const' is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many ca
ses (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead
and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
     if (value.type().is_cuda())
                    ^
In file included from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/ATen/Tensor.h:11,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/ATen/Context.h:4,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/ATen/ATen.h:5,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/all.h:4,
                 from /home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/torch/extension.h:4,
                 from /github/MOTR/models/ops/src/cpu/ms_deform_attn_cpu.h:12,
                 from /github/MOTR/models/ops/src/ms_deform_attn.h:13,
                 from /github/MOTR/models/ops/src/vision.cpp:11:
/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/ATen/core/TensorBody.h:262:30: note: declared here
   DeprecatedTypeProperties & type() const {
                              ^~~~
[3/3] /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/github/MOTR/models/ops/src -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/i
nclude/torch/csrc/api/include -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/TH -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/
home/miniconda3/envs/motr/include/python3.7m -c -c /github/MOTR/models/ops/src/cuda/ms_deform_attn_cuda.cu -o /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/github/MOTR/models/ops/src/cuda/ms_deform_attn
_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -
D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=MultiScaleDeformableAttention -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61
-std=c++14
FAILED: /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/github/MOTR/models/ops/src/cuda/ms_deform_attn_cuda.o
/usr/local/cuda/bin/nvcc -DWITH_CUDA -I/github/MOTR/models/ops/src -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include
/torch/csrc/api/include -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/TH -I/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/m
iniconda3/envs/motr/include/python3.7m -c -c /github/MOTR/models/ops/src/cuda/ms_deform_attn_cuda.cu -o /github/MOTR/models/ops/build/temp.linux-x86_64-3.7/github/MOTR/models/ops/src/cuda/ms_deform_attn_cuda.
o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUD
A_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=MultiScaleDeformableAttention -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c
++14
/github/MOTR/models/ops/src/cuda/ms_deform_im2col_cuda.cuh(261): warning: variable "q_col" was declared but never referenced
          detected during instantiation of "void ms_deformable_im2col_cuda(cudaStream_t, const scalar_t *, const int64_t *, const int64_t *, const scalar_t *, const scalar_t *, int, int, int, int, int, int, i
nt, scalar_t *) [with scalar_t=double]"
/github/MOTR/models/ops/src/cuda/ms_deform_attn_cuda.cu(64): here

/github/MOTR/models/ops/src/cuda/ms_deform_im2col_cuda.cuh(762): warning: variable "q_col" was declared but never referenced
          detected during instantiation of "void ms_deformable_col2im_cuda(cudaStream_t, const scalar_t *, const scalar_t *, const int64_t *, const int64_t *, const scalar_t *, const scalar_t *, int, int, int
, int, int, int, int, scalar_t *, scalar_t *, scalar_t *) [with scalar_t=double]"
/github/MOTR/models/ops/src/cuda/ms_deform_attn_cuda.cu(134): here

/github/MOTR/models/ops/src/cuda/ms_deform_im2col_cuda.cuh(872): warning: variable "q_col" was declared but never referenced
          detected during instantiation of "void ms_deformable_col2im_cuda(cudaStream_t, const scalar_t *, const scalar_t *, const int64_t *, const int64_t *, const scalar_t *, const scalar_t *, int, int, int
, int, int, int, int, scalar_t *, scalar_t *, scalar_t *) [with scalar_t=double]"
/github/MOTR/models/ops/src/cuda/ms_deform_attn_cuda.cu(134): here

/github/MOTR/models/ops/src/cuda/ms_deform_im2col_cuda.cuh(331): warning: variable "q_col" was declared but never referenced
          detected during instantiation of "void ms_deformable_col2im_cuda(cudaStream_t, const scalar_t *, const scalar_t *, const int64_t *, const int64_t *, const scalar_t *, const scalar_t *, int, int, int
, int, int, int, int, scalar_t *, scalar_t *, scalar_t *) [with scalar_t=double]"
/github/MOTR/models/ops/src/cuda/ms_deform_attn_cuda.cu(134): here

/github/MOTR/models/ops/src/cuda/ms_deform_im2col_cuda.cuh(436): warning: variable "q_col" was declared but never referenced
          detected during instantiation of "void ms_deformable_col2im_cuda(cudaStream_t, const scalar_t *, const scalar_t *, const int64_t *, const int64_t *, const scalar_t *, const scalar_t *, int, int, int
, int, int, int, int, scalar_t *, scalar_t *, scalar_t *) [with scalar_t=double]"
/github/MOTR/models/ops/src/cuda/ms_deform_attn_cuda.cu(134): here

/github/MOTR/models/ops/src/cuda/ms_deform_im2col_cuda.cuh(544): warning: variable "q_col" was declared but never referenced
          detected during instantiation of "void ms_deformable_col2im_cuda(cudaStream_t, const scalar_t *, const scalar_t *, const int64_t *, const int64_t *, const scalar_t *, const scalar_t *, int, int, int
, int, int, int, int, scalar_t *, scalar_t *, scalar_t *) [with scalar_t=double]"
/github/MOTR/models/ops/src/cuda/ms_deform_attn_cuda.cu(134): here

/github/MOTR/models/ops/src/cuda/ms_deform_im2col_cuda.cuh(649): warning: variable "q_col" was declared but never referenced
          detected during instantiation of "void ms_deformable_col2im_cuda(cudaStream_t, const scalar_t *, const scalar_t *, const int64_t *, const int64_t *, const scalar_t *, const scalar_t *, int, int, int
, int, int, int, int, scalar_t *, scalar_t *, scalar_t *) [with scalar_t=double]"
/github/MOTR/models/ops/src/cuda/ms_deform_attn_cuda.cu(134): here

/usr/local/include/c++/8.2.0/bits/basic_string.tcc: In instantiation of 'static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<
_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std
::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]':
/usr/local/include/c++/8.2.0/bits/basic_string.tcc:578:28:   required from 'static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterat
or_tag) [with _FwdIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]'
/usr/local/include/c++/8.2.0/bits/basic_string.h:5043:20:   required from 'static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_typ
e) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]'
/usr/local/include/c++/8.2.0/bits/basic_string.h:5064:24:   required from 'static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator =
const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]'
/usr/local/include/c++/8.2.0/bits/basic_string.tcc:656:134:   required from 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, cons
t _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]'
/usr/local/include/c++/8.2.0/bits/basic_string.h:6716:95:   required from here
/usr/local/include/c++/8.2.0/bits/basic_string.tcc:1067:1: error: cannot call member function 'void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char16_t; _Traits = std::
char_traits<char16_t>; _Alloc = std::allocator<char16_t>]' without object
       __p->_M_set_sharable();
 ^     ~~~~~~~~~
/usr/local/include/c++/8.2.0/bits/basic_string.tcc: In instantiation of 'static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<
_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std
::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]':
/usr/local/include/c++/8.2.0/bits/basic_string.tcc:578:28:   required from 'static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterat
or_tag) [with _FwdIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]'
/usr/local/include/c++/8.2.0/bits/basic_string.h:5043:20:   required from 'static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_typ
e) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]'
/usr/local/include/c++/8.2.0/bits/basic_string.h:5064:24:   required from 'static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator =
const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]'
/usr/local/include/c++/8.2.0/bits/basic_string.tcc:656:134:   required from 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, cons
t _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]'
/usr/local/include/c++/8.2.0/bits/basic_string.h:6721:95:   required from here
/usr/local/include/c++/8.2.0/bits/basic_string.tcc:1067:1: error: cannot call member function 'void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char32_t; _Traits = std::
char_traits<char32_t>; _Alloc = std::allocator<char32_t>]' without object
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1423, in _run_ninja_build
    check=True)
  File "/home/miniconda3/envs/motr/lib/python3.7/subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 70, in <module>
    cmdclass={"build_ext": torch.utils.cpp_extension.BuildExtension},
  File "/home/miniconda3/envs/motr/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/home/miniconda3/envs/motr/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/miniconda3/envs/motr/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/home/miniconda3/envs/motr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/miniconda3/envs/motr/lib/python3.7/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/home/miniconda3/envs/motr/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/miniconda3/envs/motr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/miniconda3/envs/motr/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 79, in run
    _build_ext.run(self)
  File "/home/miniconda3/envs/motr/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "/home/miniconda3/envs/motr/lib/python3.7/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 603, in build_extensions
    build_ext.build_extensions(self)
  File "/home/miniconda3/envs/motr/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "/home/miniconda3/envs/motr/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "/home/miniconda3/envs/motr/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/miniconda3/envs/motr/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 196, in build_extension
    _build_ext.build_extension(self, ext)
  File "/home/miniconda3/envs/motr/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
    depends=ext.depends)
  File "/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 437, in unix_wrap_ninja_compile
    with_cuda=with_cuda)
  File "/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1163, in _write_ninja_file_and_compile_objects
    error_prefix='Error compiling objects for extension')
  File "/home/miniconda3/envs/motr/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1436, in _run_ninja_build
    raise RuntimeError(message)
RuntimeError: Error compiling objects for extension

Pg_dump Error: pg_dump: No matching tables were found,pg_dump: schema with OID 1515227 does not exi

Use SQL query
to create functions and copy them directly

CREATE OR REPLACE FUNCTION public.show_create_table(
  in_schema_name varchar,
  in_table_name varchar
)
RETURNS text
LANGUAGE plpgsql VOLATILE
AS
$$
  DECLARE
    -- the ddl we're building
    v_table_ddl text;

    -- data about the target table
    v_table_oid int;

    -- records for looping
    v_column_record record;
    v_constraint_record record;
    v_index_record record;
  BEGIN
    -- grab the oid of the table; https://www.postgresql.org/docs/8.3/catalog-pg-class.html
    SELECT c.oid INTO v_table_oid
    FROM pg_catalog.pg_class c
    LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
    WHERE 1=1
      AND c.relkind = 'r' -- r = ordinary table; https://www.postgresql.org/docs/9.3/catalog-pg-class.html
      AND c.relname = in_table_name -- the table name
      AND n.nspname = in_schema_name; -- the schema

    -- throw an error if table was not found
    IF (v_table_oid IS NULL) THEN
      RAISE EXCEPTION 'table does not exist';
    END IF;

    -- start the create definition
    v_table_ddl := 'CREATE TABLE ' || in_schema_name || '.' || in_table_name || ' (' || E'\n';

    -- define all of the columns in the table; https://stackoverflow.com/a/8153081/3068233
    FOR v_column_record IN
      SELECT
        c.column_name,
        c.data_type,
        c.character_maximum_length,
        c.is_nullable,
        c.column_default
      FROM information_schema.columns c
      WHERE (table_schema, table_name) = (in_schema_name, in_table_name)
      ORDER BY ordinal_position
    LOOP
      v_table_ddl := v_table_ddl || '  ' -- note: two char spacer to start, to indent the column
        || v_column_record.column_name || ' '
        || v_column_record.data_type || CASE WHEN v_column_record.character_maximum_length IS NOT NULL THEN ('(' || v_column_record.character_maximum_length || ')') ELSE '' END || ' '
        || CASE WHEN v_column_record.is_nullable = 'NO' THEN 'NOT NULL' ELSE 'NULL' END
        || CASE WHEN v_column_record.column_default IS NOT null THEN (' DEFAULT ' || v_column_record.column_default) ELSE '' END
        || ',' || E'\n';
    END LOOP;

    -- define all the constraints in the; https://www.postgresql.org/docs/9.1/catalog-pg-constraint.html && https://dba.stackexchange.com/a/214877/75296
    FOR v_constraint_record IN
      SELECT
        con.conname as constraint_name,
        con.contype as constraint_type,
        CASE
          WHEN con.contype = 'p' THEN 1 -- primary key constraint
          WHEN con.contype = 'u' THEN 2 -- unique constraint
          WHEN con.contype = 'f' THEN 3 -- foreign key constraint
          WHEN con.contype = 'c' THEN 4
          ELSE 5
        END as type_rank,
        pg_get_constraintdef(con.oid) as constraint_definition
      FROM pg_catalog.pg_constraint con
      JOIN pg_catalog.pg_class rel ON rel.oid = con.conrelid
      JOIN pg_catalog.pg_namespace nsp ON nsp.oid = connamespace
      WHERE nsp.nspname = in_schema_name
      AND rel.relname = in_table_name
      ORDER BY type_rank
    LOOP
      v_table_ddl := v_table_ddl || '  ' -- note: two char spacer to start, to indent the column
        || 'CONSTRAINT' || ' '
        || v_constraint_record.constraint_name || ' '
        || v_constraint_record.constraint_definition
        || ',' || E'\n';
    END LOOP;

    -- drop the last comma before ending the create statement
    v_table_ddl = substr(v_table_ddl, 0, length(v_table_ddl) - 1) || E'\n';

    -- end the create definition
    v_table_ddl := v_table_ddl || ');' || E'\n';

    -- suffix create statement with all of the indexes on the table
    FOR v_index_record IN
      SELECT indexdef
      FROM pg_indexes
      WHERE (schemaname, tablename) = (in_schema_name, in_table_name)
    LOOP
      v_table_ddl := v_table_ddl
        || v_index_record.indexdef
        || ';' || E'\n';
    END LOOP;

    -- return the ddl
    RETURN v_table_ddl;
  END;
$$;

example

example:
SELECT * FROM public.show_create_table('public', 'example_table');

produce

CREATE TABLE public.example_table (
  id bigint NOT NULL DEFAULT nextval('test_tb_for_show_create_on_id_seq'::regclass),
  name character varying(150) NULL,
  level character varying(50) NULL,
  description text NOT NULL DEFAULT 'hello there!'::text,
  CONSTRAINT test_tb_for_show_create_on_pkey PRIMARY KEY (id),
  CONSTRAINT test_tb_for_show_create_on_level_check CHECK (((level)::text = ANY ((ARRAY['info'::character varying, 'warn'::character varying, 'error'::character varying])::text[])))
);
CREATE UNIQUE INDEX test_tb_for_show_create_on_pkey ON public.test_tb_for_show_create_on USING btree (id);

Stack overflow moved here. I’ve been looking for it for a long time. It’s easy to use

When executing shell script, $’r ‘: command not found appears

This kind of problem often occurs when using different systems or machines to write or modify scripts. The inconsistency of newline characters leads to this problem

Solution:
remove training sed -i 's/\r$//' filename

Explanation:
Option -i is for in-place editing, we delete the trailing \r directly in the input file. Thus be careful to type the pattern correctly.

Flutter FAQ-Error retrieving device properties for ro.product.cpu.abi

The solution
In order to avoid any detours seen later, the solution is posted directly. The rest of the content is just to record and restore the problem.
How to: Replace Android Platform Tools 29 with Android Platform Tools 28. Download the link at the end of the article.
Problem reproduction
Oddly enough, I went out for an experimental class, and when I came back Android Studio couldn’t compile the Flutter app. The output of the console part is as follows:

Exit code -1073740940 from C:\SDK\platform-tools\adb -s emulator-5554 shell -x logcat -v time -t l

Bash adb --version output:

Android Debug Bridge version 1.0.40
Version 29.0.1-5303910
Installed as C:\SDK\platform-tools\adb.exe

Since taicai did not see any problem, he thought to go to doctor to check the problem with flutter. The partial output is as follows:

[√] Flutter (Channel master, v1.7.2-pre.30, on Microsoft Windows [Version 10.0.17763.529], locale zh-CN)
[!]  Android toolchain - develop for Android devices (Android SDK version 29.0.1)
     × Android license status unknown.
     Try re-installing or updating your Android SDK Manager.
     See https://developer.android.com/studio/#downloads or visit https://flutterchina.club/using-ide/ to get more instructions.
[√] Android Studio (version 3.4)
[√] VS Code, 64-bit edition (version 1.34.0)
[!] Connected device
    ! No devices available
!   Doctor found issuses in 2 categories.

So the problem is probably the Android License, right?Fortunately, the solution is as follows: reinstall or upgrade SDK Manager
First, enter the bin directory of SDK tools, CD C:\SDK\tools\bin, and directly execute sdkmanager --update. I thought everything would be ok, but the output is as follows:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema

Apparently the solution given by Doctor Flutter didn’t work, so I had to scan the Internet for a flutter. Solutions such as adb kill don’t work
In my anger, I reinstalled Android Studio. After docor, I got an extra line of output as follows:

Error retrieving device properties for ro.product.cpu.abi

However, there was still no solution for goose to search with this method, so she had to go out and look for over the wall (after all, Google stuff) and soon found the first issue of 26 May 2017. The dropdown is basically an unresolved problem. So I continued to find the issue of the second 23 Apr 2018. At the end of the page, I found the following comment, which was published two days ago, namely June June 2019, which was about the same time as my problem

This is a problem with platform tools 29. Temporary fix in my issue

According to the comment, it should be the problem of Platform Tools 29. He mentioned an issue later and got a solution after clicking on it.

Install the latest version of android studio beta on windows (platform tools 29 will be installed)

OK, so that’s the easy part, degrade Platform Tools

    open the folder where the SDK is located and remove the platform-tools folder (make sure the adb related process is finished) unzip the platform-tools 28 and put it in and replace it with

(The SDK Manager for Android Studio also seems to be able to degrade directly, but I don’t know why this doesn’t work, so I recommend downloading a manual replacement.)
Here is the download address:

Windows: http://dl-ssl.google.com/android/repository/platform-tools_r28.0.2-windows.zip
macOS: http://dl-ssl.google.com/android/repository/platform-tools_r28.0.2-darwin.zip
Linux: http://dl-ssl.google.com/android/repository/platform-tools_r28.0.2-linux.zip

OK, bash once doctor, all green through ~
Open AVD group photo, end scattering flowers ~

I found a temporary fix while we wait for a solution provided by the Flutter team
Hopefully flutter will be good for me ~ less of this bug~

[Solved] paramiko.ssh_exception.SSHException: Error reading SSH protocol banner

Recently, SFTP upload and download should be configured in the project. After the environment is configured, the connection will report an error.

The error information is as follows:

paramiko.ssh_exception.SSHException: Error reading SSH protocol banner

Solution 1:

Set banner_ Timeout property value

You can change the transport.py under the paramiko Library in the site packages source file. The transport code is as follows:

 class Transport(threading.Thread, ClosingContextManager):
        self.banner_timeout = 15
        # how long (seconds) to wait for the handshake to finish after SSH

15 can be changed to 30

Solution 2:

Pay attention to check your host, port, username, password and other information, as well as upload or download directory path!

Sudo: unable to resolve host solution

When using the sudo command of Linux, some people may encounter such a problem: “sudo: can’t parse the host: xxxxx (your host name). I also encounter this problem. I have found a solution on the Internet and share it with you here.

This problem is caused by the hosts file is not well configured, Linux can not resolve to your host address, the solution is as follows:

sudo vim /etc/hosts

VIM is the command of your text editor. If you don’t have VIM in your computer, you can use GEDIT.

After opening the file, the

127.0.1.1  xxxxx

The following XXX is replaced by your computer host name, which is the last string of characters in the error. If not, add it in. If there are many parts of soybean oil, they can be replaced in batches.

Article link: sudo: unable to resolve host solution

On the error report after the command of ADB shell error:device not A solution of found

When debugging Android development and connecting mobile phones, it is clear that the development mode has been turned on and USB debugging is allowed. After connecting the mobile phone, the device still cannot be found, and an error is reported after inputting the ADB shell in the console error:device not found。 The methods on the Internet can be roughly divided into:
1. ADB kill server to kill the ADB process, and then use the ADB start server command to start it;
2. Detect port 5037( adb.exe Whether the default port is occupied or not adb.exe For processes that occupy port 5037, restart the ADB service:
2.1. ADB nodeamon server: check whether port 5037 is occupied;
2.1 2.2, netstat – ano | findstr “5037”: check which process occupies port 5037;
2.3, tasklist | findstr “21152”: check which program created this process (21152 is the PID of a process occupying port 5037);
2.4, taskkill/F/PID 21152: turn off the process;
2.5, ADB devices: display the current connected devices.
Another solution is provided here, by manually viewing the hardware ID and installing Google native Android debug driver;
1. Right click my computer – & gt; management – & gt; device management – & gt; Android phone. Here we can see the corresponding Android device driver.
2. Right click the attribute of the driver, select the hardware ID in the attribute (P) option under the details option, and record the information in the following value (V). For example, the value of a device is:

USB\VID_2A45&PID_0C02&REV_????&MI_01
USB\VID_2A45&PID_0C02&MI_01

Focus on 2a45 and 0c02.
3. Find the SDK directory of Android development and download (assuming you have downloaded it through the SDK manager) in the computer, and enter into the system of ⁃ extras ⁃ Google ⁃ USB_ In the driver folder, find Android_ winusb.inf This is a Google configuration file for Android. Found in file[ Google.NTx86 ](for 32-bit platform, 64 bit is the same as adding) in this line, you can see a lot of Android device driver information below, for example:

;Google Nexus One
%SingleAdbInterface%        = USB_Install, USB\VID_18D1&PID_0D02
%CompositeAdbInterface%     = USB_Install, USB\VID_18D1&PID_0D02&MI_01

Here, we only need to copy the driver information in the format of this file, and modify it with 2a45 and 0c02 obtained in 2, as follows:

;MEIZU metal
%SingleAdbInterface%        = USB_Install, USB\VID_2A45&PID_0C02
%CompositeAdbInterface%     = USB_Install, USB\VID_2A45&PID_0C02&MI_01

Save and close.
4. Uninstall the original driver and restart the computer. Make sure that the mobile phone has entered the developer mode and allows USB debugging. Select the connection mode to transfer files. Then right click computer – & gt; manage – & gt; device management – & gt; other devices again. You can see a question mark on the ADB interface option, indicating that the driver is not installed correctly. Select the ADB interface and right-click to select Update Driver Software – & gt; browse the computer to find the driver software. In browsing, select Android, the hardware device driver information file that we added before_ winusb.inf The folder of (d): – Android – SDK – Extras – Google – USB_ In this case, you only need to select a folder, not a file). Next, choose always install.
5. After successful installation, an Android phone option will appear in device management.

Ccache: failed to create / home

Ccache: failed to create/home cause: the user name has been modified before, but the home directory of the original user name has not been modified, resulting in this problem.

Solution: use the command sudo GEDIT/etc/passwd to change the original user’s home directory name to the current user name

User name: X: uid: GID: remarks: home directory path: shell path

That is, modify the home directory path

The shell gets the current time of the system and formats it

time=$(date “+%Y%m%d-%H%M%S”)

or

time=$(date “+%Y-%m-%d %H:%M:%S”)

… and other formats you want

echo “${time}”

The above two lines of simple code are shell to get the current time and output it in the format you want.

Several points need to be noted

There is a space after

    date, otherwise the command cannot be recognized, and the shell is very strict on spaces. Y shows 4-digit year, such as 2018; y shows 2-digit year, such as 18. M is the month; m is the minute. D is the day, and D is the current date, such as 1 / 18 / 18 (2018.1.18). H is the hour and H is the month. S displays the current second in milliseconds; s displays the current second in seconds.