I installed homebrew
on my Ubuntu machine and installed gcc
with it. Than I copied /home/linuxbrew
folder to another machine into /home/my_program/tools
directory. When I try to run gcc
from that folder I get the No such file or directory
error:
sm@sm:~/my_program$ ./tools/ubuntu/linuxbrew/.linuxbrew/bin/gcc
bash: ./tools/ubuntu/linuxbrew/.linuxbrew/bin/gcc: No such file or directory
but the file is there.
Then I ran ldd
on it and I got this:
sm@sm:~/my_program$ ldd ./tools/ubuntu/linuxbrew/.linuxbrew/bin/gcc
linux-vdso.so.1 (0x00007ffd7a387000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f31458e6000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3145600000)
/home/linuxbrew/.linuxbrew/lib/ld.so => /lib64/ld-linux-x86-64.so.2 (0x00007f31459de000)
I guess the problem might be with the absolute path to /home/linuxbrew/.linuxbrew/lib/ld.so
. I tried preloading ld.so
from my_program
directory using LD_PRELOAD
environment variable, but then I got the Floating point exception (core dumped)
:
export LD_PRELOAD=/home/sm/my_program/tools/ubuntu/linuxbrew/.linuxbrew/Cellar/glibc/2.35_1/bin/ld.so; ldd ./tools/ubuntu/linuxbrew/.linuxbrew/bin/gcc
Floating point exception (core dumped)
Any ideas what might be the problem? Is this even possible what I am trying to achieve (ie. not install homebrew
on another machine, but use gcc
that was installed with homebrew
on the first machine)?