1.自定义编译安装#
tar -zxvf XX.tar.gz
cd XX
./configure --prefix=/home/myname/software
make && make install
2.各种环境变量#
在PATH中找到可执行文件程序的路径。
export PATH =$PATH:$HOME/bin
gcc找到头文件的路径
C_INCLUDE_PATH=/usr/include/libxml2:/MyLib
export C_INCLUDE_PATH
g++找到头文件的路径CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include/libxml2:/MyLib
export CPLUS_INCLUDE_PATH
找到动态链接库的路径LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/MyLib
export LD_LIBRARY_PATH
找到静态库的路径LIBRARY_PATH=$LIBRARY_PATH:/MyLib
export LIBRARY_PATH
3.fPIC编译文件#
openssl在编译时使用./config --prefix=/path/ --openssldir=/path/ssl shared
fPIC编译选项是将地址不固定的动态链接库链接
4.python链接外部动态库时#
./configure --prefix=/path/ --enable-shared
make clean
make && make install