以前に別のフォルダーにインストールされていたコンパイル済みプログラムをインストールします。

以前に別のフォルダーにインストールされていたコンパイル済みプログラムをインストールします。

特定のフォルダでコンパイルgccと依存関係(gmp、、、、mpfrmpcをコンパイルプロセスを繰り返し、他のコンピュータに渡さずに別のフォルダにバックアップします。

作るアップデートのみ

$ 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
$ 

質問

このフォルダを使用して他のコンピュータをどのように更新(makegmpおよび)しますか?mpfrmpcgcc

  • 前のコマンドを変更します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:[ ~]$ 

おすすめ記事