【C++】CentOS环境搭建-编译安装Boost库(附CMAKE编译文件)

【C++】环境搭建-编译安装Boost库

  • Boost库简介
  • Boost库安装
    • 通过YUM安装(版本较低 V1.53.0)
    • 通过编译安装(官网最新版本1.85.0)
      • 1.安装相关依赖
      • 2.查询官网下载最新安装包并解压
      • 3.编译Boost
      • 4.安装Boost库到系统路径
  • Boost库验证

Boost库简介

Boost库是为C++语言标准库提供扩展的一些C++程序库的总称。
Boost库由Boost社区组织开发、维护。其目的是为C++程序员提供免费、同行审查的、可移植的程序库。Boost库可以与C++标准库共同工作,并且为其提供扩展功能。Boost库使用Boost License来授权使用,根据该协议,商业或非商业的使用都是允许并鼓励的。
Boost社区建立的初衷之一就是为C++的标准化工作提供可供参考的实现,Boost社区的发起人Dawes本人就是C++标准委员会的成员之一。在Boost库的开发中,Boost社区也在这个方向上取得了丰硕的成果。在送审的C++标准库TR1中,有十个Boost库成为标准库的候选方案。在更新的TR2中,有更多的Boost库被加入到其中。从某种意义上来讲,Boost库成为具有实践意义的准标准库。
大部分boost库功能的使用只需包括相应头文件即可,少数(如正则表达式库,文件系统库等)需要链接库。里面有许多具有工业强度的库,如graph库。
很多Boost中的库功能堪称对语言功能的扩展,其构造用尽精巧的手法,不要贸然的花费时间研读。Boost另外一面,比如Graph这样的库则是具有工业强度,结构良好,非常值得研读的精品代码,并且也可以放心的在产品代码中多多利用。

Boost库安装

通过YUM安装(版本较低 V1.53.0)

  1. 升级YUM到最新版本
sudo yum update
  1. 安装boost开发版
sudo yum install boost-devel

安装效果如下:

[root@localhost ~]# sudo yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.ustc.edu.cn* extras: mirrors.ustc.edu.cn* updates: mirrors.ustc.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package NetworkManager.x86_64 1:1.18.8-1.el7 will be updated
---> Package NetworkManager.x86_64 1:1.18.8-2.el7_9 will be an update
---> Package NetworkManager-libnm.x86_64 1:1.18.8-1.el7 will be updated
---> Package NetworkManager-libnm.x86_64 1:1.18.8-2.el7_9 will be an update
---> Package NetworkManager-team.x86_64 1:1.18.8-1.el7 will be updated
---> Package NetworkManager-team.x86_64 1:1.18.8-2.el7_9 will be an update
---> Package NetworkManager-tui.x86_64 1:1.18.8-1.el7 will be updated
---> Package NetworkManager-tui.x86_64 1:1.18.8-2.el7_9 will be an update
---> Package bash.x86_64 0:4.2.46-34.el7 will be updated
---> Package bash.x86_64 0:4.2.46-35.el7_9 will be an update
---> Package bind-export-libs.x86_64 32:9.11.4-26.P2.el7 will be updated
---> Package bind-export-libs.x86_64 32:9.11.4-26.P2.el7_9.15 will be an update
---> Package binutils.x86_64 0:2.27-44.base.el7 will be updated
---> Package binutils.x86_64 0:2.27-44.base.el7_9.1 will be an update
---> Package ca-certificates.noarch 0:2020.2.41-70.0.el7_8 will be updated
---> Package ca-certificates.noarch 0:2023.2.60_v7.0.306-72.el7_9 will be an update
---> Package centos-release.x86_64 0:7-9.2009.0.el7.centos will be updated
---> Package centos-release.x86_64 0:7-9.2009.1.el7.centos will be an update
---> Package coreutils.x86_64 0:8.22-24.el7 will be updated
---> Package coreutils.x86_64 0:8.22-24.el7_9.2 will be an update
---> Package cronie.x86_64 0:1.4.11-23.el7 will be updated
---> Package cronie.x86_64 0:1.4.11-25.el7_9 will be an update
---> Package cronie-anacron.x86_64 0:1.4.11-23.el7 will be updated
---> Package cronie-anacron.x86_64 0:1.4.11-25.el7_9 will be an update
---> Package cyrus-sasl-lib.x86_64 0:2.1.26-23.el7 will be updated
---> Package cyrus-sasl-lib.x86_64 0:2.1.26-24.el7_9 will be an update
---> Package device-mapper.x86_64 7:1.02.170-6.el7 will be updated
---> Package device-mapper.x86_64 7:1.02.170-6.el7_9.5 will be an update
---> Package device-mapper-event.x86_64 7:1.02.170-6.el7 will be updated
---> Package device-mapper-event.x86_64 7:1.02.170-6.el7_9.5 will be an update
---> Package device-mapper-event-libs.x86_64 7:1.02.170-6.el7 will be updated
---> Package device-mapper-event-libs.x86_64 7:1.02.170-6.el7_9.5 will be an update
---> Package device-mapper-libs.x86_64 7:1.02.170-6.el7 will be updated
---> Package device-mapper-libs.x86_64 7:1.02.170-6.el7_9.5 will be an update
---> Package device-mapper-persistent-data.x86_64 0:0.8.5-3.el7 will be updated
---> Package device-mapper-persistent-data.x86_64 0:0.8.5-3.el7_9.2 will be an update
---> Package dhclient.x86_64 12:4.2.5-82.el7.centos will be updated
---> Package dhclient.x86_64 12:4.2.5-83.el7.centos.1 will be an update
---> Package dhcp-common.x86_64 12:4.2.5-82.el7.centos will be updated
---> Package dhcp-common.x86_64 12:4.2.5-83.el7.centos.1 will be an update
---> Package dhcp-libs.x86_64 12:4.2.5-82.el7.centos will be updated
---> Package dhcp-libs.x86_64 12:4.2.5-83.el7.centos.1 will be an update
---> Package diffutils.x86_64 0:3.3-5.el7 will be updated
---> Package diffutils.x86_64 0:3.3-6.el7_9 will be an update
---> Package dmidecode.x86_64 1:3.2-5.el7 will be updated
---> Package dmidecode.x86_64 1:3.2-5.el7_9.1 will be an update
---> Package firewalld.noarch 0:0.6.3-11.el7 will be updated
---> Package firewalld.noarch 0:0.6.3-13.el7_9 will be an update
---> Package firewalld-filesystem.noarch 0:0.6.3-11.el7 will be updated
---> Package firewalld-filesystem.noarch 0:0.6.3-13.el7_9 will be an update
---> Package freetype.x86_64 0:2.8-14.el7 will be updated
---> Package freetype.x86_64 0:2.8-14.el7_9.1 will be an update
---> Package glib2.x86_64 0:2.56.1-7.el7 will be updated
---> Package glib2.x86_64 0:2.56.1-9.el7_9 will be an update
---> Package grub2.x86_64 1:2.02-0.86.el7.centos will be updated
---> Package grub2.x86_64 1:2.02-0.87.0.2.el7.centos.14 will be an update
---> Package grub2-common.noarch 1:2.02-0.86.el7.centos will be updated
---> Package grub2-common.noarch 1:2.02-0.87.0.2.el7.centos.14 will be an update
---> Package grub2-pc.x86_64 1:2.02-0.86.el7.centos will be updated
---> Package grub2-pc.x86_64 1:2.02-0.87.0.2.el7.centos.14 will be an update
---> Package grub2-pc-modules.noarch 1:2.02-0.86.el7.centos will be updated
---> Package grub2-pc-modules.noarch 1:2.02-0.87.0.2.el7.centos.14 will be an 
.....
pdated:NetworkManager.x86_64 1:1.18.8-2.el7_9                    NetworkManager-libnm.x86_64 1:1.18.8-2.el7_9          NetworkManager-team.x86_64 1:1.18.8-2.el7_9            NetworkManager-tui.x86_64 1:1.18.8-2.el7_9                bash.x86_64 0:4.2.46-35.el7_9                         bind-export-libs.x86_64 32:9.11.4-26.P2.el7_9.15       binutils.x86_64 0:2.27-44.base.el7_9.1                    ca-certificates.noarch 0:2023.2.60_v7.0.306-72.el7_9  centos-release.x86_64 0:7-9.2009.1.el7.centos          coreutils.x86_64 0:8.22-24.el7_9.2                        cronie.x86_64 0:1.4.11-25.el7_9                       cronie-anacron.x86_64 0:1.4.11-25.el7_9                cyrus-sasl-lib.x86_64 0:2.1.26-24.el7_9                   device-mapper.x86_64 7:1.02.170-6.el7_9.5             device-mapper-event.x86_64 7:1.02.170-6.el7_9.5        device-mapper-event-libs.x86_64 7:1.02.170-6.el7_9.5      device-mapper-libs.x86_64 7:1.02.170-6.el7_9.5        device-mapper-persistent-data.x86_64 0:0.8.5-3.el7_9.2 dhclient.x86_64 12:4.2.5-83.el7.centos.1                  dhcp-common.x86_64 12:4.2.5-83.el7.centos.1           dhcp-libs.x86_64 12:4.2.5-83.el7.centos.1              diffutils.x86_64 0:3.3-6.el7_9                            dmidecode.x86_64 1:3.2-5.el7_9.1                      firewalld.noarch 0:0.6.3-13.el7_9                      firewalld-filesystem.noarch 0:0.6.3-13.el7_9              freetype.x86_64 0:2.8-14.el7_9.1                      glib2.x86_64 0:2.56.1-9.el7_9                          grub2.x86_64 1:2.02-0.87.0.2.el7.centos.14                grub2-common.noarch 1:2.02-0.87.0.2.el7.centos.14     grub2-pc.x86_64 1:2.02-0.87.0.2.el7.centos.14          grub2-pc-modules.noarch 1:2.02-0.87.0.2.el7.centos.14     grub2-tools.x86_64 1:2.02-0.87.0.2.el7.centos.14      grub2-tools-extra.x86_64 1:2.02-0.87.0.2.el7.centos.14 grub2-tools-minimal.x86_64 1:2.02-0.87.0.2.el7.centos.14  gzip.x86_64 0:1.5-11.el7_9                            initscripts.x86_64 0:9.49.53-1.el7_9.1                 iprutils.x86_64 0:2.4.17.1-3.el7_7                        iwl100-firmware.noarch 0:39.31.5.1-82.el7_9           iwl1000-firmware.noarch 1:39.31.5.1-82.el7_9           iwl105-firmware.noarch 0:18.168.6.1-82.el7_9              iwl135-firmware.noarch 0:18.168.6.1-82.el7_9          iwl2000-firmware.noarch 0:18.168.6.1-82.el7_9          iwl2030-firmware.noarch 0:18.168.6.1-82.el7_9             iwl3160-firmware.noarch 0:25.30.13.0-82.el7_9         iwl3945-firmware.noarch 0:15.32.2.9-82.el7_9           iwl4965-firmware.noarch 0:228.61.2.24-82.el7_9            iwl5000-firmware.noarch 0:8.83.5.1_1-82.el7_9         iwl5150-firmware.noarch 0:8.24.2.2-82.el7_9            iwl6000-firmware.noarch 0:9.221.4.1-82.el7_9              iwl6000g2a-firmware.noarch 0:18.168.6.1-82.el7_9      iwl6000g2b-firmware.noarch 0:18.168.6.1-82.el7_9       iwl6050-firmware.noarch 0:41.28.5.1-82.el7_9              iwl7260-firmware.noarch 0:25.30.13.0-82.el7_9         kbd.x86_64 0:1.15.5-16.el7_9                           kbd-legacy.noarch 0:1.15.5-16.el7_9                       kbd-misc.noarch 0:1.15.5-16.el7_9                     kernel-tools.x86_64 0:3.10.0-1160.118.1.el7            kernel-tools-libs.x86_64 0:3.10.0-1160.118.1.el7          kexec-tools.x86_64 0:2.0.15-51.el7_9.3                kpartx.x86_64 0:0.4.9-136.el7_9                        libblkid.x86_64 0:2.23.2-65.el7_9.1                       libcroco.x86_64 0:0.6.12-6.el7_9                      libmount.x86_64 0:2.23.2-65.el7_9.1                    libsmartcols.x86_64 0:2.23.2-65.el7_9.1                   libssh2.x86_64 0:1.8.0-4.el7_9.1                      libuuid.x86_64 0:2.23.2-65.el7_9.1                     libxml2.x86_64 0:2.9.1-6.el7_9.6                          linux-firmware.noarch 0:20200421-82.git78c0348.el7_9  lvm2.x86_64 7:2.02.187-6.el7_9.5                       lvm2-libs.x86_64 7:2.02.187-6.el7_9.5                     microcode_ctl.x86_64 2:2.1-73.20.el7_9                nspr.x86_64 0:4.35.0-1.el7_9                           nss.x86_64 0:3.90.0-2.el7_9                               nss-pem.x86_64 0:1.0.3-7.el7_9.1                      nss-softokn.x86_64 0:3.90.0-6.el7_9                    nss-softokn-freebl.x86_64 0:3.90.0-6.el7_9                nss-sysinit.x86_64 0:3.90.0-2.el7_9                   nss-tools.x86_64 0:3.90.0-2.el7_9                      nss-util.x86_64 0:3.90.0-1.el7_9                          openldap.x86_64 0:2.4.44-25.el7_9                     openssh.x86_64 0:7.4p1-23.el7_9                        openssh-clients.x86_64 0:7.4p1-23.el7_9                   openssh-server.x86_64 0:7.4p1-23.el7_9                polkit.x86_64 0:0.112-26.el7_9.1                       python.x86_64 0:2.7.5-94.el7_9                            python-firewall.noarch 0:0.6.3-13.el7_9               python-libs.x86_64 0:2.7.5-94.el7_9                    python-perf.x86_64 0:3.10.0-1160.118.1.el7                rpm.x86_64 0:4.11.3-48.el7_9                          rpm-build-libs.x86_64 0:4.11.3-48.el7_9                rpm-libs.x86_64 0:4.11.3-48.el7_9                         rpm-python.x86_64 0:4.11.3-48.el7_9                   rsyslog.x86_64 0:8.24.0-57.el7_9.3                     selinux-policy.noarch 0:3.13.1-268.el7_9.2                selinux-policy-targeted.noarch 0:3.13.1-268.el7_9.2   sudo.x86_64 0:1.8.23-10.el7_9.3                        systemd.x86_64 0:219-78.el7_9.9                           systemd-libs.x86_64 0:219-78.el7_9.9                  systemd-sysv.x86_64 0:219-78.el7_9.9                   tuned.noarch 0:2.11.0-12.el7_9                            tzdata.noarch 0:2024a-1.el7                           util-linux.x86_64 0:2.23.2-65.el7_9.1                  vim-minimal.x86_64 2:7.4.629-8.el7_9                      virt-what.x86_64 0:1.18-4.el7_9.1                     wpa_supplicant.x86_64 1:2.6-12.el7_9.2                 xz.x86_64 0:5.2.2-2.el7_9                                 xz-libs.x86_64 0:5.2.2-2.el7_9                       Complete!
root@localhost ~]# sudo yum install boost-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.ustc.edu.cn* extras: mirrors.ustc.edu.cn* updates: mirrors.ustc.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package boost-devel.x86_64 0:1.53.0-28.el7 will be installed
--> Processing Dependency: boost(x86-64) = 1.53.0-28.el7 for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_wserialization.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_wserialization-mt.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_wave.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_wave-mt.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_unit_test_framework.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_unit_test_framework-mt.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_timer.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_timer-mt.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_system.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_system-mt.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_signals.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_signals-mt.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_serialization.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_serialization-mt.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_regex.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_regex-mt.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_random.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_random-mt.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_python.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_python-mt.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_program_options.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_program_options-mt.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_prg_exec_monitor.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_prg_exec_monitor-mt.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_math_tr1l.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_math_tr1l-mt.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64
--> Processing Dependency: libboost_math_tr1f.so.1.53.0()(64bit) for package: boost-devel-1.53.0-28.el7.x86_64Verifying  : boost-test-1.53.0-28.el7.x86_64                                                                                                                      19/23 Verifying  : boost-math-1.53.0-28.el7.x86_64                                                                                                                      20/23 Verifying  : boost-chrono-1.53.0-28.el7.x86_64                                                                                                                    21/23 Verifying  : boost-1.53.0-28.el7.x86_64                                                                                                                           22/23 Verifying  : boost-filesystem-1.53.0-28.el7.x86_64                                                                                                                23/23 Installed:boost-devel.x86_64 0:1.53.0-28.el7                                                                                                                                      Dependency Installed:boost.x86_64 0:1.53.0-28.el7            boost-atomic.x86_64 0:1.53.0-28.el7      boost-chrono.x86_64 0:1.53.0-28.el7           boost-context.x86_64 0:1.53.0-28.el7   boost-date-time.x86_64 0:1.53.0-28.el7  boost-filesystem.x86_64 0:1.53.0-28.el7  boost-graph.x86_64 0:1.53.0-28.el7            boost-iostreams.x86_64 0:1.53.0-28.el7 boost-locale.x86_64 0:1.53.0-28.el7     boost-math.x86_64 0:1.53.0-28.el7        boost-program-options.x86_64 0:1.53.0-28.el7  boost-python.x86_64 0:1.53.0-28.el7    boost-random.x86_64 0:1.53.0-28.el7     boost-regex.x86_64 0:1.53.0-28.el7       boost-serialization.x86_64 0:1.53.0-28.el7    boost-signals.x86_64 0:1.53.0-28.el7   boost-system.x86_64 0:1.53.0-28.el7     boost-test.x86_64 0:1.53.0-28.el7        boost-thread.x86_64 0:1.53.0-28.el7           boost-timer.x86_64 0:1.53.0-28.el7     boost-wave.x86_64 0:1.53.0-28.el7       libicu.x86_64 0:50.2-4.el7_7            Complete!
[root@localhost ~]# 
.....

通过YUM安装的Boost版本为1.53,目前官网的版本为1.85,接下来我们通过编译安装Boost1.85

卸载命令

yum remove boost-devel

效果如下:

[root@localhost ~]# yum remove boost-devel
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package boost-devel.x86_64 0:1.53.0-28.el7 will be erased
--> Finished Dependency ResolutionDependencies Resolved==========================================================================================================================================================================Package                                    Arch                                  Version                                      Repository                            Size
==========================================================================================================================================================================
Removing:boost-devel                                x86_64                                1.53.0-28.el7                                @base                                 85 MTransaction Summary
==========================================================================================================================================================================
Remove  1 PackageInstalled size: 85 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionErasing    : boost-devel-1.53.0-28.el7.x86_64                                                                                                                       1/1 Verifying  : boost-devel-1.53.0-28.el7.x86_64                                                                                                                       1/1 Removed:boost-devel.x86_64 0:1.53.0-28.el7                                                                                                                                      Complete!
[root@localhost ~]# 

通过编译安装(官网最新版本1.85.0)

1.安装相关依赖

yum -y install gcc gcc-c++ python python-devel libicu libicu-devel zlib zlib-devel bzip2 bzip2-devel

效果如下:

[root@localhost ~]# yum -y install gcc gcc-c++ python python-devel libicu libicu-devel zlib zlib-devel bzip2 bzip2-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.ustc.edu.cn* extras: mirrors.ustc.edu.cn* updates: mirrors.ustc.edu.cn
Package gcc-4.8.5-44.el7.x86_64 already installed and latest version
Package gcc-c++-4.8.5-44.el7.x86_64 already installed and latest version
Package python-2.7.5-94.el7_9.x86_64 already installed and latest version
Package libicu-50.2-4.el7_7.x86_64 already installed and latest version
Package zlib-1.2.7-21.el7_9.x86_64 already installed and latest version
Package zlib-devel-1.2.7-21.el7_9.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package bzip2.x86_64 0:1.0.6-13.el7 will be installed
---> Package bzip2-devel.x86_64 0:1.0.6-13.el7 will be installed
---> Package libicu-devel.x86_64 0:50.2-4.el7_7 will be installed
---> Package python-devel.x86_64 0:2.7.5-94.el7_9 will be installed
--> Processing Dependency: python2-rpm-macros > 3-30 for package: python-devel-2.7.5-94.el7_9.x86_64
--> Processing Dependency: python-rpm-macros > 3-30 for package: python-devel-2.7.5-94.el7_9.x86_64
--> Running transaction check
---> Package python-rpm-macros.noarch 0:3-34.el7 will be installed
--> Processing Dependency: python-srpm-macros for package: python-rpm-macros-3-34.el7.noarch
---> Package python2-rpm-macros.noarch 0:3-34.el7 will be installed
--> Running transaction check
---> Package python-srpm-macros.noarch 0:3-34.el7 will be installed
--> Finished Dependency ResolutionDependencies Resolved==========================================================================================================================================================================Package                                        Arch                               Version                                      Repository                           Size
==========================================================================================================================================================================
Installing:bzip2                                          x86_64                             1.0.6-13.el7                                 base                                 52 kbzip2-devel                                    x86_64                             1.0.6-13.el7                                 base                                218 klibicu-devel                                   x86_64                             50.2-4.el7_7                                 base                                703 kpython-devel                                   x86_64                             2.7.5-94.el7_9                               updates                             399 k
Installing for dependencies:python-rpm-macros                              noarch                             3-34.el7                                     base                                9.1 kpython-srpm-macros                             noarch                             3-34.el7                                     base                                8.8 kpython2-rpm-macros                             noarch                             3-34.el7                                     base                                8.1 kTransaction Summary
==========================================================================================================================================================================
Install  4 Packages (+3 Dependent packages)Total download size: 1.4 M
Installed size: 5.4 M
Downloading packages:
(1/7): bzip2-1.0.6-13.el7.x86_64.rpm                                                                                                               |  52 kB  00:00:00     
(2/7): python-srpm-macros-3-34.el7.noarch.rpm                                                                                                      | 8.8 kB  00:00:00     
(3/7): python-rpm-macros-3-34.el7.noarch.rpm                                                                                                       | 9.1 kB  00:00:00     
(4/7): python2-rpm-macros-3-34.el7.noarch.rpm                                                                                                      | 8.1 kB  00:00:00     
(5/7): bzip2-devel-1.0.6-13.el7.x86_64.rpm                                                                                                         | 218 kB  00:00:00     
(6/7): python-devel-2.7.5-94.el7_9.x86_64.rpm                                                                                                      | 399 kB  00:00:00     
(7/7): libicu-devel-50.2-4.el7_7.x86_64.rpm                                                                                                        | 703 kB  00:00:01     
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                     999 kB/s | 1.4 MB  00:00:01     
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : python-srpm-macros-3-34.el7.noarch                                                                                                                     1/7 Installing : python-rpm-macros-3-34.el7.noarch                                                                                                                      2/7 Installing : python2-rpm-macros-3-34.el7.noarch                                                                                                                     3/7 Installing : python-devel-2.7.5-94.el7_9.x86_64                                                                                                                     4/7 Installing : libicu-devel-50.2-4.el7_7.x86_64                                                                                                                       5/7 Installing : bzip2-1.0.6-13.el7.x86_64                                                                                                                              6/7 Installing : bzip2-devel-1.0.6-13.el7.x86_64                                                                                                                        7/7 Verifying  : bzip2-devel-1.0.6-13.el7.x86_64                                                                                                                        1/7 Verifying  : python2-rpm-macros-3-34.el7.noarch                                                                                                                     2/7 Verifying  : bzip2-1.0.6-13.el7.x86_64                                                                                                                              3/7 Verifying  : python-rpm-macros-3-34.el7.noarch                                                                                                                      4/7 Verifying  : libicu-devel-50.2-4.el7_7.x86_64                                                                                                                       5/7 Verifying  : python-srpm-macros-3-34.el7.noarch                                                                                                                     6/7 Verifying  : python-devel-2.7.5-94.el7_9.x86_64                                                                                                                     7/7 Installed:bzip2.x86_64 0:1.0.6-13.el7         bzip2-devel.x86_64 0:1.0.6-13.el7         libicu-devel.x86_64 0:50.2-4.el7_7         python-devel.x86_64 0:2.7.5-94.el7_9        Dependency Installed:python-rpm-macros.noarch 0:3-34.el7                    python-srpm-macros.noarch 0:3-34.el7                    python2-rpm-macros.noarch 0:3-34.el7                   Complete!
[root@localhost ~]# 

2.查询官网下载最新安装包并解压

boost官网地址:https://www.boost.org/
在这里插入图片描述
执行命令如下

cd /usr/local
wget https://boostorg.jfrog.io/artifactory/main/release/1.85.0/source/boost_1_85_0.tar.gz
tar -xzvf boost_1_85_0.tar.gz
cd boost_1_85_0

3.编译Boost

./bootstrap.sh
./b2

效果如下:

[root@localhost boost_1_85_0]# ./bootstrap.sh
Building B2 engine..###
###
### Using 'gcc' toolset.
###
###g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.###
###> g++ -x c++ -std=c++11 -pthread -O2 -s -DNDEBUG bindjam.cpp builtins.cpp class.cpp command.cpp compile.cpp constants.cpp cwd.cpp debug.cpp debugger.cpp execcmd.cpp execnt.cpp execunix.cpp filent.cpp filesys.cpp fileunix.cpp frames.cpp function.cpp glob.cpp hash.cpp hcache.cpp hdrmacro.cpp headers.cpp jam_strings.cpp jam.cpp jamgram.cpp lists.cpp make.cpp make1.cpp md5.cpp mem.cpp modules.cpp native.cpp option.cpp output.cpp parse.cpp pathnt.cpp pathsys.cpp pathunix.cpp regexp.cpp rules.cpp scan.cpp search.cpp startup.cpp tasks.cpp timestamp.cpp value.cpp variable.cpp w32_getreg.cpp mod_jam_builtin.cpp mod_jam_class.cpp mod_jam_errors.cpp mod_jam_modules.cpp mod_order.cpp mod_path.cpp mod_property_set.cpp mod_regex.cpp mod_sequence.cpp mod_set.cpp mod_string.cpp mod_summary.cpp mod_sysinfo.cpp mod_version.cpp -o b2
tools/build/src/engine/b2
Detecting Python version... 2.7
Detecting Python root... /usr
Unicode/ICU support for Boost.Regex?... /usr
Generating B2 configuration in project-config.jam for gcc...Bootstrapping is done. To build, run:./b2To generate header files, run:./b2 headersThe configuration generated uses gcc to build by default. If that is
unintended either use the --with-toolset option or adjust configuration, by
editing 'project-config.jam'.Further information:- Command line help:./b2 --help- Getting started guide: http://www.boost.org/more/getting_started/unix-variants.html- B2 documentation:http://www.boost.org/build/[root@localhost boost_1_85_0]# ./b2
Performing configuration checks- default address-model    : 64-bit [1]- default architecture     : x86 [1]Building the Boost C++ Libraries.- compiler supports SSE2   : yes [2]- compiler supports SSE4.1 : yes [2]- cxx11_static_assert      : no [2]- compiler supports SSE2   : yes [3]- compiler supports SSE4.1 : yes [3]- cxx11_static_assert      : no [3]- cxx11_variadic_templates : no [2]- cxx11_variadic_templates : no [3]- cxx11_hdr_ratio          : no [2]- cxx11_hdr_ratio          : no [3]- cxx20_hdr_concepts       : no [2]- cxx20_hdr_concepts       : no [3]- has std::atomic_ref      : no [2]- has -Wl,--no-undefined   : yes [2]- has statx                : no [2]- has statx syscall        : no [2]- cxx11_rvalue_references  : no [2]- has std::atomic_ref      : no [3]- has -Wl,--no-undefined   : yes [3]- has statx                : no [3]- has statx syscall        : no [3]- cxx11_rvalue_references  : no [3]- cxx11_auto_declarations  : no [2]- cxx11_auto_declarations  : no [3]- has init_priority attribute : yes [2]- has stat::st_blksize     : yes [2]- has stat::st_mtim        : yes [2]- has stat::st_mtimensec   : no [2]- has stat::st_mtimespec   : no [2]- has stat::st_birthtim    : no [2]- has stat::st_birthtimensec : no [2]- has stat::st_birthtimespec : no [2]- has fdopendir(O_NOFOLLOW) : yes [2]- has dirent::d_type       : yes [2]- has POSIX *at APIs       : yes [2]- has fallocate            : yes [2]- has_icu builds           : yes [2]
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam.
note: to suppress this message, pass "--without-graph_parallel" to bjam.- zlib                     : yes- bzip2                    : yes- lzma                     : no- zstd                     : no- has_lzma_cputhreads builds : no [2]- cxx11_constexpr          : no [2]- cxx11_constexpr          : no [3]- icu                      : yes [2]- iconv (libc)             : yes [2]- icu                      : yes [3]- iconv (libc)             : yes [3]- native atomic int32 supported : no [2]- native syslog supported  : yes [2]- pthread supports robust mutexes : yes [2]- Boost.Regex is header-only : no [2]- lockfree boost::atomic_flag : no [2]- compiler supports SSSE3  : yes [2]- compiler supports AVX2   : yes [2]- compiler supports SSSE3  : yes [3]- compiler supports AVX2   : yes [3]- native atomic int32 supported : no [3]- native syslog supported  : yes [3]- pthread supports robust mutexes : yes [3]- cxx11_lambdas            : no [2]- cxx11_lambdas            : no [3]- gcc visibility           : yes [2]- cxx11_noexcept           : no [2]- gcc visibility           : yes [3]- cxx11_noexcept           : no [3]
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.- std_wstreambuf builds    : yes [2]- std_wstreambuf           : yes [2]- BOOST_COMP_GNUC >= 4.3.0 : no [2]- BOOST_COMP_GNUC >= 4.3.0 : no [4]- compiler supports SSE2   : yes [4]- compiler supports SSE4.1 : yes [4]- cxx11_static_assert      : no [4]- compiler supports SSE2   : yes [5]- compiler supports SSE4.1 : yes [5]- cxx11_static_assert      : no [5]- cxx11_variadic_templates : no [4]- cxx11_variadic_templates : no [5]- cxx11_hdr_ratio          : no [4]- cxx11_hdr_ratio          : no [5]- cxx20_hdr_concepts       : no [4]- cxx20_hdr_concepts       : no [5]- has std::atomic_ref      : no [4]- has statx                : no [4]- has statx syscall        : no [4]- cxx11_rvalue_references  : no [4]- has std::atomic_ref      : no [5]- has statx                : no [5]- has statx syscall        : no [5]- cxx11_rvalue_references  : no [5]- cxx11_auto_declarations  : no [4]- cxx11_auto_declarations  : no [5]- has init_priority attribute : yes [4]- has stat::st_blksize     : yes [4]- has stat::st_mtim        : yes [4]- has stat::st_mtimensec   : no [4]- has stat::st_mtimespec   : no [4]- has stat::st_birthtim    : no [4]- has stat::st_birthtimensec : no [4]- has stat::st_birthtimespec : no [4]- has fdopendir(O_NOFOLLOW) : yes [4]- has dirent::d_type       : yes [4]- has POSIX *at APIs       : yes [4]- has fallocate            : yes [4]- has_icu builds           : yes [4]
....
gcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/link-static/threading-multi/visibility-hidden/xml_report_formatter.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/compiler_log_formatter.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/cpp_main.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/debug.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/decorator.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/execution_monitor.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/framework.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/junit_log_formatter.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/plain_report_formatter.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/progress_monitor.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/results_collector.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/results_reporter.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/test_tools.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/test_tree.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/unit_test_log.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/unit_test_main.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/unit_test_monitor.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/unit_test_parameters.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/xml_log_formatter.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/xml_report_formatter.o
[root@localhost boost_1_85_0]# 

这将编译并安装Boost库到默认的系统路径,如/usr/local/include和/usr/local/lib。如果你需要特定的编译选项或者库的子集,你可以在运行./bootstrap.sh时添加参数,例如,只编译线程库和系统库:

./bootstrap.sh --with-libraries=system,thread
./b2

4.安装Boost库到系统路径

sudo ./b2 install

效果如下:

    - default address-model    : 64-bit (cached) [1]- default architecture     : x86 (cached) [1]- compiler supports SSE2   : yes (cached) [2]- compiler supports SSE4.1 : yes (cached) [2]- cxx11_static_assert      : no  (cached) [2]- compiler supports SSE2   : yes (cached) [3]- compiler supports SSE4.1 : yes (cached) [3]- cxx11_static_assert      : no  (cached) [3]- cxx11_variadic_templates : no  (cached) [2]- cxx11_variadic_templates : no  (cached) [3]- cxx11_hdr_ratio          : no  (cached) [2]- cxx11_hdr_ratio          : no  (cached) [3]- cxx20_hdr_concepts       : no  (cached) [2]- cxx20_hdr_concepts       : no  (cached) [3]- has std::atomic_ref      : no  (cached) [2]- has -Wl,--no-undefined   : yes (cached) [2]- has statx                : no  (cached) [2]- has statx syscall        : no  (cached) [2]- cxx11_rvalue_references  : no  (cached) [2]- has std::atomic_ref      : no  (cached) [3]- has -Wl,--no-undefined   : yes (cached) [3]- has statx                : no  (cached) [3]- has statx syscall        : no  (cached) [3]- cxx11_rvalue_references  : no  (cached) [3]- cxx11_auto_declarations  : no  (cached) [2]- cxx11_auto_declarations  : no  (cached) [3]- has init_priority attribute : yes (cached) [2]- has stat::st_blksize     : yes (cached) [2]- has stat::st_mtim        : yes (cached) [2]- has stat::st_mtimensec   : no  (cached) [2]- has stat::st_mtimespec   : no  (cached) [2]- has stat::st_birthtim    : no  (cached) [2]- has stat::st_birthtimensec : no  (cached) [2]- has stat::st_birthtimespec : no  (cached) [2]- has fdopendir(O_NOFOLLOW) : yes (cached) [2]- has dirent::d_type       : yes (cached) [2]- has POSIX *at APIs       : yes (cached) [2]- has fallocate            : yes (cached) [2]- has_icu builds           : yes (cached) [2]
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam.
note: to suppress this message, pass "--without-graph_parallel" to bjam.- zlib                     : yes (cached)- bzip2                    : yes (cached)- lzma                     : no  (cached)- zstd                     : no  (cached)- has_lzma_cputhreads builds : no  (cached) [2]- cxx11_constexpr          : no  (cached) [2]- cxx11_constexpr          : no  (cached) [3]- icu                      : yes (cached) [2]- iconv (libc)             : yes (cached) [2]- icu                      : yes (cached) [3]- iconv (libc)             : yes (cached) [3]- native atomic int32 supported : no  (cached) [2]- native syslog supported  : yes (cached) [2]- pthread supports robust mutexes : yes (cached) [2]- Boost.Regex is header-only : no  (cached) [2]- lockfree boost::atomic_flag : no  (cached) [2]- compiler supports SSSE3  : yes (cached) [2]- compiler supports AVX2   : yes (cached) [2]- compiler supports SSSE3  : yes (cached) [3]- compiler supports AVX2   : yes (cached) [3]- native atomic int32 supported : no  (cached) [3]- native syslog supported  : yes (cached) [3]- pthread supports robust mutexes : yes (cached) [3]- cxx11_lambdas            : no  (cached) [2]- cxx11_lambdas            : no  (cached) [3]- gcc visibility           : yes (cached) [2]- cxx11_noexcept           : no  (cached) [2]- gcc visibility           : yes (cached) [3]- cxx11_noexcept           : no  (cached) [3]
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.- std_wstreambuf builds    : yes (cached) [2]
....gcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/plain_report_formatter.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/progress_monitor.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/results_collector.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/results_reporter.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/test_tools.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/test_tree.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/unit_test_log.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/unit_test_main.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/unit_test_monitor.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/unit_test_parameters.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/xml_log_formatter.ogcc.compile.c++ bin.v2/libs/test/build/gcc-4.8/release/threading-multi/visibility-hidden/xml_report_formatter.o
[root@localhost boost_1_85_0]# 

Boost库验证

示例代码:

#include <boost/filesystem.hpp>
#include <iostream>int main(int argc, char* argv[])
{if (argc < 2){std::cout << "Usage: " << argv[0] << " path\n";return 1;}boost::filesystem::path p(argv[1]);if (boost::filesystem::exists(p)) {if (boost::filesystem::is_directory(p))std::cout << p << " is a directory.\n";else if (boost::filesystem::is_regular_file(p))std::cout << p << " is a regular file.\n";elsestd::cout << p << " exists but is not a directory or regular file.\n";} else {std::cout << p << " does not exist.\n";}return 0;
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.28)
project(boost_example)
set(BOOST_ROOT "/usr/include")
set(Boost_INCLUDE_DIR "/usr/include")
set(Boost_SYSTEM_LIBRARY "/usr/include/boost/stage/lib")set(CMAKE_CXX_STANDARD 20)
set(boostlib filesystem program_options regex)
#
find_package(Boost REQUIRED COMPONENTS ${boostlib})add_executable(boost_example main.cpp)
if(Boost_FOUND)message(STATUS "Boost version found")message(STATUS " Boost libraries:${Boost_LIBRARIES}")target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
else()message(STATUS "Boost version not found")
endif()

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/9490.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

(22.12.20)matlab2022+yalmip+cplex安装教程,win11 x64

前言 Hi,你好&#xff01;最近刚刚更换新的电脑设备&#xff0c;安装软件时尽量选择最新版本&#xff0c;但也遇到了大大小小的安装问题&#xff0c;这里把踩到的坑一并总结出来&#xff0c;给出一份还算合理的MATLAByalmipCPLEX安装教程&#xff08;win11&#xff09;。 MAT…

从零入门激光SLAM(十三)——LeGo-LOAM源码超详细解析4

大家好呀&#xff0c;我是一个SLAM方向的在读博士&#xff0c;深知SLAM学习过程一路走来的坎坷&#xff0c;也十分感谢各位大佬的优质文章和源码。随着知识的越来越多&#xff0c;越来越细&#xff0c;我准备整理一个自己的激光SLAM学习笔记专栏&#xff0c;从0带大家快速上手激…

OBS插件--视频回放

视频回放 视频回放是一款源插件&#xff0c;它可以将指定源的视频缓存一段时间&#xff08;时间可以设定&#xff09;&#xff0c;将缓存中的视频添加到当前场景中后&#xff0c;可以快速或慢速不限次数的回放。这个功能在类似体育比赛的直播中非常有用&#xff0c;可以捕获指…

【快讯】山东省第四批软件产业高质量发展重点项目开始申报

为加快落实《山东省高端软件“铸魂”工程实施方案&#xff08;2023-2025&#xff09;》&#xff0c;提高软件产业规模能级&#xff0c;提升关键软件技术创新和供给能力&#xff0c;塑强数字经济发展核心竞争力&#xff0c;确定开展第四批软件产业高质量发展重点项目申报工作&am…

CTF-Web Exploitation(持续更新)

CTF-Web Exploitation 1. GET aHEAD Find the flag being held on this server to get ahead of the competition Hints Check out tools like Burpsuite to modify your requests and look at the responses 根据提示使用不同的请求方式得到response可能会得到结果 使用…

如何通过汽车制造供应商协同平台,提高供应链的效率与稳定性?

汽车制造供应商协同是指在汽车制造过程中&#xff0c;整车制造商与其零部件供应商之间建立的一种紧密合作的关系。这种协同关系旨在优化整个供应链的效率&#xff0c;降低成本&#xff0c;提高产品质量&#xff0c;加快创新速度&#xff0c;并最终提升整个汽车产业的竞争力。以…

面试笔记——JVM组成

基本介绍 JVM: Java Virtual Machine Java程序的运行环境&#xff08;java二进制字节码的运行环境&#xff09; 使用JVM的好处&#xff1a; 一次编写&#xff0c;到处运行自动内存管理&#xff0c;垃圾回收机制 JVM的组成及运行流程&#xff1a; 程序计数器 程序计数器&a…

Zabbix5.0——安装与部署

目录 一、zabbix-server(192.168.206.134) 监控方 1. 环境准备 2.安装zabbix 2.1 准备zabbix-repo 2.2清理缓存 2.3安装zabbix主包&#xff08;服务器和代理&#xff09; 2.4安装zabbix前端包 3. 数据库安装 3.1 授权zabbix账号 3.2导入数据库&#xff08;初始化zabbix&#x…

人工智能驱动的设计工具的兴起:彻底改变创意产业

人工智能驱动的设计工具的兴起&#xff1a;彻底改变创意产业 概述 人工智能 (AI) 正在改变创意产业&#xff0c;设计也不例外。人工智能驱动的设计工具正在彻底改变设计师的工作方式&#xff0c;提供无与伦比的效率、创造力和创新水平。从生成图像和设计到自动化日常任务&…

基于Opencv的车牌识别系统(毕业设计可用)

系统架构 图像采集&#xff1a;首先&#xff0c;通过摄像头等设备捕捉车辆图像。图像质量直接影响后续处理的准确性&#xff0c;因此高质量的图像采集是基础。 预处理&#xff1a;对获取的原始图像进行预处理&#xff0c;包括灰度化、降噪、对比度增强和边缘检测等。这些操作旨…

RS3236-3.3YF5 封装SOT-23-5 线性稳压器 带过温保护

RS3236-3.3YF5 是一款由Runic&#xff08;润石&#xff09;公司生产的线性稳压器&#xff08;LDO&#xff09;&#xff0c;以下是该器件的一些功能和参数介绍&#xff1a; 品牌: Runic 产品类型: 线性稳压器 (LDO) 输入电压范围: 最大 7.5V 输出电压: 固定 3.3V 输出电流: 最大…

基于FPGA的去雾算法

去雾算法的原理是基于图像去模糊的原理&#xff0c;通过对图像中的散射光进行估计和去除来消除图像中的雾霾效果。 去雾算法通常分为以下几个步骤&#xff1a; 1. 导引滤波&#xff1a;首先使用导引滤波器对图像进行滤波&#xff0c;目的是估计图像中散射光的强度。导引滤波器…

介绍适用于 Node.js 的 Elastic OpenTelemetry 发行版

作者&#xff1a;来自 Elastic Trent Mick 我们很高兴地宣布推出 Elastic OpenTelemetry Distribution for Node.js 的 alpha 版本。 该发行版是 OpenTelemetry Node.js SDK 的轻量级包装&#xff0c;可以让你更轻松地开始使用 OpenTelemetry 来观察 Node.js 应用程序。 背景 …

QT与Electron之争:谁能提供更好的用户体验?有一点QT完胜.

QT和Electron到底谁好&#xff0c;争论不休&#xff0c;各有各的道理&#xff0c;贝格前端工场总结了各方观点&#xff0c;做一个梳理。 在比较QT和Electron时&#xff0c;需要考虑到它们各自的特点和适用场景。 QT是一个C的跨平台应用程序开发框架&#xff0c; 而Electron是基…

2024第九届数维杯数学建模论文模板(内附LaTeX+Word)

一年一度的2024年第九届数维杯国赛报名进行中&#xff01;相信很多同学们已经摩拳擦掌蓄势待发了&#xff01; 经历三天比赛&#xff0c;最后提交的论文就是最终答卷&#xff0c;那么一篇数模论文&#xff0c;包括哪些内容呢&#xff1f; 一篇完整的数模论文&#xff0c;包括…

活字格中如何加入JavaScript的代码和事件以及如何调试

活字格&#xff1a; 如何加入JavaScript的代码和事件 1&#xff09;选中组件。 2&#xff09;编辑命令“按钮。 3&#xff09;选择JavaScript命令&#xff0c;并点亮五星。 4&#xff09;编写js代码&#xff0c;确定。 5&#xff09;运行。 如何查看js运行&#xff1a; …

uni-app(二):本地插件使用(Android)

本地插件使用 项目创建等参考1.下载并引用本地插件2.注意插件配置3.制作自定义基座4.编写调用代码5.运行 项目创建等参考 https://lprosper.blog.csdn.net/article/details/138655526 1.下载并引用本地插件 2.注意插件配置 3.制作自定义基座 4.编写调用代码 <template>…

【原创】springboot+mysql物资库存管理系统设计与实现

个人主页&#xff1a;程序猿小小杨 个人简介&#xff1a;从事开发多年&#xff0c;Java、Php、Python、前端开发均有涉猎 博客内容&#xff1a;Java项目实战、项目演示、技术分享 文末有作者名片&#xff0c;希望和大家一起共同进步&#xff0c;你只管努力&#xff0c;剩下的交…

【C++】类与对象(类章节)

面向过程和面向对象 C语言是面向过程的&#xff0c;关注的是过程&#xff0c;分析出求解问题的步骤&#xff0c;通过函数调用逐步解决问题。 C是基于面向对象的&#xff0c;关注的是对象&#xff0c;将一件事情拆分成不同的对象&#xff0c;靠对象之间的交互完 成。 一、类 1.类…

【MySQL基本查询(上)】

文章目录 一、多行插入 指定列插入数据更新表中某个数据的信息&#xff08;on duplicate&#xff09;了解affected报告信息 二、检索功能1.select 查询1.1全列查询1.2指定列查询1.3where条件筛选子句案例 2.结果排序案例 3.筛选分页结果offset实现分页 一、多行插入 指定列插…