当前位置:首页 » 编程软件 » androidcentos编译环境

androidcentos编译环境

发布时间: 2023-05-20 08:37:00

A. centos7系统源码编译安装php7.3.5版本

新增系统用户组和用户:

下载 PHP7.3.5

[root@localhost ~]# mkdir devdir

[root@localhost ~]# cd devdir/

[root@localhost devdir]# wget https://www.php.net/distributions/php-7.3.5.tar.gz

-bash: wget: 未找到命令

[root@localhost devdir]# rpm -qa|grep wget

[root@localhost devdir]# yum -y install wget

[root@localhost devdir]# rpm -qa|grep wget

wget-1.14-18.el7.x86_64

下载PHP7 解压 编译

wget -c https://downloads.php.net/~cmb/php-7.3.4.tar.gz

编译参数解释

--with-fpm-user=webu --with-fpm-group=webg 添加PHP运行用户和用户组

配置信息出错:

下载gcc软件编译器 yum install -y gcc

configure: error: libxml2 not found. Please check your libxml2 installation.

下载libzip-1.5.2.tar.gz

https://libzip.org/download/libzip-1.5.2.tar.gz

解决libzip 和cmake版本问题

重新配置PHP7编译环境参数

libzip-1.5.2 无法安装,已经取消了。

提示off_t类型没有定义 undefind,解决方法:

编译安装

测试PHP是否安装成功

转载自:https://my.oschina.net/u/4127346/blog/3047778

B. centos7怎么编译安装gcc-c++

方法/步骤
1
yum install glibc-static libstdc++-static -y
安装c和c++的静态库(据说如果系统中缺少libc.a和libstdc++.a编译时会出错,但是我没有那么多闲情逸致去试,实践过的朋友可以回复一下,分享一下经验,让大家都长长见识)

2
下载解压gcc,我的gcc目录是gcc-4.8.0
3
进入gcc目录,执行:
./contrib/download_prerequisites
这个神奇的脚本文件会帮我们下载、配置、安装那三个依赖的库。可以节约我们大量的时间和精力。
4
你以为这三个库自动下载了、自动make install了就没事了吗?错!
很多人在编译gcc的时候出现各种奇奇怪怪的错误就是这步没有做好。
它们还不在.so文件的搜索路径里面,需要加进去,最后切记切记一定要执行一下ldconfig。
大致做法为:
1,找到你的共享库文件被install到哪个目录了(updatedb+locate命令)。
2,如果你的库不是直接放在/lib或/usr/lib下,需要修改/etc/ld.so.conf文件,加入你的共享库的路径
3,如果在2中添加了共享库路径,切记要执行一下ldconfig,更新响应cache文件让系统能找到你的共享库。
5
建立临时目录,这个目录用以存放编译时的大量临时文件,是文档要求中必须的。
我是在gcc-4.8.0下建立了一个名为gcc-build-4.8.0的目录,进入它。
mkdir gcc-build-4.8.0
cd gcc-build-4.8.0
配置gcc编译选项
6
强烈建议阅读INSTALL目录下的说明文档,尤其是configure.html,以确定你的编译选项。
比较基本的选项有--enable-languages,说明你要让你的gcc支持那些语言,--disable-multilib不生成编译为其他平台可执行代码的交叉编译器。--disable-checking生成的编译器在编译过程中不做额外检查,也可以使用--enable-checking=xxx来增加一些检查。
网上还说了什么--with-gmp、--with-mpfr、--with-mpc这三个选项,但是如果你3,4步做好了,就不要配了,反之你还是老实点吧别抱侥幸心理了。
调用gcc-4.8.0目录下的configure文件:
例如:
../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
7
执行
../make #不解释

执行编译命令(#在8核的虚拟机上进行编译,每个核分配2个编译任务)
make -j16
make install编译过程CPU 核基本100%占用,整个编译用时11分50秒。
检查gcc版本

#你就等吧少年,建议晚上睡觉前做
当然上面三步一定要在前一步顺利结束的情况下进行,如果哪一步出错了,结果都显示error了,就不要再做后面的了。在shell的输出里搜索"error"看具体的出错点是什么,、google一下为什么。
如果你求稳的话,可以在make install之前先make check一下。

C. CentOS 7下的C语言程序编程与执行

若要明明腔在CentOS7下执行C语言程序,首先得给系槐毕统安装gcc编译环境。

输入命令:which gcc 查看系统是否有安装gcc,

若系统没有安装gcc,输入命令:yum -y install gcc automake autoconf libtool make进行安装

安装完gcc后,让咱激衫们开始来编写第一个C语言程序吧,首先在桌面新建一个文件hello.c文件,

双击打开,

编写C语言程序

点击保存,退出

在终端输入命令:gcc hello.c -o hello回车,进行编译

生产可执行文件

然后输入./hello,执行可执行文件

看见,此时终端打印出hello world!,说明执行成功.

D. centos7.0如何检查gcc编译环境

1,安装gcc,执行如下的几个yum命令即可 Java代码 yum -y install gcc yum -y install gcc-c++ yum install make yum install autoconf automake libtool cmake ncurses-devel openssl-devel gcc* 2,安装JDK,并设置环境变量,完成后测试安装成功

E. centos7怎么编译安装gcc-c++

下为最近升级gcc4.9.2的实际操作步骤
环境: CentOS-7.2 , 当前版本为gcc-4.8.5,用root进行安装

1、先要执行下面这一条命令,安装g++:
yum install gcc-c++

2、 gcc 编译需要三个额外库gmp、mpfr、mpc,下载并按照下面的顺序安装它们,如下:
wget ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.3.tar.gz
wget ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.2.tar.gz
wget http://www.multiprecision.org/mpc/download/mpc-1.0.tar.gz

tar -zxvf gmp-5.1.3.tar.gz
cd gmp-5.1.3
./configure
make && make install
cd ..

tar -zxvf mpfr-3.1.2.tar.gz
cd mpfr-3.1.2
./configure
make && make install
cd ..

tar -zxvf mpc-1.0.tar.gz
cd mpc-1.0
./configure
make && make install
cd ..

3、安装gcc:
wget http://ftp.gnu.org/gnu/gcc/gcc-4.9.2/gcc-4.9.2.tar.bz2
tar -jxvf gcc-4.9.2.tar.bz2
cd gcc-4.9.2
./contrib/download_prerequisites
cd ..

mkdir gcc-build-4.9.2

cd gcc-build-4.9.2
../gcc-4.9.2/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib

make
make install

4、修改/usr/bin/下gcc版本
执行/usr/bin/gcc --version查看版本:
gcc (GCC) 4.4.7-4
/usr/local/bin/gcc --version:
gcc (GCC) 4.8.2
发现多个版本的gcc。

此时执行以下操作:
mv /usr/bin/gcc /usr/bin/gcc4.4.7
ln -s /usr/local/bin/gcc /usr/bin/gcc
mv /usr/bin/g++ /usr/bin/g++4.4.7
ln -s /usr/local/bin/g++ /usr/bin/g++
mv /usr/bin/cc /usr/bin/cc4.4.7
ln -s /usr/local/bin/gcc /usr/bin/cc
mv /usr/bin/c++ /usr/bin/C++4.4.7
ln -s /usr/local/bin/c++ /usr/bin/c++

export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH

5、检查动态库:
strings /usr/lib64/libstdc++.so.6 | grep GLIBC

F. 请教如何在Centos 下安装C/C++编译,开发环境

不知道你要使用哪种库,现在qt比较合适,如果你要求跨平台的话。开发环境就是qtcreator

G. centos7怎么编译安装nginx

安装环境为:最小化安装的centos7,关闭seliunx。
最小化安装centos:
关闭selinux
sed –i ‘s/SELINUX=enforcing/SELINUX=disabled/g’ /etc/selinux/config

开始安装nginx1.7.8
创建群组
groupadd www
创建一个用户,不允许登陆和不创主目录
useradd -s /sbin/nologin -g www -M www
#下载最新版nginx
wget -C http://nginx.org/download/nginx-1.7.8.tar.gz
tar zxvf nginx-1.7.8.tar.gz
#编译基本能运行的nginx
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_mole --with-http_ssl_mole --with-http_gzip_static_mole
make
make install

如果有错误提示:
./configure: error: C compiler cc is not found
解决方法:
yum install gcc gcc-c++

如果有错误提示:
./configure: error: the HTTP rewrite mole requires the PCRE library.
You can either disable the mole by using –without-http_rewrite_mole
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using –with-pcre=<path> option.
解决方法:
yum install pcre-devel

如果有错误提示:
./configure: error: SSL moles require the OpenSSL library.
You can either do not enable the moles, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using –with-openssl=<path> option.
解决方法:
yum install openssl-devel

以上错误提示依次解决后:再一次的运行
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_mole --with-http_ssl_mole --with-http_gzip_static_mole
make
meke install

编译参数解释:
#指定运行权限的用户
--user=www
#指定运行的权限用户组
--group=www
#指定安装路径
--prefix=/usr/local/nginx
#支持nginx状态查询
--with-http_stub_status_mole
#开启ssl支持
--with-http_ssl_mole
#开启GZIP功能
--with-http_gzip_static_mole

因此要顺利的通过nginx编译安装必须安装的依赖关系有:
yum install gc gcc gcc-c++ pcre-devel zlib-devel openssl-devel

2、在 centos7 中为nginx的启动、重启、重载配置添加脚本
nginx直接启动的方法:
/usr/local/nginx/sbin/nginx

但是不是很方便,因此使用下面的脚本来控制nginx的启动关闭重载更加合理一些。
编辑文件:vim /usr/lib/systemd/system/nginx.service 添加下面的脚本,注意路径 !
[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

systemctl的一些使用方法:
systemctl is-enabled servicename.service #查询服务是否开机启动
systemctl enable xxx.service #开机运行服务
systemctl disable xxx.service #取消开机运行
systemctl start xxx.service #启动服务
systemctl stop xxx.service #停止服务
systemctl restart xxx.service #重启服务
systemctl reload xxx.service #重新加载服务配置文件
systemctl status xxx.service #查询服务运行状态
systemctl --failed #显示启动失败的服务

因此,添加上面脚本后,centos7 中操作nginx的方法有
systemctl is-enabled nginx.service #查询nginx是否开机启动
systemctl enable nginx.service #开机运行nginx
systemctl disable nginx.service #取消开机运行nginx
systemctl start nginx.service #启动nginx
systemctl stop nginx.service #停止nginx
systemctl restart nginx.service #重启nginx
systemctl reload nginx.service #重新加载nginx配置文件
systemctl status nginx.service #查询nginx运行状态
systemctl --failed #显示启动失败的服务

热点内容
交易猫买脚本靠谱吗 发布:2025-07-17 11:32:27 浏览:520
服务器系统盘一般做什么阵列 发布:2025-07-17 11:16:05 浏览:362
如何用c语音实现放射密码 发布:2025-07-17 11:13:03 浏览:734
lol脚本2017 发布:2025-07-17 10:52:18 浏览:826
编译条件有哪些 发布:2025-07-17 10:42:51 浏览:333
apache设置静态内容缓存时间 发布:2025-07-17 10:32:32 浏览:294
苹果6不能缓存的视频 发布:2025-07-17 10:31:44 浏览:404
如何把文件夹共享 发布:2025-07-17 10:23:49 浏览:298
linux查看命令大全 发布:2025-07-17 10:21:24 浏览:976
安卓应用程序和苹果手机哪个好 发布:2025-07-17 10:20:43 浏览:411