统信UOS_arm64开发环境配置


硬币欣喜
硬币欣喜 2022-09-29 09:42:33 50677
分类专栏: 资讯

统信UOS开发机器配置

一、配置ssh远程登陆并设置为开机自启动

(1)sudo vim /etc/ssh/sshd_config
修改以下三行
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
(2)systemctl enable ssh
update-rc.d ssh enable 2 3 4 5
service sshd restart

二、安装开发环境所用的包

安装PyQt4

安装pyqt4–采用apt-get在线安装

sudo apt-get install libxext6 libxext-dev libqt4-dev libqt4-gui libqt4-sql  libqt4-gui不可用
sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos qt4-designer
sudo apt-get install python-qt4
sudo apt-get install python-qt4-*
sudo apt-get install python-qscintilla2

 下面四行表示python3,可以不用安装
sudo apt-get install python3-pyqt4
sudo apt-get install python3-pyqt4.qsci
sudo apt-get install python3-pyqt4.qtsql
sudo apt-get install python3-pyqt4.phonon
ot;spm":"1001.2101.3001.4334"}">
  • 1
  • 2
  • 3
  • 4

仓库中只有三个版本from versions: 3.4.0.14, 3.4.10.37, 4.3.0.38,其中适用于py2的只有3.4.0.14

pip install opencv-python==3.4.0.14
  • 1

但是最后会报错导致安装失败,暂时还未找到原因。

  • 源码安装

    sudo apt-get install cmake g++
     安装gtk2支持
    sudo apt-get install libgtk2.0-dev
     安装gtk3支持
    sudo apt-get install libgtk-3-dev
    
    • 1
    • 2
    • 3
    • 4
    • 5

    使用opencv-3.4.1.zip源码包,放置到~/need_install/3opencv下

    cd ~/need_install/3opencv
    unzip opencv-3.4.1.zip
    cd opencv-3.4.1
    mkdir build 
    cd build
    cmake -D WITH_GTK_2_X=ON ..
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    这里我只加了WITH_GTK_2_X=ON的编译选项,表示使用GTK2。
    这里未指定安装位置,则采用默认位置安装,则会安装到系统如下目录:
    /usr/local/bin
    /usr/local/lib
    /usr/local/share
    后面的两个点表示上级目录,不能省略。

    cmake完成后,会出现如下结果:

    -- General configuration for OpenCV 3.4.1 =====================================
    --   Version control:               unknown
    -- 
    --   Platform:
    --     Timestamp:                   2021-12-15T02:38:04Z
    --     Host:                        Linux 4.19.0-arm64-desktop aarch64
    --     CMake:                       3.13.4
    --     CMake generator:             Unix Makefiles
    --     CMake build tool:            /usr/bin/make
    --     Configuration:               Release
    -- 
    --   CPU/HW features:
    --     Baseline:                    NEON FP16
    --       required:                  NEON
    --       disabled:                  VFPV3
    -- 
    --   C/C++:
    --     Built as dynamic libs?:      YES
    --     C++11:                       YES
    --     C++ Compiler:                /usr/bin/c++  (ver 8.3.0)
    --     C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -Wno-implicit-fallthrough -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    --     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -Wno-implicit-fallthrough -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    --     C Compiler:                  /usr/bin/cc
    --     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -Wno-implicit-fallthrough -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    --     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -Wno-implicit-fallthrough -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    --     Linker flags (Release):      
    --     Linker flags (Debug):        
    --     ccache:                      NO
    --     Precompiled headers:         YES
    --     Extra dependencies:          dl m pthread rt
    --     3rdparty dependencies:
    -- 
    --   OpenCV modules:
    --     To be built:                 calib3d core dnn features2d flann highgui imgcodecs imgproc java_bindings_generator ml objdetect photo python2 python_bindings_generator shape stitching superres ts video videoio videostab
    --     Disabled:                    js world
    --     Disabled by dependency:      -
    --     Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python3 viz
    --     Applications:                tests perf_tests apps
    --     Documentation:               NO
    --     Non-free algorithms:         NO
    -- 
    --   GUI: 
    --     GTK+:                        YES (ver 2.24.32)
    --       GThread :                  YES (ver 2.58.3)
    --       GtkGlExt:                  NO
    --     VTK support:                 NO
    -- 
    --   Media I/O: 
    --     ZLib:                        /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
    --     JPEG:                        /usr/lib/aarch64-linux-gnu/libjpeg.so (ver )
    --     WEBP:                        build (ver encoder: 0x020e)
    --     PNG:                         /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.36)
    --     TIFF:                        /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.1.0)
    --     JPEG 2000:                   build (ver 1.900.1)
    --     OpenEXR:                     /usr/lib/aarch64-linux-gnu/libImath.so /usr/lib/aarch64-linux-gnu/libIlmImf.so /usr/lib/aarch64-linux-gnu/libIex.so /usr/lib/aarch64-linux-gnu/libHalf.so /usr/lib/aarch64-linux-gnu/libIlmThread.so (ver 2.2.1)
    -- 
    --   Video I/O:
    --     DC1394:                      YES (ver 2.2.5)
    --     FFMPEG:                      YES
    --       avcodec:                   YES (ver 58.35.100)
    --       avformat:                  YES (ver 58.20.100)
    --       avutil:                    YES (ver 56.22.100)
    --       swscale:                   YES (ver 5.3.100)
    --       avresample:                YES (ver 4.0.0)
    --     GStreamer:                   NO
    --     libv4l/libv4l2:              NO
    --     v4l/v4l2:                    linux/videodev2.h
    --     gPhoto2:                     YES
    -- 
    --   Parallel framework:            pthreads
    -- 
    --   Trace:                         YES (built-in)
    -- 
    --   Other third-party libraries:
    --     Lapack:                      NO
    --     Eigen:                       NO
    --     Custom HAL:                  YES (carotene (ver 0.0.1))
    --     Protobuf:                    build (3.5.1)
    -- 
    --   NVIDIA CUDA:                   NO
    -- 
    --   OpenCL:                        YES (no extra features)
    --     Include path:                /home/gw1/need_install/3opencv/opencv-3.4.1/3rdparty/include/opencl/1.2
    --     Link libraries:              Dynamic load
    -- 
    --   Python 2:
    --     Interpreter:                 /usr/bin/python2.7 (ver 2.7.16)
    --     Libraries:                   /usr/lib/aarch64-linux-gnu/libpython2.7.so (ver 2.7.16)
    --     numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.16.2)
    --     packages path:               lib/python2.7/dist-packages
    -- 
    --   Python (for build):            /usr/bin/python2.7
    -- 
    --   Java:                          
    --     ant:                         NO
    --     JNI:                         NO
    --     Java wrappers:               NO
    --     Java tests:                  NO
    -- 
    --   Matlab:                        NO
    -- 
    --   Install to:                    /usr/local
    -- -----------------------------------------------------------------
    -- 
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/gw1/need_install/3opencv/opencv-3.4.1/build
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107

    其中GTK+: YES (ver 2.24.32)表示使用GTK2,Python 2InterpreterLibrariesnumpypackages path都有相应目录则表示成功找到python2,否则最后在python中import cv2会失败。

    make -j4
    sudo make install
    
    • 1
    • 2
  • 上述三种方式中,我采用了源码安装,安装完成后,可通过python -c "import cv2; print(cv2.getBuildInformation())"查看编译选项,通过如下验证python中是否可调用:

    gw1@gw1-PC:~$ python
    Python 2.7.16 (default, Feb 26 2021, 06:12:30) 
    [GCC 8.3.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import cv2
    >>> cv2.__version__
    '3.4.1'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    安装视频捕获接口包

    sudo apt-get install v4l-utils
    
    • 1

    三、关于卸载opencv-python

    如果采用apt-get安装,卸载命令为sudo apt-get remove python-opencv
    如果采用源码安装,则采用如下命令:

    cd ~/need_install/3opencv/opencv-3.4.1/build
    sudo make uninstall
    sudo make clean
    cd ..
    sudo rm -r build
    sudo rm -r 
    /usr/local/include/opencv2 \
    /usr/local/include/opencv \
    /usr/include/opencv \
    /usr/include/opencv2 \
    /usr/local/share/opencv \
    /usr/local/share/OpenCV \
    /usr/share/opencv \
    /usr/share/OpenCV \
    /usr/local/bin/opencv* \
    /usr/local/lib/libopencv*
    
    cd /usr/
    find . -name "*opencv*" | xargs sudo rm -rf
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19

    统信终端机配置

    终端机需要安装v4l-utils_1.16.3-3_arm64.deb包,其依赖包libv4l2rds0_1.16.3-3_arm64.deb也没有同样需要安装。

    网站声明:如果转载,请联系本站管理员。否则一切后果自行承担。

    本文链接:https://www.xckfsq.com/news/show.html?id=10822
    赞同 0
    评论 0 条
    硬币欣喜L0
    粉丝 0 发表 6 + 关注 私信
    上周热门
    如何使用 StarRocks 管理和优化数据湖中的数据?  2944
    【软件正版化】软件正版化工作要点  2864
    统信UOS试玩黑神话:悟空  2823
    信刻光盘安全隔离与信息交换系统  2718
    镜舟科技与中启乘数科技达成战略合作,共筑数据服务新生态  1251
    grub引导程序无法找到指定设备和分区  1217
    华为全联接大会2024丨软通动力分论坛精彩议程抢先看!  164
    点击报名 | 京东2025校招进校行程预告  163
    2024海洋能源产业融合发展论坛暨博览会同期活动-海洋能源与数字化智能化论坛成功举办  161
    华为纯血鸿蒙正式版9月底见!但Mate 70的内情还得接着挖...  157
    本周热议
    我的信创开放社区兼职赚钱历程 40
    今天你签到了吗? 27
    信创开放社区邀请他人注册的具体步骤如下 15
    如何玩转信创开放社区—从小白进阶到专家 15
    方德桌面操作系统 14
    我有15积分有什么用? 13
    用抖音玩法闯信创开放社区——用平台宣传企业产品服务 13
    如何让你先人一步获得悬赏问题信息?(创作者必看) 12
    2024中国信创产业发展大会暨中国信息科技创新与应用博览会 9
    中央国家机关政府采购中心:应当将CPU、操作系统符合安全可靠测评要求纳入采购需求 8

    加入交流群

    请使用微信扫一扫!