当前位置:网站首页>Record of cmake and GCC installation

Record of cmake and GCC installation

2022-06-10 18:02:00 Hua Weiyun

install 3.5.2 edition cmake

1. Use wget download cmake Source package , It can be downloaded to any directory of the installation server , The order is :

wget https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz --no-check-certificate 

2. Enter the downloaded directory , Decompress the source package , The order is :

tar -zxvf cmake-3.5.2.tar.gz 

3. Enter the unzipped folder , Perform configuration , Compile and install commands :

cd cmake-3.5.2./bootstrap --prefix=/usrmakesudo make install

4. After the installation is completed, execute again cmake --version View version number :

camke --version

install 7.3.0 edition gcc

For the following steps, please root Execute under the user .

1. download gcc-7.3.0.tar.gz.

2. install gcc It takes up a lot of temporary space , So first execute the following command to clear /tmp Catalog :

sudo rm -rf /tmp/*

3. Installation dependency ( With Ubuntu System as an example ).

Ubuntu Execute the following command to install :

apt-get install bzip2

4. Compilation and installation gcc.

(1) Get into gcc-7.3.0.tar.gz Source code package directory , Decompress the source package , The order is :

tar -zxvf gcc-7.3.0.tar.gz

(2) Enter the unzipped folder , Execute the following command to download gcc Dependency package :

cd gcc-7.3.0./contrib/download_prerequisites

If you execute the above command, an error is reported , You need to execute the following command in “gcc-7.3.0/” Download the dependent package under the folder :

wget http://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2wget http://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2wget http://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gzwget http://gcc.gnu.org/pub/gcc/infrastructure/isl-0.16.1.tar.bz2

After downloading the above dependent packages , Re execute the following command :

./contrib/download_prerequisites

If the above command verification fails , You need to ensure that the dependent package is downloaded successfully at one time , No repeated downloading .

(3) Perform configuration 、 Compile and install commands :

./configure --enable-languages=c,c++ --disable-multilib --with-system-zlib --prefix=/usr/local/gcc7.3.0make -j15    #  adopt grep -w processor /proc/cpuinfo|wc -l see cpu Count , An example is 15, Users can set corresponding parameters by themselves .make install

Be careful

among “–prefix” Parameter to specify gcc7.3.0 The installation path , Users can configure , But be careful not to configure it as “/usr/local” And “/usr”, Because the software source will be installed by default with the system gcc Conflict , Result in the original system gcc The compilation environment is corrupted . Example specified as “/usr/local/gcc7.3.0”.

5. Configure environment variables ( Please configure it when necessary )

For example, the user needs to execute the following commands to configure environment variables before starting the online reasoning or training process .

export LD_LIBRARY_PATH=/usr/local/gcc7.3.0/lib64:${LD_LIBRARY_PATH}

among “/usr/local/gcc7.3.0” by 4.c Configured in gcc7.3.0 The installation path , Please replace according to the actual situation .

原网站

版权声明
本文为[Hua Weiyun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206101717424395.html