SWIG源码安装

SWIG源码安装

https://github.com/swig

下载源码首先需要先生成.configure,在执行make & make install

./autogen.sh 
+ test -d Tools/config
+ aclocal -I Tools/config
./autogen.sh: 11: aclocal: not found

报错了

解决方案,安装automake

sudo apt-get install automake libtool -y

再次执行

./autogen.sh 
+ test -d Tools/config
+ aclocal -I Tools/config
+ autoheader
+ automake --add-missing --copy --force-missing
configure.ac:23: installing 'Tools/config/compile'
configure.ac:11: installing 'Tools/config/config.guess'
configure.ac:11: installing 'Tools/config/config.sub'
configure.ac:12: installing 'Tools/config/install-sh'
configure.ac:12: installing 'Tools/config/missing'
Source/Makefile.am: installing 'Tools/config/depcomp'
+ autoconf
+ cd CCache
+ autoreconf
$ ./configure

开始编译

make
# 报错
make[1]: Entering directory '/home/bing/occ/swig/Source'
/bin/bash '/home/bing/occ/swig/Tools/config/missing' bison -d -Wall -Werror  --output=CParse/parser.c ./CParse/parser.y
/home/bing/occ/swig/Tools/config/missing: line 81: bison: command not found
WARNING: 'bison' is missing on your system.
         You should only need it if you modified a '.y' file.
         You may want to install the GNU Bison package:
         <https://www.gnu.org/software/bison/>
make[1]: *** [Makefile:1346: CParse/parser.c] Error 127
make[1]: Leaving directory '/home/bing/occ/swig/Source'
make: *** [Makefile:36: source] Error 2
(base) bing@bing-ThinkPad-T14p-Gen-1:~/occ/

解决办法,继续安装提示缺少的库

$ sudo apt-get install bison

安装完,再次执行make执行成功

$ make
$ sudo make install
...
Installing /usr/local/share/swig/4.3.0/std/std_wsstream.i
Installing /usr/local/share/swig/4.3.0/std/std_wstreambuf.i
Installing /usr/local/share/swig/4.3.0/std/std_wstring.i
make[1]: Entering directory '/home/bing/occ/swig/CCache'
Installing ccache-swig
Installing /usr/local/bin/ccache-swig
/usr/bin/install -c -d /usr/local/bin
/usr/bin/install -c -m 755 ccache-swig /usr/local/bin/ccache-swig
make[1]: Leaving directory '/home/bing/occ/swig/CCache'
Installation complete

安装成功
我们查看一下swig的版本

$ swig  -version

SWIG Version 4.3.0

Compiled with g++ [x86_64-pc-linux-gnu]

Configured options: +pcre

Please see https://www.swig.org for reporting bugs and further information
  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值