Centos7编译安装cmatrix(模拟电影黑客代码雨界面)

一、下载源码包

https://zh.osdn.net/projects/sfnet_cmatrix/downloads/cmatrix/1.2a/cmatrix-1.2a.tar.gz/

二、安装

1、首先安装编译需要的gcc

[root@localhost ~]# yum install -y gcc

2、解压

[root@localhost ~]# tar  -zxvf cmatrix-1.2a.tar.gz

3、配置

[root@localhost ~]# cd cmatrix-1.2a
[root@localhost cmatrix-1.2a]# ./configure --prefix=/apps/cmatrix

4、编译make

[root@localhost cmatrix-1.2a]# make
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -Wall -Wno-comment -c cmatrix.c
cmatrix.c:37:20: fatal error: curses.h: No such file or directory
 #include 
                    ^
compilation terminated.
make: *** [cmatrix.o] Error 1

查询缺少的包

[root@localhost cmatrix-1.2a]# yum list *curses*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: ftp.sjtu.edu.cn
Installed Packages
ncurses.x86_64                                                                              5.9-14.20130511.el7_4                                                                   @anaconda
ncurses-base.noarch                                                                         5.9-14.20130511.el7_4                                                                   @anaconda
ncurses-libs.x86_64                                                                         5.9-14.20130511.el7_4                                                                   @anaconda
Available Packages
ncurses-devel.i686                                                                          5.9-14.20130511.el7_4                                                                   base     
ncurses-devel.x86_64                                                                        5.9-14.20130511.el7_4                                                                   base     
ncurses-libs.i686                                                                           5.9-14.20130511.el7_4                                                                   base     
ncurses-static.i686                                                                         5.9-14.20130511.el7_4                                                                   base     
ncurses-static.x86_64                                                                       5.9-14.20130511.el7_4                                                                   base     
ncurses-term.noarch                                                                         5.9-14.20130511.el7_4                                                                   base     
ocaml-curses.x86_64                                                                         1.0.3-20.el7                                                                            base     
ocaml-curses-devel.x86_64                                                                   1.0.3-20.el7                                                                            base

安装

[root@localhost cmatrix-1.2a]# yum install -y ncurses-devel

再次编译还是会提示错误,但是需要的包已经安装了。可以删除目录,重新解压之后再次执行上面操作

[root@localhost cmatrix-1.2a]# make
...
...
collect2: error: ld returned 1 exit status
make: *** [cmatrix] Error 1

[root@localhost ~]# rm -rf cmatrix-1.2a
[root@localhost ~]# tar  -zxvf cmatrix-1.2a.tar.gz
[root@localhost ~]# cd cmatrix-1.2a

5、编译make install

[root@localhost cmatrix-1.2a]# make install
make[1]: Entering directory `/root/cmatrix-1.2a'
/bin/sh ./mkinstalldirs /apps/cmatrix/bin
mkdir /apps
mkdir /apps/cmatrix
mkdir /apps/cmatrix/bin
  /usr/bin/install -c  cmatrix /apps/cmatrix/bin/cmatrix
make  install-man1
make[2]: Entering directory `/root/cmatrix-1.2a'
/bin/sh ./mkinstalldirs /apps/cmatrix/man/man1
mkdir /apps/cmatrix/man
mkdir /apps/cmatrix/man/man1
 /usr/bin/install -c -m 644 ./cmatrix.1 /apps/cmatrix/man/man1/cmatrix.1
make[2]: Leaving directory `/root/cmatrix-1.2a'
 Installing matrix fonts in /usr/lib/kbd/consolefonts...
make[1]: Leaving directory `/root/cmatrix-1.2a'

6、查看效果

[root@localhost cmatrix-1.2a]# cd /apps/cmatrix/bin/
[root@localhost bin]# ./cmatrix 

相关参数:

-a:异步滚动
-b:启用粗体字符
-b:所有粗体字符(覆盖-b)
-f:强制启用linux$term类型
-l:linux模式(使用矩阵控制台字体)
-o:使用旧式滚动
-h:打印使用和退出
-n:无粗体字符(覆盖-b和-b,默认)
-s:“屏幕保护程序”模式,在第一次按键时退出
-x:窗口模式,如果您的xterm使用mtx.pcf,则使用
-v:打印版本信息并退出
-u延迟(0-10,默认4):屏幕更新延迟
-C [颜色]:将此颜色用于矩阵(默认为绿色)

Centos7编译安装cmatrix(模拟电影黑客代码雨界面)_第1张图片

你可能感兴趣的:(Linux)