前言
源码链接
- cmake-3.18.0 https://cmake.org/files/v3.18/cmake-3.18.0.tar.gz
- doxygen-1.10.0 https://www.doxygen.nl/files/doxygen-1.10.0.src.tar.gz
- apache-ant-1.10.8-bin https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.8-bin.tar.gz
- apache-maven-3.6.1-bin https://archive.apache.org/dist/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz
- ccache-4.9.1 https://github.com/ccache/ccache/releases/download/v4.9.1/ccache-4.9.1.tar.gz
可以先下载到本地,然后scp到远程机;也可以直接在远程机下载(速度可能会偏慢)
安装
cmake
步骤
cd cmake-3.18.0
./bootstrap --prefix=/home/6eanut/file/cmake-install
make- j64
make install
export PATH=/home/6eanut/file/cmake-install/bin/:$PATH
问题
在make过程中,发现在Building C object Utilities/cmlibarchive/libarchive/CMakeFiles/cmlibarchive.dir/archive_read_disk_posix.c.o这一步中出现了错误error: redeclaration of
对/cmake-3.18.0/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c做如下修改,删掉红色框内的代码。
doxygen
cmake .. -DCMAKE_INSTALL_PREFIX=/home/6eanut/file/doxygen-install
make
make install
export PATH=/home/6eanut/file/doxygen-install/bin/:$PATH
ant
解压后只需配置环境变量即可使用
maven
解压后只需配置环境变量即可使用
ccache
cmake .. -DCMAKE_INSTALL_PREFIX=/home/6eanut/file/ccache-install
make
make install
export PATH=/home/6eanut/file/ccache-install/bin/:$PATH
总结
之前没有尝试过在unix系统下,从源码开始编译安装一个开源软件。可以看出这次安装的apache的软件都是解压过源码之后,bin文件就在文件夹下,只需要配置环境变量就可以了。剩下的软件,可以打开源码目录查看是否有CMakeLists.txt,如果有的话,就mkdir build; cd build,然后执行cmake, make, make install,最后配置一下环境变量即可。