问:
Install torchvision for c++ on Jetson Nano
I want to use torchvision c++ on my Jetson Nano (Jetpack 4.5).

I need only torchvision::ops::nms function from torchvision. If you can give source codes of that function or an alternative implementation of that function with torch (c++) please share, and installation will not be required any more.

I have tried MANY ways to install, but haven't succeed yet.

For example I tried https://www.neuralception.com/settingupopencv/ this approach, but getting this error while running make and can't solve it.

```<code>[  2%] Building CXX object CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/common_jpeg.cpp.o
[  5%] Building CXX object CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/decode_image.cpp.o
In file included from /usr/include/c++/7/bits/stl_algobase.h:59:0,
                 from /usr/include/c++/7/memory:62,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:250:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:438:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/bits/stl_algobase.h:59:0,
                 from /usr/include/c++/7/memory:62,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:563:3: error: operator '&&' has no right operand
   && _GLIBCXX_USE_DUAL_ABI && __cpp_transactional_memory >= 201505L \
   ^~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/memory:62,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:107:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/unique_ptr.h:37,
                 from /usr/include/c++/7/memory:80,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/basic_string.h:56:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/string:53:0,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/unique_ptr.h:37,
                 from /usr/include/c++/7/memory:80,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/basic_string.tcc:50:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/array:39:0,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/unique_ptr.h:37,
                 from /usr/include/c++/7/memory:80,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/stdexcept:46:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/stdexcept:127:28: error: operator '||' has no left operand
 #if _GLIBCXX_USE_CXX11_ABI || _GLIBCXX_DEFINE_STDEXCEPT_COPY_OPS
                            ^~
/usr/include/c++/7/stdexcept:211:28: error: operator '||' has no left operand
 #if _GLIBCXX_USE_CXX11_ABI || _GLIBCXX_DEFINE_STDEXCEPT_COPY_OPS
                            ^~
In file included from /usr/include/c++/7/bits/ios_base.h:41:0,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/locale_classes.h:354:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/bits/ios_base.h:46:0,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/system_error:91:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/ios:42:0,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/ios_base.h:230:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/ios_base.h:254:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228:0,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/sstream:297:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/sstream:826:0,
                 from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/sstream.tcc:92:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/locale:41:0,
                 from /usr/include/c++/7/iomanip:43,
                 from /home/jets/Desktop/project/torch/include/c10/util/logging_is_not_google_glog.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/util/Logging.h:28,
                 from /home/jets/Desktop/project/torch/include/c10/core/TensorImpl.h:19,
                 from /home/jets/Desktop/project/torch/include/ATen/core/TensorBody.h:14,
                 from /home/jets/Desktop/project/torch/include/ATen/Tensor.h:3,
                 from /home/jets/Desktop/project/torch/include/ATen/Context.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:9,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/locale_facets_nonio.h:719:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/locale_facets_nonio.h:1567:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
/usr/include/c++/7/bits/locale_facets_nonio.h:1590:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
/usr/include/c++/7/bits/locale_facets_nonio.h:1712:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
/usr/include/c++/7/bits/locale_facets_nonio.h:1747:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
In file included from /usr/include/c++/7/bits/locale_facets_nonio.h:2013:0,
                 from /usr/include/c++/7/locale:41,
                 from /usr/include/c++/7/iomanip:43,
                 from /home/jets/Desktop/project/torch/include/c10/util/logging_is_not_google_glog.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/util/Logging.h:28,
                 from /home/jets/Desktop/project/torch/include/c10/core/TensorImpl.h:19,
                 from /home/jets/Desktop/project/torch/include/ATen/core/TensorBody.h:14,
                 from /home/jets/Desktop/project/torch/include/ATen/Tensor.h:3,
                 from /home/jets/Desktop/project/torch/include/ATen/Context.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:9,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/locale_facets_nonio.tcc:352:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
/usr/include/c++/7/bits/locale_facets_nonio.tcc:564:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
In file included from /usr/include/c++/7/list:63:0,
                 from /home/jets/Desktop/project/torch/include/ATen/core/dispatch/OperatorEntry.h:17,
                 from /home/jets/Desktop/project/torch/include/ATen/core/dispatch/Dispatcher.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/runtime/operator.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/ir/ir.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/function_impl.h:4,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/method.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/object.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/frontend/tracer.h:9,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/autograd/generated/variable_factories.h:12,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:7,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/stl_list.h:326:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/stl_list.h:349:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/stl_list.h:1886:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/stl_list.h:1955:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/list:64:0,
                 from /home/jets/Desktop/project/torch/include/ATen/core/dispatch/OperatorEntry.h:17,
                 from /home/jets/Desktop/project/torch/include/ATen/core/dispatch/Dispatcher.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/runtime/operator.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/ir/ir.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/function_impl.h:4,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/method.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/object.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/frontend/tracer.h:9,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/autograd/generated/variable_factories.h:12,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:7,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/list.tcc:178:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
CMakeFiles/torchvision.dir/build.make:89: recipe for target 'CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/decode_image.cpp.o' failed
make[2]: *** [CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/decode_image.cpp.o] Error 1
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/torchvision.dir/all' failed
make[1]: *** [CMakeFiles/torchvision.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2
</code>```

Changed the compiler, tried multiple other things but still cant fix this.

Tried to install torchvision for python and link libs in cmake (worked for libtorch installation), but there is no "include" or "libs" directories in torchvision directory.

Tried to install with this instructions, but when I'm running sudo -H pip3 install torchvision-0.11.0a0+fa347eb-cp36-cp36m-linux_aarch64.whl  it says "No module named Cython", but I have cython installed, then it tries to build numpy from source and again fails (I have numpy installed).

And that's not all, tried millions of other ways but still stuck (even googled in Chinese).

Please, if you know something that can help, please say.

Body:
I want to use torchvision c++ on my Jetson Nano (Jetpack 4.5).

I need only torchvision::ops::nms function from torchvision. If you can give source codes of that function or an alternative implementation of that function with torch (c++) please share, and installation will not be required any more.

I have tried MANY ways to install, but haven't succeed yet.

For example I tried https://www.neuralception.com/settingupopencv/ this approach, but getting this error while running make and can't solve it.

[  2%] Building CXX object CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/common_jpeg.cpp.o
[  5%] Building CXX object CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/decode_image.cpp.o
In file included from /usr/include/c++/7/bits/stl_algobase.h:59:0,
                 from /usr/include/c++/7/memory:62,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:250:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:438:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/bits/stl_algobase.h:59:0,
                 from /usr/include/c++/7/memory:62,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:563:3: error: operator '&&' has no right operand
   && _GLIBCXX_USE_DUAL_ABI && __cpp_transactional_memory >= 201505L \
   ^~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/memory:62,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:107:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/unique_ptr.h:37,
                 from /usr/include/c++/7/memory:80,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/basic_string.h:56:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/string:53:0,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/unique_ptr.h:37,
                 from /usr/include/c++/7/memory:80,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/basic_string.tcc:50:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/array:39:0,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/unique_ptr.h:37,
                 from /usr/include/c++/7/memory:80,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/stdexcept:46:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/stdexcept:127:28: error: operator '||' has no left operand
 #if _GLIBCXX_USE_CXX11_ABI || _GLIBCXX_DEFINE_STDEXCEPT_COPY_OPS
                            ^~
/usr/include/c++/7/stdexcept:211:28: error: operator '||' has no left operand
 #if _GLIBCXX_USE_CXX11_ABI || _GLIBCXX_DEFINE_STDEXCEPT_COPY_OPS
                            ^~
In file included from /usr/include/c++/7/bits/ios_base.h:41:0,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/locale_classes.h:354:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/bits/ios_base.h:46:0,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/system_error:91:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/ios:42:0,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/ios_base.h:230:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/ios_base.h:254:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228:0,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/sstream:297:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/sstream:826:0,
                 from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/sstream.tcc:92:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/locale:41:0,
                 from /usr/include/c++/7/iomanip:43,
                 from /home/jets/Desktop/project/torch/include/c10/util/logging_is_not_google_glog.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/util/Logging.h:28,
                 from /home/jets/Desktop/project/torch/include/c10/core/TensorImpl.h:19,
                 from /home/jets/Desktop/project/torch/include/ATen/core/TensorBody.h:14,
                 from /home/jets/Desktop/project/torch/include/ATen/Tensor.h:3,
                 from /home/jets/Desktop/project/torch/include/ATen/Context.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:9,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/locale_facets_nonio.h:719:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/locale_facets_nonio.h:1567:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
/usr/include/c++/7/bits/locale_facets_nonio.h:1590:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
/usr/include/c++/7/bits/locale_facets_nonio.h:1712:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
/usr/include/c++/7/bits/locale_facets_nonio.h:1747:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
In file included from /usr/include/c++/7/bits/locale_facets_nonio.h:2013:0,
                 from /usr/include/c++/7/locale:41,
                 from /usr/include/c++/7/iomanip:43,
                 from /home/jets/Desktop/project/torch/include/c10/util/logging_is_not_google_glog.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/util/Logging.h:28,
                 from /home/jets/Desktop/project/torch/include/c10/core/TensorImpl.h:19,
                 from /home/jets/Desktop/project/torch/include/ATen/core/TensorBody.h:14,
                 from /home/jets/Desktop/project/torch/include/ATen/Tensor.h:3,
                 from /home/jets/Desktop/project/torch/include/ATen/Context.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:9,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/locale_facets_nonio.tcc:352:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
/usr/include/c++/7/bits/locale_facets_nonio.tcc:564:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
In file included from /usr/include/c++/7/list:63:0,
                 from /home/jets/Desktop/project/torch/include/ATen/core/dispatch/OperatorEntry.h:17,
                 from /home/jets/Desktop/project/torch/include/ATen/core/dispatch/Dispatcher.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/runtime/operator.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/ir/ir.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/function_impl.h:4,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/method.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/object.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/frontend/tracer.h:9,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/autograd/generated/variable_factories.h:12,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:7,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/stl_list.h:326:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/stl_list.h:349:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/stl_list.h:1886:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/stl_list.h:1955:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/list:64:0,
                 from /home/jets/Desktop/project/torch/include/ATen/core/dispatch/OperatorEntry.h:17,
                 from /home/jets/Desktop/project/torch/include/ATen/core/dispatch/Dispatcher.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/runtime/operator.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/ir/ir.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/function_impl.h:4,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/method.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/object.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/frontend/tracer.h:9,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/autograd/generated/variable_factories.h:12,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:7,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/list.tcc:178:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
CMakeFiles/torchvision.dir/build.make:89: recipe for target 'CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/decode_image.cpp.o' failed
make[2]: *** [CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/decode_image.cpp.o] Error 1
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/torchvision.dir/all' failed
make[1]: *** [CMakeFiles/torchvision.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2

Changed the compiler, tried multiple other things but still cant fix this.

Tried to install torchvision for python and link libs in cmake (worked for libtorch installation), but there is no "include" or "libs" directories in torchvision directory.

Tried to install with this instructions, but when I'm running sudo -H pip3 install torchvision-0.11.0a0+fa347eb-cp36-cp36m-linux_aarch64.whl  it says "No module named Cython", but I have cython installed, then it tries to build numpy from source and again fails (I have numpy installed).

And that's not all, tried millions of other ways but still stuck (even googled in Chinese).

Please, if you know something that can help, please say.


来源: stackexchange

问:
Showing Xamarin.mac not upto date in cocoa app
I recently shifted from Windows to Mac. I want to create a project similar to a Windows Forms app in my Mac. So I used cocoa for it. But when I try to build the project it shows this error:

Error MM0074: Xamarin.Mac 9.0.0 does not support a deployment target of 13.1 for macOS (the maximum is 13.0).

Can anyone help me with this?

ContentLicense: CC BY-SA 4.0


问:
Python 3.11 installation: some modules are missing
I'll try to be as clear and specific as possible because I've seen so many people with the same problem, but none of the answers they had worked for me.

The problem in question is: missing modules when trying to import other modules, that (by far as I understand) are installed by default in Python 3.11. eg: missing _sqlite3 when importing sqlite3.

```<code>Python 3.11.0 (main, Jan 12 2023, 03:19:52) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user_name/opt/Python-3.11.0/lib/python3.11/sqlite3/__init__.py",
  line 57, in <module> from sqlite3.dbapi2 import *
  File "/home/user_name/opt/Python-3.11.0/lib/python3.11/sqlite3/dbapi2.py",
  line 27, in <module> from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
</code>```

Context

I'm currently working on a Dreamhost VPS, running on Ubuntu 20.04.5. Since it's a Dreamhost VPS keep in mind I can't uso sudo.

I've Python 3.8 installed globally, but I'm trying to set Python 3.11 with venv. The steps to install Python 3.11 were, as indicated by 'Installing a custom version of Python 3 by Dreamhost':

cd /home/user_name/opt

wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz

tar zxvf Python-3.11.0.tgz

cd Python-3.11.0

./configure --prefix=$HOME/opt/Python-3.11.0

make

make install

When running the make command I saw the following message:

```<code>The necessary bits to build these optional modules were not found:
_bz2                  _curses               _curses_panel
_lzma                 _tkinter              _uuid
readline
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

The following modules found by detect_modules() in setup.py have not
been built, they are *disabled* by configure:
_sqlite3
</code>```

This is my detect_modules() in setup.py:

```<code>def detect_modules(self):
        # remove dummy extension
        self.extensions = []

        # Some C extensions are built by entries in Modules/Setup.bootstrap.
        # These are extensions are required to bootstrap the interpreter or
        # build process.
        self.detect_simple_extensions()
        self.detect_test_extensions()
        self.detect_readline_curses()
        self.detect_crypt()
        self.detect_openssl_hashlib()
        self.detect_hash_builtins()
        self.detect_dbm_gdbm()
        self.detect_sqlite()
        self.detect_platform_specific_exts()
        self.detect_nis()
        self.detect_compress_exts()
        self.detect_expat_elementtree()
        self.detect_multibytecodecs()
        self.detect_decimal()
        self.detect_ctypes()
        self.detect_multiprocessing()
        self.detect_tkinter()
        self.detect_uuid()

        # Uncomment the next line if you want to play with xxmodule.c
#        self.add(Extension('xx', ['xxmodule.c']))

        self.addext(Extension('xxlimited', ['xxlimited.c']))
        self.addext(Extension('xxlimited_35', ['xxlimited_35.c']))
</code>```

So after running the commands I just mentioned, I proceeded to setup the virtualenv to test Python 3.11:

cd /home/user_name/opt

/home/user_name/opt/Python-3.11.0/bin/python3 -m venv venv

source venv/bin/activate

And then I got the ModuleNotFoundError I mentioned at the start of the question.

Things I tried/saw:

When I checked my Python 3.11 directory, I saw that in /home/user_name/opt/Python-3.11.0/lib/python3.11/lib-dynload the cpython files for the modules I don't have are just not there, e.g: /home/user_name/opt/Python-3.11.0/lib/python3.11/lib-dynload/_sqlite3.cpython-311-x86_64-linux-gnu.so* where as in my Python 3.8, they're indeed there: /usr/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so

I tried copying the cpython file from my 3.8 to my 3.11 and renaming it:

cp /usr/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so /home/user_name/opt/Python-3.11.0/lib/python3.11/lib-dynload

mv /home/user_name/opt/Python-3.11.0/lib/python3.11/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so /home/user_name/opt/Python-3.11.0/lib/python3.11/lib-dynload/_sqlite3.cpython-311-x86_64-linux-gnu.so

Then when I ran Python 3.11 I got the following error:

```<code>Python 3.11.0 (main, Jan 12 2023, 04:33:33) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import _sqlite3 # this works just fine
>>> import sqlite3 # throws error
356306 segmentation fault (core dumped)  python
</code>```

Tried recompiling Python and running ./configure --prefix=$HOME/opt/Python-3.11.0 --enable-loadable-sqlite-extensions and didn't work.

Hope I was clear enough and thanks in advance.

Body:
I'll try to be as clear and specific as possible because I've seen so many people with the same problem, but none of the answers they had worked for me.

The problem in question is: missing modules when trying to import other modules, that (by far as I understand) are installed by default in Python 3.11. eg: missing _sqlite3 when importing sqlite3.

Python 3.11.0 (main, Jan 12 2023, 03:19:52) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user_name/opt/Python-3.11.0/lib/python3.11/sqlite3/__init__.py",
  line 57, in <module> from sqlite3.dbapi2 import *
  File "/home/user_name/opt/Python-3.11.0/lib/python3.11/sqlite3/dbapi2.py",
  line 27, in <module> from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'

Context

I'm currently working on a Dreamhost VPS, running on Ubuntu 20.04.5. Since it's a Dreamhost VPS keep in mind I can't uso sudo.

I've Python 3.8 installed globally, but I'm trying to set Python 3.11 with venv. The steps to install Python 3.11 were, as indicated by 'Installing a custom version of Python 3 by Dreamhost':

cd /home/user_name/opt

wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz

tar zxvf Python-3.11.0.tgz

cd Python-3.11.0

./configure --prefix=$HOME/opt/Python-3.11.0

make

make install

When running the make command I saw the following message:

The necessary bits to build these optional modules were not found:
_bz2                  _curses               _curses_panel
_lzma                 _tkinter              _uuid
readline
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

The following modules found by detect_modules() in setup.py have not
been built, they are *disabled* by configure:
_sqlite3

This is my detect_modules() in setup.py:

def detect_modules(self):
        # remove dummy extension
        self.extensions = []

        # Some C extensions are built by entries in Modules/Setup.bootstrap.
        # These are extensions are required to bootstrap the interpreter or
        # build process.
        self.detect_simple_extensions()
        self.detect_test_extensions()
        self.detect_readline_curses()
        self.detect_crypt()
        self.detect_openssl_hashlib()
        self.detect_hash_builtins()
        self.detect_dbm_gdbm()
        self.detect_sqlite()
        self.detect_platform_specific_exts()
        self.detect_nis()
        self.detect_compress_exts()
        self.detect_expat_elementtree()
        self.detect_multibytecodecs()
        self.detect_decimal()
        self.detect_ctypes()
        self.detect_multiprocessing()
        self.detect_tkinter()
        self.detect_uuid()

        # Uncomment the next line if you want to play with xxmodule.c
#        self.add(Extension('xx', ['xxmodule.c']))

        self.addext(Extension('xxlimited', ['xxlimited.c']))
        self.addext(Extension('xxlimited_35', ['xxlimited_35.c']))

So after running the commands I just mentioned, I proceeded to setup the virtualenv to test Python 3.11:

cd /home/user_name/opt

/home/user_name/opt/Python-3.11.0/bin/python3 -m venv venv

source venv/bin/activate

And then I got the ModuleNotFoundError I mentioned at the start of the question.

Things I tried/saw:

When I checked my Python 3.11 directory, I saw that in /home/user_name/opt/Python-3.11.0/lib/python3.11/lib-dynload the cpython files for the modules I don't have are just not there, e.g: /home/user_name/opt/Python-3.11.0/lib/python3.11/lib-dynload/_sqlite3.cpython-311-x86_64-linux-gnu.so* where as in my Python 3.8, they're indeed there: /usr/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so

I tried copying the cpython file from my 3.8 to my 3.11 and renaming it:

cp /usr/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so /home/user_name/opt/Python-3.11.0/lib/python3.11/lib-dynload

mv /home/user_name/opt/Python-3.11.0/lib/python3.11/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so /home/user_name/opt/Python-3.11.0/lib/python3.11/lib-dynload/_sqlite3.cpython-311-x86_64-linux-gnu.so

Then when I ran Python 3.11 I got the following error:

Python 3.11.0 (main, Jan 12 2023, 04:33:33) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import _sqlite3 # this works just fine
>>> import sqlite3 # throws error
356306 segmentation fault (core dumped)  python

Tried recompiling Python and running ./configure --prefix=$HOME/opt/Python-3.11.0 --enable-loadable-sqlite-extensions and didn't work.

Hope I was clear enough and thanks in advance.


问:
The :file-list attribute of the el-upload component in element-ui
In ELEMENT-UI, is the data bound in the :file-list attribute of the el-upload component responsive?</p>
```<code><el-upload
  action="/dev-api/admin/product/fileUpload" list-type="picture-card"
  :on-preview="handlePictureCardPreview" :on-remove="handleRemove"
  :on-success="handleUploadSuccess"
  :file-list="spuImageList">
  <i class="el-icon-plus"></i>
</el-upload>
</code>```

Body:
In ELEMENT-UI, is the data bound in the :file-list attribute of the el-upload component responsive?

<el-upload
  action="/dev-api/admin/product/fileUpload" list-type="picture-card"
  :on-preview="handlePictureCardPreview" :on-remove="handleRemove"
  :on-success="handleUploadSuccess"
  :file-list="spuImageList">

</el-upload>


问:
I cant seem to load my virtual environment for Osintgram
Okay so before anyone says what Im doing is illegal, I am being blackmailed and im trying to find the identity of my catfish. Since I have only started to learn about code about 5 hours ago, I feel like this might a really simple solution. In the first screenshot, that is the error message I get, and when I skip loading the environment and try to run the program without it, I get the second message. The two errors are probably related but Im not sure. Here is the Osintgram site: https://github.com/Datalux/Osintgram
Any help is appreciated

this is when I try to load the virtual environment

This is the error message I get when I try to run the program and just skipping the loading venv

There was a question very similar to this for the virtual environment but his solution didnt work for me.

Ive tried reordering the information in the config file a few different ways but nothing works, even deleting the contents of the config file.


问:
How to solve the error "AttributeError: module 'collections' has no attribute 'MutableMapping' when installing python 3.11.1 on Colab?
I would like to install python 3.11.1 on Google Colab. However, when installing libraries I get the following error:

```<code>*Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 5, in <module>
    from pip._internal.cli.main import main
  File "/usr/lib/python3/dist-packages/pip/__init__.py", line 22, in <module>
    from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
  File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 73, in <module>
    vendored("pkg_resources")
  File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 33, in vendored
    __import__(modulename, globals(), locals(), level=0)
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 77, in <module>
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/packaging/requirements.py", line 9, in <module>
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 674, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/extern/__init__.py", line 43, in load_module
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/pyparsing.py", line 943, in <module>
AttributeError: module 'collections' has no attribute 'MutableMapping'*
</code>```

I've done the following setup:

```<code>!sudo apt-get update -y
!sudo apt-get install python3.11
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
!sudo update-alternatives --config python3
</code>```

Then selected the right version. After that, when I execute:

```<code>!python --version
</code>```

I get the correct version:

```<code>Python 3.11.1
</code>```

Then, I installed pip using:

```<code>!sudo apt install python3-pip
</code>```

I've tried the following:

Update the collections

import collections
import sys
if sys.version_info.major == 3 and sys.version_info.minor >= 10:
from collections.abc import MutableMapping
else:
from collections import MutableMapping

Install these packages

!sudo apt install python-pip
!sudo apt-get update
!sudo apt-get upgrade
!sudo apt-get update

Update the following packages:

 !pip install --upgrade pip wheel setuptools requests

My goal is to install these packages:

```<code>!pip install haversine
!pip install codecarbon[viz]
</code>```

Body:
I would like to install python 3.11.1 on Google Colab. However, when installing libraries I get the following error:

*Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 5, in <module>
    from pip._internal.cli.main import main
  File "/usr/lib/python3/dist-packages/pip/__init__.py", line 22, in <module>
    from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
  File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 73, in <module>
    vendored("pkg_resources")
  File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 33, in vendored
    __import__(modulename, globals(), locals(), level=0)
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 77, in <module>
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/packaging/requirements.py", line 9, in <module>
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 674, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/extern/__init__.py", line 43, in load_module
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/pyparsing.py", line 943, in <module>
AttributeError: module 'collections' has no attribute 'MutableMapping'*

I've done the following setup:

!sudo apt-get update -y
!sudo apt-get install python3.11
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
!sudo update-alternatives --config python3

Then selected the right version. After that, when I execute:

!python --version

I get the correct version:

Python 3.11.1

Then, I installed pip using:

!sudo apt install python3-pip

I've tried the following:

Update the collections

import collections
import sys
if sys.version_info.major == 3 and sys.version_info.minor >= 10:
from collections.abc import MutableMapping
else:
from collections import MutableMapping

Install these packages

!sudo apt install python-pip
!sudo apt-get update
!sudo apt-get upgrade
!sudo apt-get update

Update the following packages:

 !pip install --upgrade pip wheel setuptools requests

My goal is to install these packages:

!pip install haversine
!pip install codecarbon[viz]


问:
How to organize (architecture) my logs on dotnet application
Problem:
I have lots of logs been printed within methods, controllers, services and etc... so, I want to create a standard patter for logging and clean code.

I'd like to segregate logging methods, for example using middleware that could log after and before actions, but, I don't know what should I do with other methods that is not an Action in Controllers. How can I log methods after and before they are calling, loggin Input(Parameters) and Output(return)?

Obs.: My application were based on Clean Architecture, using NLog and I'm store all logs on Elastic.


问:
Is there some equivalent class to Vcl.BaseImageCollection in Lazarus LCL?
Porting an application from Delphi with VCL to Lazarus (freePascal) with LCL, I came across the following unit that I could not find equivalent.

BaseImageCollection (And related)

Before I spend a month reimplementing this feature, is there any equivalent that I failed locate in Lazarus LCL?


问:
Regenerate public-folder
I deleted by public folder in a NextJS project (latest version), and it is not re-generated even if I run npm run build or yearn build.
Anyone who knows how it can be re-generated?</p>

Title: Regenerate public-folder


问:
OraOLEDB.Oracle.1 is not registered but works in VS2013, not VS2017/2019
I have a project/dtsx that just does a simple source->destination fill from Oracle to SQLServer 2014.

The original solution/project was in VS2013 and it runs on my machine - I've never looked to modify the project settings but Project -> Properties -> Configuration Properties -> Debugging -> Run64BitRuntime is True.

Opening this solution now in VS2019 it again looks fine - shows targeting SQL Server 2014 as necessary and appears they are identical but running locally now get "Error: 0xC0209303 at ProjectNameHere, Connection manager "Oracle_To_MF.oledb": The requested OLE DB provider OraOLEDB.Oracle.1 is not registered. If the 64-bit driver is not installed, run the package in 32-bit mode. Error code: 0x00000000.".

Switching Run64BitRuntime to False it will run.

Testing the connection from Connection Manager in SSIS it is successful regardless of the 64bit project setting.

Same behavior in VS2017.

Is there some more global setting I may have set in VS2013 to let this run and I might not have set it in 2017/2019. I can't remember ever going out of my way to set something. It is probable I don't have the 64bit installed and not the end of the world to switch the project properties, I am just confused why it's been working in VS2013. For what it's worth deployed packages and scheduled jobs the configuration to use 32bit is always checked - this is just my local that I'm trying to understand.

Thanks in advance.


问:
Display Response from POST on Page in Vue / Nuxt 3
I'm using Nuxt.js 3 and I want to display the content of a client side POST request on my index page. When the page is hotloaded from a change I'm getting the result that I want, but when it loads fresh it'll always return an error and the text won't load in.

I've never really worked in javascript of any sort before so I'm sure I'm missing something obvious, but I'm not sure what.

I've tried doing it like this:

my-component.vue

```<code><template>
  <div>
      <h2>{{ myResponseTitle }}</h2>
      <p>{{ myResponseText }}</h2>
  </div>
</template>
<script setup>
  const { data: response } = await useFetch('http://localhost:5000/api/endpoint', {
    method: 'POST',
    body: JSON.stringify({ tz: Intl.DateTimeFormat().resolvedOptions().timeZone })
  })

  const myResponseTitle = response.value.title
  const myResponseText = response.value.text
</script>
</code>```

index.vue

```<code><template>
  <div>
    <client-only>
      <div>
        <my-component/>
      </div>
    </client-only>
  </div>
</template>
</code>```

This produces an error like:

Uncaught (in promise) TypeError: response.value is null

setup my-component.vue:12

Ideally I'd like the page to load and then for that component to load when the request returns, but even having it block while waiting for the request would be fine.

Body:
I'm using Nuxt.js 3 and I want to display the content of a client side POST request on my index page. When the page is hotloaded from a change I'm getting the result that I want, but when it loads fresh it'll always return an error and the text won't load in.

I've never really worked in javascript of any sort before so I'm sure I'm missing something obvious, but I'm not sure what.

I've tried doing it like this:

my-component.vue

<template>

{{ myResponseTitle }}

{{ myResponseText }}

</template>

index.vue

<template>

    <client-only>

        <my-component/>

    </client-only>

</template>

This produces an error like:

Uncaught (in promise) TypeError: response.value is null

setup my-component.vue:12

Ideally I'd like the page to load and then for that component to load when the request returns, but even having it block while waiting for the request would be fine.


问:
Cross compile the Aravis Library using a makefile for ARM archi
I have already used the Aravis library on a host running on Linux,

Aravis is a C open-source library for camera acquisition. You could find the GitHub repo in the link below:

https://github.com/AravisProject/aravis

I want to cross-compile the library for my ARM target running on a Mendel Linux machine.

The thing is I am not very familiar with the meson build and this library does not offer any makefile.

Do you have any idea or sample of the makefile that could help me cross-compile, please?

Thank you in advance

S.Tarik

I tried to change the configuration in Linux to  call the g++ cross compiler first by changing the priority between the default gcc and  aarch64-linux-gnu-g++.

https://github.com/highperformancecoder

the error message thrown by the compiler is the following:

```<code>www@www-virtual-machine:~/Downloads/aravis-main$ meson build
The Meson build system
Version: 0.63.3
Source dir: /home/www/Downloads/aravis-main
Build dir: /home/www/Downloads/aravis-main/build
Build type: native build
Project name: aravis
Project version: 0.8.23

meson.build:1:0: ERROR: Could not invoke sanity test executable: [Errno 8] Exec format error: '/home/www/Downloads/aravis-main/build/meson-private/sanitycheckc.exe'.

A full log can be found at /home/www/Downloads/aravis-main/build/meson-logs/meson-log.txt
tar
</code>```

Body:
I have already used the Aravis library on a host running on Linux,

Aravis is a C open-source library for camera acquisition. You could find the GitHub repo in the link below:

https://github.com/AravisProject/aravis

I want to cross-compile the library for my ARM target running on a Mendel Linux machine.

The thing is I am not very familiar with the meson build and this library does not offer any makefile.

Do you have any idea or sample of the makefile that could help me cross-compile, please?

Thank you in advance

S.Tarik

I tried to change the configuration in Linux to  call the g++ cross compiler first by changing the priority between the default gcc and  aarch64-linux-gnu-g++.

https://github.com/highperformancecoder

the error message thrown by the compiler is the following:

www@www-virtual-machine:~/Downloads/aravis-main$ meson build
The Meson build system
Version: 0.63.3
Source dir: /home/www/Downloads/aravis-main
Build dir: /home/www/Downloads/aravis-main/build
Build type: native build
Project name: aravis
Project version: 0.8.23

meson.build:1:0: ERROR: Could not invoke sanity test executable: [Errno 8] Exec format error: '/home/www/Downloads/aravis-main/build/meson-private/sanitycheckc.exe'.

A full log can be found at /home/www/Downloads/aravis-main/build/meson-logs/meson-log.txt
tar


问:
How to geocode address given two streets and number, specific case Colombian addresses
How to geocode with here API address given two streets and number, Colombian addresses are given by main street, intersection with another street and house number.

Example

Calle 27 Carrera 25 24 , Bogota, Colombia is lat:4.62331 lng:-74.07728

https://geocode.search.hereapi.com/v1/geocode?q=Calle+27+Calle+25-34+Bogota&apiKey=*****

Gives the wrong lat and long, the wright location is (4.62331,-74.07728) but it returns (4.62638,-74.08522)


问:
Laravel get specific Route parameters
I am from Taiwan, Sorry for my poor English first.

I try to get Laravel specific Route parameters, here are what i have done:

Route :

Route::get('/a', function () {
  //
})->name('test.a');

Route::get('/b/{b1}/{b2}', function () {
  //
})->name('test.b');

Route::get('/c/{c1}/{c2?}/{c3}', function () {
  //
})->name('test.c');
```
<p>PHP :</p>
<pre class="lang-php prettyprint-override"><code>function getRouteParameters(?string $routeName)
{
  $routeCheck = Illuminate\Support\Facades\Route::getRoutes()->hasNamedRoute($routeName);
  if ($routeCheck) {
    $routeParameters = [];
    $route = Illuminate\Support\Facades\Route::getRoutes()->getByName($routeName);
    $uri = $route->uri();
    $uriArray = explode('/', $uri);
    $uriParameters = array_filter($uriArray, function ($value) {
      return str_contains($value, '{');
    });
    foreach ($uriParameters as $uriParameter) {
      $uriParameterName = str_replace(['{', '?', '}'], '', $uriParameter);
      $uriParameterStatus = str_contains($uriParameter, '?') ? 'optional' : 'required';
      $routeParameters[$uriParameterName] = $uriParameterStatus;
    }
    return $routeParameters;
  }
  return false;
}

$a = getRouteParameters('test.a');
$b = getRouteParameters('test.b');
$c = getRouteParameters('test.c');
$d = getRouteParameters('test.d');
dump($a, $b, $c, $d);
</code>```

Result :

```<code>// $a
[]

// $b
array:2 [▼
  "b1" => "required"
  "b2" => "required"
]

// $c
array:3 [▼
  "c1" => "required"
  "c2" => "optional"
  "c3" => "required"
]

// $d
false
</code>```

It's there a better way to do this ( without write the function by myself )?

Title: Laravel get specific Route parameters

Body:
I am from Taiwan, Sorry for my poor English first.

I try to get Laravel specific Route parameters, here are what i have done:

Route :

Route::get('/a', function () {
  //
})->name('test.a');

Route::get('/b/{b1}/{b2}', function () {
  //
})->name('test.b');

Route::get('/c/{c1}/{c2?}/{c3}', function () {
  //
})->name('test.c');

PHP :

function getRouteParameters(?string $routeName)
{
  $routeCheck = Illuminate\Support\Facades\Route::getRoutes()->hasNamedRoute($routeName);
  if ($routeCheck) {
    $routeParameters = [];
    $route = Illuminate\Support\Facades\Route::getRoutes()->getByName($routeName);
    $uri = $route->uri();
    $uriArray = explode('/', $uri);
    $uriParameters = array_filter($uriArray, function ($value) {
      return str_contains($value, '{');
    });
    foreach ($uriParameters as $uriParameter) {
      $uriParameterName = str_replace(['{', '?', '}'], '', $uriParameter);
      $uriParameterStatus = str_contains($uriParameter, '?') ? 'optional' : 'required';
      $routeParameters[$uriParameterName] = $uriParameterStatus;
    }
    return $routeParameters;
  }
  return false;
}

$a = getRouteParameters('test.a');
$b = getRouteParameters('test.b');
$c = getRouteParameters('test.c');
$d = getRouteParameters('test.d');
dump($a, $b, $c, $d);

Result :

// $a
[]

// $b
array:2 [▼
  "b1" => "required"
  "b2" => "required"
]

// $c
array:3 [▼
  "c1" => "required"
  "c2" => "optional"
  "c3" => "required"
]

// $d
false

It's there a better way to do this ( without write the function by myself )?


问:
How do I position the react-datepicker popover with respect to a specific button?
The Datepicker popover position is always in the middle of CustomInput, it does not consider the ref element's position.

In the following example, despite ref being set on the button, the calendar popover is positioned with respect to the outer div, specifically positioned with respect to center of div.

Expected behavior

Calendar popover should be positioned with respect to the button

```<code>    () => {
  const [startDate, setStartDate] = useState(new Date());
  const buttonRef=React.useRef(null);
  const ExampleCustomInput = forwardRef(({ value, onClick }, ref) => (
  <div style={{display:'flex', border:"1px solid red", justifyContent:"space-between"}}>
  {value}
    <button className="example-custom-input" onClick={onClick} ref={ref}>
      >>
    </button>
    </div>
  ));
  return (
    <DatePicker
      selected={startDate}
      onChange={(date) => setStartDate(date)}
      customInput={<ExampleCustomInput />}
    />
  );
};
</code>```

Body:
The Datepicker popover position is always in the middle of CustomInput, it does not consider the ref element's position.

In the following example, despite ref being set on the button, the calendar popover is positioned with respect to the outer div, specifically positioned with respect to center of div.

Expected behavior

Calendar popover should be positioned with respect to the button

    () => {
  const [startDate, setStartDate] = useState(new Date());
  const buttonRef=React.useRef(null);
  const ExampleCustomInput = forwardRef(({ value, onClick }, ref) => (

  {value}
    <button className="example-custom-input" onClick={onClick} ref={ref}>
      >>
    </button>

  ));
  return (
    <DatePicker
      selected={startDate}
      onChange={(date) => setStartDate(date)}
      customInput={<ExampleCustomInput />}
    />
  );
};


问:
Does the compiler make dereference mutable reference and then re-reference when passed to a function with a reference parameter?
Let's say I have such a function:

```<code>fn take_by_ref(i:&i32){
    println!("{}",i);
}

</code>```

Now I want to pass mutable reference there:

```<code>
#[test]
fn test_mut(){
    let mut x = 9;
    let m = &mut x;
}
</code>```

And it is unclear what is the difference between the two calls to this function?

first:

```<code>take_by_ref(m);
</code>```

second:

```<code>take_by_ref(&*m);
</code>```

Are these two calls equal and the compiler makes first call as the second one automatically? or is there a difference?
And won't the rule that either mut reference or immutable can exist be violated here when call take_by_ref?

That is, the question is that when passing a mut variable to such a function, it can become auto-immutable?

Body:
Let's say I have such a function:

fn take_by_ref(i:&i32){
    println!("{}",i);
}

Now I want to pass mutable reference there:

#[test]
fn test_mut(){
    let mut x = 9;
    let m = &mut x;
}

And it is unclear what is the difference between the two calls to this function?

first:

take_by_ref(m);

second:

take_by_ref(&*m);

Are these two calls equal and the compiler makes first call as the second one automatically? or is there a difference?
And won't the rule that either mut reference or immutable can exist be violated here when call take_by_ref?

That is, the question is that when passing a mut variable to such a function, it can become auto-immutable?


问:
any known issue with ioread64() / iowrite64() on a PCIe bus?
I have a similar issue mentioned here but with a different behavior.

We have an FPGA (from Altera) acts as a 32KB memory on a PCIe bus of IMX8M-Plus CPU (ARM Cortex-A53).

I wrote a simple driver to access FPGA's memory. As you can see from lspci output below, 32KB memory mapped to Region 4 (BAR4) and I use avalon_ioctl_set_operation() and avalon_ioctl_get_operation() to get and set BAR content.

static int avalon_ioctl_get_operation(unsigned long arg, uint8_t op_size)
{
    struct avalon_pcie_operation o;

    if (copy_from_user(&o, (void __user*)arg, sizeof(o)))
        return -EFAULT;

    if (o.bar >= PCI_SRIOV_NUM_BARS)
        return -EFAULT;

    if (!io_dev.bar_addrs[o.bar])
        return -ENOMEM;

    if (!IS_ALIGNED(o.offset, op_size))
        return -EFAULT;

    switch (op_size)
    {
        case 1:
            o.data8 = ioread8(io_dev.bar_addrs[o.bar] + o.offset);
            break;
        case 2:
            o.data16 = ioread16(io_dev.bar_addrs[o.bar] + o.offset);
            break;
        case 4:
            o.data32 = ioread32(io_dev.bar_addrs[o.bar] + o.offset);
            break;
        case 8:
            o.data64 = ioread64(io_dev.bar_addrs[o.bar] + o.offset);
            break;
        default:
            return -EFAULT;
    }

    if (copy_to_user((void __user *)arg, &o, sizeof(o)))
        return -EFAULT;

    return 0;
}

static int avalon_ioctl_set_operation(unsigned long arg, uint8_t op_size)
{
    struct avalon_pcie_operation o;

    if (copy_from_user(&o, (void __user*)arg, sizeof(o)))
        return -EFAULT;

    if (o.bar >= PCI_SRIOV_NUM_BARS)
        return -EFAULT;

    if (!io_dev.bar_addrs[o.bar])
        return -ENOMEM;

    if (!IS_ALIGNED(o.offset, op_size))
        return -EFAULT;

    switch (op_size)
    {
        case 1:
            iowrite8(o.data8, io_dev.bar_addrs[o.bar] + o.offset);
            break;
        case 2:
            iowrite16(o.data16, io_dev.bar_addrs[o.bar] + o.offset);
            break;
        case 4:
            iowrite32(o.data32, io_dev.bar_addrs[o.bar] + o.offset);
            break;
        case 8:
            iowrite64(o.data64, io_dev.bar_addrs[o.bar] + o.offset);
            break;
        default:
            return -EFAULT;
    }

    return 0;
}
```
<p>For my testing, I used BAR4 and offset 0. Whenever I call those functions for 8/16/32 bit variants of read/write all are working fine. I can read whatever I write.</p>
<p>But when I attempt to use <code>iowrite64()</code> and <code>ioread64()</code> from offset 0, I read garbage data (0xFFFFFFFFFFFFFFFF) and PCIe config page is altered and PCIe device stops functioning (you can see <code>lspci</code> output in the altered state at the bottom). And that is happening immediately after <code>ioread64()</code> function call.</p>
<p>I stepped into <code>ioread64()</code> function and saw that at the end it uses <code>__raw_readq()</code> which is defined as</p>
<pre class="lang-c prettyprint-override"><code>static inline u64 __raw_readq(const volatile void __iomem *addr)
{
    u64 val;
    asm volatile(ALTERNATIVE("ldr %0, [%1]",
                 "ldar %0, [%1]",
                 ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE)
             : "=r" (val) : "r" (addr));
    return val;
}
</code>```

We use Linux v5.4 aarch64, I believe that accessing to a bus as a 64-bit should be fine.

uname -a
Linux 5.4.193-0+git.a301219f58a2 #1 SMP PREEMPT Thu Dec 15 14:09:11 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
```
<p>Here is the <code>lspci -vv</code> output at the beginning of the test:</p>
<pre class="lang-auto prettyprint-override"><code>00:00.0 PCI bridge: Synopsys, Inc. DWC_usb3 / PCIe bridge (rev 01) (prog-if 00 [Normal decode])
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Interrupt: pin A routed to IRQ 218
        Region 0: Memory at 18000000 (32-bit, non-prefetchable) [size=1M]
        Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
        I/O behind bridge: [disabled]
        Memory behind bridge: [disabled]
        Prefetchable memory behind bridge: 18100000-181fffff [size=1M]
        Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
        Expansion ROM at 18200000 [virtual] [disabled] [size=64K]
        BridgeCtl: Parity- SERR+ NoISA- VGA- VGA16- MAbort- >Reset- FastB2B-
                PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
        Capabilities: [40] Power Management version 3
                Flags: PMEClk- DSI- D1+ D2- AuxCurrent=375mA PME(D0+,D1+,D2-,D3hot+,D3cold+)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [50] MSI: Enable+ Count=1/1 Maskable+ 64bit-
                Address: bc022000  Data: 0000
                Masking: 00000000  Pending: 00000000
        Capabilities: [70] Express (v2) Root Port (Slot-), MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0
                        ExtTag- RBE+
                DevCtl: CorrErr+ NonFatalErr+ FatalErr+ UnsupReq+
                        RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
                        MaxPayload 128 bytes, MaxReadReq 512 bytes
                DevSta: CorrErr+ NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
                LnkCap: Port #0, Speed 8GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <1us, L1 <8us
                        ClockPM- Surprise- LLActRep+ BwNot+ ASPMOptComp+
                LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk-
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 8GT/s (ok), Width x1 (ok)
                        TrErr- Train- SlotClk+ DLActive+ BWMgmt- ABWMgmt+
                RootCap: CRSVisible+
                RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna+ CRSVisible+
                RootSta: PME ReqID 0000, PMEStatus- PMEPending-
                DevCap2: Completion Timeout: Range ABCD, TimeoutDis+, NROPrPrP+, LTR-
                         10BitTagComp-, 10BitTagReq-, OBFF Not Supported, ExtFmt-, EETLPPrefix-
                         EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
                         FRS-, LN System CLS Not Supported, TPHComp-, ExtTPHComp-, ARIFwd-
                         AtomicOpsCap: Routing- 32bit- 64bit- 128bitCAS-
                DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled ARIFwd-
                         AtomicOpsCtl: ReqEn- EgressBlck-
                LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis-
                         Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
                         Compliance De-emphasis: -6dB
                LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete+, EqualizationPhase1+
                         EqualizationPhase2+, EqualizationPhase3+, LinkEqualizationRequest-
        Capabilities: [100 v2] Advanced Error Reporting
                UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
                CESta:  RxErr+ BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
                CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
                AERCap: First Error Pointer: 00, ECRCGenCap+ ECRCGenEn- ECRCChkCap+ ECRCChkEn-
                        MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
                HeaderLog: 00000000 00000000 00000000 00000000
                RootCmd: CERptEn+ NFERptEn+ FERptEn+
                RootSta: CERcvd+ MultCERcvd+ UERcvd- MultUERcvd-
                         FirstFatal- NonFatalMsg- FatalMsg- IntMsg 0
                ErrorSrc: ERR_COR: 0000 ERR_FATAL/NONFATAL: 0000
        Capabilities: [148 v1] Secondary PCI Express
                LnkCtl3: LnkEquIntrruptEn-, PerformEqu-
                LaneErrStat: 0
        Capabilities: [158 v1] L1 PM Substates
                L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2- ASPM_L1.1+ L1_PM_Substates+
                          PortCommonModeRestoreTime=10us PortTPowerOnTime=10us
                L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2- ASPM_L1.1-
                           T_CommonMode=10us
                L1SubCtl2: T_PwrOn=10us
        Kernel driver in use: pcieport

01:00.0 RAM memory: Altera Corporation Device e001
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Interrupt: pin A routed to IRQ 219
        Region 0: Memory at 18108000 (64-bit, prefetchable) [size=512]
        Region 4: Memory at 18100000 (64-bit, prefetchable) [size=32K]
        Capabilities: [50] MSI: Enable+ Count=1/4 Maskable- 64bit+
                Address: 00000000bc022000  Data: 0001
        Capabilities: [78] Power Management version 3
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [80] Express (v2) Endpoint, MSI 00
                DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 0.000W
                DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
                        RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
                        MaxPayload 128 bytes, MaxReadReq 512 bytes
                DevSta: CorrErr+ NonFatalErr- FatalErr- UnsupReq- AuxPwr- TransPend-
                LnkCap: Port #1, Speed 8GT/s, Width x2, ASPM not supported
                        ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp+
                LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk-
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 8GT/s (ok), Width x1 (downgraded)
                        TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
                DevCap2: Completion Timeout: Not Supported, TimeoutDis+, NROPrPrP-, LTR-
                         10BitTagComp-, 10BitTagReq-, OBFF Not Supported, ExtFmt+, EETLPPrefix-
                         EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
                         FRS-, TPHComp-, ExtTPHComp-
                         AtomicOpsCap: 32bit- 64bit- 128bitCAS-
                DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
                         AtomicOpsCtl: ReqEn-
                LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis-
                         Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
                         Compliance De-emphasis: -6dB
                LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete+, EqualizationPhase1+
                         EqualizationPhase2+, EqualizationPhase3+, LinkEqualizationRequest-
        Capabilities: [100 v1] Virtual Channel
                Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1
                Arb:    Fixed- WRR32- WRR64- WRR128-
                Ctrl:   ArbSelect=Fixed
                Status: InProgress-
                VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
                        Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
                        Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
                        Status: NegoPending- InProgress-
        Capabilities: [200 v1] Vendor Specific Information: ID=1172 Rev=0 Len=044 <?>
        Capabilities: [300 v1] Secondary PCI Express
                LnkCtl3: LnkEquIntrruptEn-, PerformEqu-
                LaneErrStat: 0
        Kernel driver in use: avalon-dma
        Kernel modules: avalon_drv
</code>```

Corrupted state after ioread64():

00:00.0 PCI bridge: Synopsys, Inc. DWC_usb3 / PCIe bridge (rev 01) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0, IRQ 218
        Memory at 18000000 (32-bit, non-prefetchable) [size=1M]
        Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
        I/O behind bridge: [disabled]
        Memory behind bridge: [disabled]
        Prefetchable memory behind bridge: 18100000-181fffff [size=1M]
        Expansion ROM at 18200000 [virtual] [disabled] [size=64K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable+ Count=1/1 Maskable+ 64bit-
        Capabilities: [70] Express Root Port (Slot-), MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [148] Secondary PCI Express
        Capabilities: [158] L1 PM Substates
        Kernel driver in use: pcieport

01:00.0 RAM memory: Altera Corporation Device e001 (rev ff) (prog-if ff)
        !!! Unknown header type 7f
        Kernel driver in use: avalon-dma
        Kernel modules: avalon_drv
```

Do you know any restrictions available not to access PCIe bus as 64-bit on a 64-bit CPU with 64-bit OS? Or is there any special procedure that I need to follow to use ioread64()?

Explanation for @0andriy comment: I went through iMX8M-Plus reference manual and it says that it supports 32- and 64-bit PCI Express addresses and also 64 bit MSI at hardware level but I'm not sure if it is supported at Linux driver level. Do you know how I can be sure about it? About your question, The reason why I did choose to use ioreadXX/iowriteXX apis at the first place is that I have an example avalon dma driver and the driver accesses to the DMA registers in the FPGA which are mapped to BAR0 by using ioread32/iowrite32 apis. DMA and all MSI interrupts are working fine. Basically I followed the same approach. Only exception which is not used by the Avalon dma driver but in my custom driver was using ioread64/iowrite64 apis which I had problems there and trying to figure it out why.

Body:
I have a similar issue mentioned here but with a different behavior.

We have an FPGA (from Altera) acts as a 32KB memory on a PCIe bus of IMX8M-Plus CPU (ARM Cortex-A53).

I wrote a simple driver to access FPGA's memory. As you can see from lspci output below, 32KB memory mapped to Region 4 (BAR4) and I use avalon_ioctl_set_operation() and avalon_ioctl_get_operation() to get and set BAR content.

static int avalon_ioctl_get_operation(unsigned long arg, uint8_t op_size)
{
    struct avalon_pcie_operation o;

    if (copy_from_user(&o, (void __user*)arg, sizeof(o)))
        return -EFAULT;

    if (o.bar >= PCI_SRIOV_NUM_BARS)
        return -EFAULT;

    if (!io_dev.bar_addrs[o.bar])
        return -ENOMEM;

    if (!IS_ALIGNED(o.offset, op_size))
        return -EFAULT;

    switch (op_size)
    {
        case 1:
            o.data8 = ioread8(io_dev.bar_addrs[o.bar] + o.offset);
            break;
        case 2:
            o.data16 = ioread16(io_dev.bar_addrs[o.bar] + o.offset);
            break;
        case 4:
            o.data32 = ioread32(io_dev.bar_addrs[o.bar] + o.offset);
            break;
        case 8:
            o.data64 = ioread64(io_dev.bar_addrs[o.bar] + o.offset);
            break;
        default:
            return -EFAULT;
    }

    if (copy_to_user((void __user *)arg, &o, sizeof(o)))
        return -EFAULT;

    return 0;
}

static int avalon_ioctl_set_operation(unsigned long arg, uint8_t op_size)
{
    struct avalon_pcie_operation o;

    if (copy_from_user(&o, (void __user*)arg, sizeof(o)))
        return -EFAULT;

    if (o.bar >= PCI_SRIOV_NUM_BARS)
        return -EFAULT;

    if (!io_dev.bar_addrs[o.bar])
        return -ENOMEM;

    if (!IS_ALIGNED(o.offset, op_size))
        return -EFAULT;

    switch (op_size)
    {
        case 1:
            iowrite8(o.data8, io_dev.bar_addrs[o.bar] + o.offset);
            break;
        case 2:
            iowrite16(o.data16, io_dev.bar_addrs[o.bar] + o.offset);
            break;
        case 4:
            iowrite32(o.data32, io_dev.bar_addrs[o.bar] + o.offset);
            break;
        case 8:
            iowrite64(o.data64, io_dev.bar_addrs[o.bar] + o.offset);
            break;
        default:
            return -EFAULT;
    }

    return 0;
}

For my testing, I used BAR4 and offset 0. Whenever I call those functions for 8/16/32 bit variants of read/write all are working fine. I can read whatever I write.

But when I attempt to use iowrite64() and ioread64() from offset 0, I read garbage data (0xFFFFFFFFFFFFFFFF) and PCIe config page is altered and PCIe device stops functioning (you can see lspci output in the altered state at the bottom). And that is happening immediately after ioread64() function call.

I stepped into ioread64() function and saw that at the end it uses __raw_readq() which is defined as

static inline u64 __raw_readq(const volatile void __iomem *addr)
{
    u64 val;
    asm volatile(ALTERNATIVE("ldr %0, [%1]",
                 "ldar %0, [%1]",
                 ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE)
             : "=r" (val) : "r" (addr));
    return val;
}

We use Linux v5.4 aarch64, I believe that accessing to a bus as a 64-bit should be fine.

uname -a
Linux 5.4.193-0+git.a301219f58a2 #1 SMP PREEMPT Thu Dec 15 14:09:11 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

Here is the lspci -vv output at the beginning of the test:

00:00.0 PCI bridge: Synopsys, Inc. DWC_usb3 / PCIe bridge (rev 01) (prog-if 00 [Normal decode])
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Interrupt: pin A routed to IRQ 218
        Region 0: Memory at 18000000 (32-bit, non-prefetchable) [size=1M]
        Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
        I/O behind bridge: [disabled]
        Memory behind bridge: [disabled]
        Prefetchable memory behind bridge: 18100000-181fffff [size=1M]
        Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
        Expansion ROM at 18200000 [virtual] [disabled] [size=64K]
        BridgeCtl: Parity- SERR+ NoISA- VGA- VGA16- MAbort- >Reset- FastB2B-
                PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
        Capabilities: [40] Power Management version 3
                Flags: PMEClk- DSI- D1+ D2- AuxCurrent=375mA PME(D0+,D1+,D2-,D3hot+,D3cold+)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [50] MSI: Enable+ Count=1/1 Maskable+ 64bit-
                Address: bc022000  Data: 0000
                Masking: 00000000  Pending: 00000000
        Capabilities: [70] Express (v2) Root Port (Slot-), MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0
                        ExtTag- RBE+
                DevCtl: CorrErr+ NonFatalErr+ FatalErr+ UnsupReq+
                        RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
                        MaxPayload 128 bytes, MaxReadReq 512 bytes
                DevSta: CorrErr+ NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
                LnkCap: Port #0, Speed 8GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <1us, L1 <8us
                        ClockPM- Surprise- LLActRep+ BwNot+ ASPMOptComp+
                LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk-
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 8GT/s (ok), Width x1 (ok)
                        TrErr- Train- SlotClk+ DLActive+ BWMgmt- ABWMgmt+
                RootCap: CRSVisible+
                RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna+ CRSVisible+
                RootSta: PME ReqID 0000, PMEStatus- PMEPending-
                DevCap2: Completion Timeout: Range ABCD, TimeoutDis+, NROPrPrP+, LTR-
                         10BitTagComp-, 10BitTagReq-, OBFF Not Supported, ExtFmt-, EETLPPrefix-
                         EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
                         FRS-, LN System CLS Not Supported, TPHComp-, ExtTPHComp-, ARIFwd-
                         AtomicOpsCap: Routing- 32bit- 64bit- 128bitCAS-
                DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled ARIFwd-
                         AtomicOpsCtl: ReqEn- EgressBlck-
                LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis-
                         Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
                         Compliance De-emphasis: -6dB
                LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete+, EqualizationPhase1+
                         EqualizationPhase2+, EqualizationPhase3+, LinkEqualizationRequest-
        Capabilities: [100 v2] Advanced Error Reporting
                UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
                CESta:  RxErr+ BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
                CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
                AERCap: First Error Pointer: 00, ECRCGenCap+ ECRCGenEn- ECRCChkCap+ ECRCChkEn-
                        MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
                HeaderLog: 00000000 00000000 00000000 00000000
                RootCmd: CERptEn+ NFERptEn+ FERptEn+
                RootSta: CERcvd+ MultCERcvd+ UERcvd- MultUERcvd-
                         FirstFatal- NonFatalMsg- FatalMsg- IntMsg 0
                ErrorSrc: ERR_COR: 0000 ERR_FATAL/NONFATAL: 0000
        Capabilities: [148 v1] Secondary PCI Express
                LnkCtl3: LnkEquIntrruptEn-, PerformEqu-
                LaneErrStat: 0
        Capabilities: [158 v1] L1 PM Substates
                L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2- ASPM_L1.1+ L1_PM_Substates+
                          PortCommonModeRestoreTime=10us PortTPowerOnTime=10us
                L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2- ASPM_L1.1-
                           T_CommonMode=10us
                L1SubCtl2: T_PwrOn=10us
        Kernel driver in use: pcieport

01:00.0 RAM memory: Altera Corporation Device e001
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Interrupt: pin A routed to IRQ 219
        Region 0: Memory at 18108000 (64-bit, prefetchable) [size=512]
        Region 4: Memory at 18100000 (64-bit, prefetchable) [size=32K]
        Capabilities: [50] MSI: Enable+ Count=1/4 Maskable- 64bit+
                Address: 00000000bc022000  Data: 0001
        Capabilities: [78] Power Management version 3
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [80] Express (v2) Endpoint, MSI 00
                DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 0.000W
                DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
                        RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
                        MaxPayload 128 bytes, MaxReadReq 512 bytes
                DevSta: CorrErr+ NonFatalErr- FatalErr- UnsupReq- AuxPwr- TransPend-
                LnkCap: Port #1, Speed 8GT/s, Width x2, ASPM not supported
                        ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp+
                LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk-
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 8GT/s (ok), Width x1 (downgraded)
                        TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
                DevCap2: Completion Timeout: Not Supported, TimeoutDis+, NROPrPrP-, LTR-
                         10BitTagComp-, 10BitTagReq-, OBFF Not Supported, ExtFmt+, EETLPPrefix-
                         EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
                         FRS-, TPHComp-, ExtTPHComp-
                         AtomicOpsCap: 32bit- 64bit- 128bitCAS-
                DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
                         AtomicOpsCtl: ReqEn-
                LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis-
                         Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
                         Compliance De-emphasis: -6dB
                LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete+, EqualizationPhase1+
                         EqualizationPhase2+, EqualizationPhase3+, LinkEqualizationRequest-
        Capabilities: [100 v1] Virtual Channel
                Caps:   LPEVC=0 RefClk=100ns PATEntryBits=1
                Arb:    Fixed- WRR32- WRR64- WRR128-
                Ctrl:   ArbSelect=Fixed
                Status: InProgress-
                VC0:    Caps:   PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
                        Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
                        Ctrl:   Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
                        Status: NegoPending- InProgress-
        Capabilities: [200 v1] Vendor Specific Information: ID=1172 Rev=0 Len=044 <?>
        Capabilities: [300 v1] Secondary PCI Express
                LnkCtl3: LnkEquIntrruptEn-, PerformEqu-
                LaneErrStat: 0
        Kernel driver in use: avalon-dma
        Kernel modules: avalon_drv

Corrupted state after ioread64():

00:00.0 PCI bridge: Synopsys, Inc. DWC_usb3 / PCIe bridge (rev 01) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0, IRQ 218
        Memory at 18000000 (32-bit, non-prefetchable) [size=1M]
        Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
        I/O behind bridge: [disabled]
        Memory behind bridge: [disabled]
        Prefetchable memory behind bridge: 18100000-181fffff [size=1M]
        Expansion ROM at 18200000 [virtual] [disabled] [size=64K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable+ Count=1/1 Maskable+ 64bit-
        Capabilities: [70] Express Root Port (Slot-), MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [148] Secondary PCI Express
        Capabilities: [158] L1 PM Substates
        Kernel driver in use: pcieport

01:00.0 RAM memory: Altera Corporation Device e001 (rev ff) (prog-if ff)
        !!! Unknown header type 7f
        Kernel driver in use: avalon-dma
        Kernel modules: avalon_drv

Do you know any restrictions available not to access PCIe bus as 64-bit on a 64-bit CPU with 64-bit OS? Or is there any special procedure that I need to follow to use ioread64()?

Explanation for @0andriy comment: I went through iMX8M-Plus reference manual and it says that it supports 32- and 64-bit PCI Express addresses and also 64 bit MSI at hardware level but I'm not sure if it is supported at Linux driver level. Do you know how I can be sure about it? About your question, The reason why I did choose to use ioreadXX/iowriteXX apis at the first place is that I have an example avalon dma driver and the driver accesses to the DMA registers in the FPGA which are mapped to BAR0 by using ioread32/iowrite32 apis. DMA and all MSI interrupts are working fine. Basically I followed the same approach. Only exception which is not used by the Avalon dma driver but in my custom driver was using ioread64/iowrite64 apis which I had problems there and trying to figure it out why.


Title: Why is Jupyter suddenly showing dataframe as text-based?

Body:
I've used jupyter notebook for a while now and if I do df.head() it always returns a nicely formatted table format. now I called the data and I get this!?? why? and how do I fix it?

import pandas as pd

df = pd.read_csv("df.csv")

df.head()

   Unnamed: 0                                     address    date  \
0           0  0x0000000000000000000000000000000000000000  2016Q3
1           1  0x0000000000000000000000000000000000000000  2016Q4
2           2  0x0000000000000000000000000000000000000000  2016Q4
3           3  0x0000000000000000000000000000000000000000  2017Q1
4           4  0x0000000000000000000000000000000000000000  2017Q1

                                token_address       balance  decimals  \
0  0xd8912c10681d8b21fd3742244f44658dba12264e  2.000000e+19      18.0
1  0xd8912c10681d8b21fd3742244f44658dba12264e  2.060000e+19      18.0
2  0xe0b7927c4af23765cb51314a0e0521a9645f0e2a  4.500000e+11       9.0
3  0xd8912c10681d8b21fd3742244f44658dba12264e  2.060000e+19      18.0
4  0xe0b7927c4af23765cb51314a0e0521a9645f0e2a  4.571544e+11       9.0

   token_price   tokens_USD
0      1.99522    39.904400
1      1.39913    28.822078
2      8.53556  3841.002000
3      1.33777    27.558062
4     19.42000  8877.938149

I have tried the following but to no avail.

from IPython.display import display
display(df)