1、首先对port本身进行升级,
megumikichikus-MacBook-Pro:~ huixizhu$ sudo port selfupdate
2、将使用port安装的软件进行升级,
megumikichikus-MacBook-Pro:~ huixizhu$ sudo port upgrade outdated
3、安装cctools,
megumikichikus-MacBook-Pro:~ huixizhu$ sudo port install cctools
---> Computing dependencies for cctools
---> Cleaning cctools
---> Updating database of binaries
---> Scanning binaries for linking errors
---> No broken files found.
---> No broken ports found.
4、安装opencv,查看相关的安装依赖,
megumikichikus-MacBook-Pro:~ huixizhu$ sudo port install opencv
Password:
---> Computing dependencies for opencv
The following dependencies will be installed:
...
ffmpeg
ilmbase
libunwind-headers
openexr
Continue? [Y/n]: n
你可以选择Y,但是如果整体安装失败时,在此执行上条命令,然后选择n,对相关依赖逐项安装,这样更能保证最终顺利完成opencv的安装,
megumikichikus-MacBook-Pro:~ huixizhu$ sudo port install ilmbase
---> Computing dependencies for ilmbase
---> Fetching archive for ilmbase
---> Attempting to fetch ilmbase-2.3.0_1.darwin_18.x86_64.tbz2 from https://pek.cn.packages.macports.org/macports/packages/ilmbase
---> Attempting to fetch ilmbase-2.3.0_1.darwin_18.x86_64.tbz2.rmd160 from https://pek.cn.packages.macports.org/macports/packages/ilmbase
---> Installing ilmbase @2.3.0_1
---> Activating ilmbase @2.3.0_1
---> Cleaning ilmbase
---> Scanning binaries for linking errors
---> No broken files found.
---> No broken ports found.
megumikichikus-MacBook-Pro:~ huixizhu$ sudo port install libunwind-headers
---> Cleaning libunwind-headers
---> Scanning binaries for linking errors
---> No broken files found.
---> No broken ports found.
megumikichikus-MacBook-Pro:~ huixizhu$ sudo port install openexr
---> Computing dependencies for openexr
---> Fetching archive for openexr
---> Attempting to fetch openexr-2.3.0_2.darwin_18.x86_64.tbz2 from https://pek.cn.packages.macports.org/macports/packages/openexr
---> Attempting to fetch openexr-2.3.0_2.darwin_18.x86_64.tbz2.rmd160 from https://pek.cn.packages.macports.org/macports/packages/openexr
---> Installing openexr @2.3.0_2
---> Activating openexr @2.3.0_2
---> Cleaning openexr
---> Scanning binaries for linking errors
---> No broken files found.
---> No broken ports found.
megumikichikus-MacBook-Pro:~ huixizhu$ sudo rm -rf /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_multimedia_ffmpeg/ffmpeg/main.log
megumikichikus-MacBook-Pro:~ huixizhu$ sudo port install opencv
---> Computing dependencies for opencv
The following dependencies will be installed: ffmpeg
Continue? [Y/n]: y
---> Fetching archive for ffmpeg
---> Attempting to fetch ffmpeg-4.2.4_0+gpl2.darwin_18.x86_64.tbz2 from https://pek.cn.packages.macports.org/macports/packages/ffmpeg
---> Attempting to fetch ffmpeg-4.2.4_0+gpl2.darwin_18.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/ffmpeg
---> Attempting to fetch ffmpeg-4.2.4_0+gpl2.darwin_18.x86_64.tbz2 from https://packages.macports.org/ffmpeg
---> Building ffmpeg
Error: Failed to build ffmpeg: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_multimedia_ffmpeg/ffmpeg/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port opencv failed
megumikichikus-MacBook-Pro:~ huixizhu$ vim /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_multimedia_ffmpeg/ffmpeg/main.log
megumikichikus-MacBook-Pro:~ huixizhu$ sudo rm -rf /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_multimedia_ffmpeg
Password:
megumikichikus-MacBook-Pro:~ huixizhu$ sudo port install ffmpeg
---> Computing dependencies for ffmpeg
---> Fetching archive for ffmpeg
---> Attempting to fetch ffmpeg-4.2.4_0+gpl2.darwin_18.x86_64.tbz2 from https://pek.cn.packages.macports.org/macports/packages/ffmpeg
---> Attempting to fetch ffmpeg-4.2.4_0+gpl2.darwin_18.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/ffmpeg
---> Attempting to fetch ffmpeg-4.2.4_0+gpl2.darwin_18.x86_64.tbz2 from https://packages.macports.org/ffmpeg
---> Fetching distfiles for ffmpeg
---> Verifying checksums for ffmpeg
---> Extracting ffmpeg
---> Applying patches to ffmpeg
---> Configuring ffmpeg
---> Building ffmpeg
---> Staging ffmpeg into destroot
---> Installing ffmpeg @4.2.4_0+gpl2
---> Activating ffmpeg @4.2.4_0+gpl2
---> Cleaning ffmpeg
---> Scanning binaries for linking errors
---> No broken files found.
---> No broken ports found.
---> Some of the ports you installed have notes:
ffmpeg has the following notes:
*******
******* This build of ffmpeg includes GPLed code and
******* is therefore licensed under GPL v2 or later.
*******
******* The following modules are GPLed:
*******
******* postproc
******* libx264
******* libx265
******* libxvid
*******
******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
******* To remove nonfree and GPLed code leaving only LGPL code remove the
******* +gpl2 variant.
*******
megumikichikus-MacBook-Pro:~ huixizhu$ sudo port install opencv
Password:
---> Computing dependencies for opencv
---> Fetching archive for opencv
---> Attempting to fetch opencv-3.4.10_0.darwin_18.x86_64.tbz2 from https://pek.cn.packages.macports.org/macports/packages/opencv
---> Attempting to fetch opencv-3.4.10_0.darwin_18.x86_64.tbz2.rmd160 from https://pek.cn.packages.macports.org/macports/packages/opencv
---> Installing opencv @3.4.10_0
---> Activating opencv @3.4.10_0
---> Cleaning opencv
---> Scanning binaries for linking errors
---> No broken files found.
---> No broken ports found.