특정 폴더에서 컴파일 gcc
및 종속성( gmp
, , mpfr
, ) mpc
을 컴파일 프로세스를 반복하고 다른 컴퓨터로 전달하지 않고 다른 폴더에 백업합니다.
만들다업데이트에만 해당
$ tar zxvf make-4.2.1.tar.gz -C /usr/local/Sources/
$ cd /usr/local/Sources/make-4.2.1/
$ ./configure --prefix=/usr/local/Custom/make
$ sh ./build.sh
$ ./make check
$ sudo ./make install
GCC 종속성
좋은 제조 관행
$ tar Jxvf gmp-6.1.2.tar.xz -C /usr/local/Sources/
$ cd /usr/local/Sources/gmp-6.1.2/
$ ./configure --prefix=/usr/local/Custom/gmp --enable-cxx --disable-static
$ make
$ sudo make install
MPFR
$ tar -zxvf mpfr-3.1.6.tar.gz -C /usr/local/Sources/
$ ./configure --prefix=/usr/local/Custom/mpfr --disable-static --enable-thread-safe --with-gmp=/usr/local/Custom/gmp
$ make
$ sudo make install
다지점 제어
$ tar -zxvf mpc-1.0.3.tar.gz -C /usr/local/Sources/
$ cd /usr/local/Sources/mpc-1.0.3/
$ ./configure --prefix=/usr/local/Custom/mpc --with-gmp=/usr/local/Custom/gmp -with-mpfr=/usr/local/Custom/mpfr
$ make
$ make check
$ sudo make install
http://www.linuxfromscratch.org/blfs/view/cvs/general/gcc.html
걸프 협력 협의회
$ tar zxvf gcc-7.2.0.tar.gz -C /usr/local/Sources/
$ cd /usr/local/Sources/gcc-7.2.0/
$ ./configure --prefix=/usr/local/Custom/gcc --with-system-zlib --disable-multilib --enable-lenguages=c,c++ --with-gmp=/usr/local/Custom/gmp -with-mpfr=/usr/local/Custom/mpfr --with-mpc=/usr/local/Custom/mpc
$ time make -j $(nproc)
소요된 시간은8시간 이상
real 506m8.644s
user 461m46.399s
sys 30m54.429s
$
$ time sudo make install
소요된 시간은
real 1m52.495s
user 0m35.449s
sys 0m35.820s
$
이제 계층 구조는 다음과 같습니다.
$ tree -d /usr/local/Custom/
/usr/local/Custom/
├── gcc
│ ├── bin
│ ├── include
│ │ └── c++
│ │ └── 7.2.0
│ │ ├── backward
│ │ ├── bits
│ │ ├── debug
│ │ ├── decimal
│ │ ├── experimental
│ │ │ └── bits
│ │ ├── ext
│ │ │ └── pb_ds
│ │ │ └── detail
│ │ │ ├── REMOVED IN ORDER TO MAKE SHORT THIS QUESTION
│ │ ├── parallel
│ │ ├── profile
│ │ │ └── impl
│ │ ├── tr1
│ │ ├── tr2
│ │ └── x86_64-pc-linux-gnu
│ │ ├── bits
│ │ └── ext
│ ├── lib
│ │ └── gcc
│ │ └── x86_64-pc-linux-gnu
│ │ └── 7.2.0
│ │ ├── REMOVED IN ORDER TO MAKE SHORT THIS QUESTION
│ ├── lib64
│ ├── libexec
│ │ └── gcc
│ │ └── x86_64-pc-linux-gnu
│ │ └── 7.2.0
│ │ ├── install-tools
│ │ └── plugin
│ └── share
│ ├── gcc-7.2.0
│ │ └── python
│ │ └── libstdcxx
│ │ └── v6
│ ├── info
│ ├── locale
│ │ ├── REMOVED IN ORDER TO MAKE SHORT THIS QUESTION
│ └── man
│ ├── man1
│ └── man7
├── gmp
│ ├── include
│ ├── lib
│ └── share
│ └── info
├── make
│ ├── bin
│ ├── include
│ └── share
│ ├── info
│ ├── locale
│ │ ├── REMOVED IN ORDER TO MAKE SHORT THIS QUESTION
│ └── man
│ └── man1
├── mpc
│ ├── include
│ ├── lib
│ └── share
│ └── info
├── mpfr
│ ├── include
│ ├── lib
│ └── share
│ ├── doc
│ │ └── mpfr
│ │ └── examples
│ └── info
이제 Destiny Machine에서는 Original locations
다음과 같은 기능을 제공합니다.
$ whereis gmp mpfr mpc
gmp: /usr/include/gmp.h
mpfr: /usr/include/mpfr.h
mpc: /usr/include/mpc.h
$ which make gcc
/usr/local/bin/make
/usr/bin/gcc
$
질문
이 폴더를 사용하여 다른 컴퓨터를 어떻게 업데이트( make
, gmp
및 ) 합니까?mpfr
mpc
gcc
- 이전 명령을 바꾸시겠습니까
Original locations
? - 이전 명령을 다른 폴더에 보관하시겠습니까(예:
/my/Folder/Commands
:)?
답변1
적합하지 않음LD_LIBRARY_PATH
$ more /etc/environment
PATH=/usr/local/Custom/make/bin:/usr/local/Custom/gcc/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
CPATH=/usr/local/Custom/make/include:/usr/local/Custom/gmp/include:/usr/local/Custom/mpfr/include:/usr/local/Custom/mpc/include
LD_LIBRARY_PATH=/usr/local/Custom/gmp/lib:/usr/local/Custom/mpfr/lib:/usr/local/Custom/mpc/lib
$
root
사용자와 함께 사용해 보세요
$ more /root/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
LD_LIBRARY_PATH=/usr/local/Custom/gmp/lib:/usr/local/Custom/mpfr/lib:/usr/local/Custom/mpc/lib
export LD_LIBRARY_PATH
$
두 경우 모두 다음을 얻습니다.
$ echo $LD_LIBRARY_PATH
$
이것이 내 솔루션입니다 lib
!
$ more /etc/ld.so.conf.d/custom.conf
/usr/local/Custom/gmp/lib
/usr/local/Custom/mpfr/lib
/usr/local/Custom/mpc/lib
이것이 내 솔루션 include
입니다 bin
!
$ more /etc/environment
PATH=/usr/local/Custom/make/bin:/usr/local/Custom/gcc/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/
sbin:/bin:/sbin
CPATH=/usr/local/Custom/make/include:/usr/local/Custom/gmp/include:/usr/local/Custom/mpfr/include:/usr/local/Custom/mpc/include
$
이제 확인합니다:
$ which make gcc
/usr/local/Custom/make/bin/make
/usr/local/Custom/gcc/bin/gcc
$
$ cpp -v
Using built-in specs.
COLLECT_GCC=cpp
Target: x86_64-pc-linux-gnu
Configured with: ./configure --prefix=/usr/local/Custom/gcc --with-system-zlib --disable-multilib --enable-lenguages=c,c++ --with-gmp=/usr/local/Custom/gmp -with-mpfr=/usr/local/Custom/mpfr --with-mpc=/usr/local/Custom/mpc
Thread model: posix
gcc version 7.2.0 (GCC)
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=x86-64'
/usr/local/Custom/gcc/libexec/gcc/x86_64-pc-linux-gnu/7.2.0/cc1 -E -quiet -v - -mtune=generic -march=x86-64
ignoring nonexistent directory "/usr/local/Custom/gcc/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/Custom/make/include
/usr/local/Custom/gmp/include
/usr/local/Custom/mpfr/include
/usr/local/Custom/mpc/include
/usr/local/Custom/gcc/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include
/usr/local/include
/usr/local/Custom/gcc/include
/usr/local/Custom/gcc/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include-fixed
/usr/include
End of search list.
불행하게도 나는 다음을 얻습니다:
$ whereis gmp mpfr mpc
gmp:mpfr:mpc:[ ~]$