Não funciona para 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
$
Tentando com root
user
$ 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
$
Em ambos os casos, recebo:
$ echo $LD_LIBRARY_PATH
$
AQUI minha solução para lib
!
$ more /etc/ld.so.conf.d/custom.conf
/usr/local/Custom/gmp/lib
/usr/local/Custom/mpfr/lib
/usr/local/Custom/mpc/lib
AQUI minha solução para include
e 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
$
Agora eu confiro:
$ 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.
Infelizmente recebo:
$ whereis gmp mpfr mpc
gmp:mpfr:mpc:[ ~]$