Giter VIP home page Giter VIP logo

Comments (13)

sjackman avatar sjackman commented on June 4, 2024

gmp hasn't yet been patched to remove the MacOS-specific stuff. A pull request would be happily accepted. Use if OS.mac? as necessary.

from legacy-linuxbrew.

dongli avatar dongli commented on June 4, 2024

@sjackman How to use and where to place if OS.mac??

from legacy-linuxbrew.

dongli avatar dongli commented on June 4, 2024

@sjackman I have figured out how to add if OS.mac? for gmp4 and mpfr2, so where should these changes be pulled?

from legacy-linuxbrew.

dongli avatar dongli commented on June 4, 2024

@sjackman Hi, I found make check failed because it can not find keg-only library. For example, when make check mpfr2, gmp4's lib directory should be in LD_LIBRARY_PATH. Currently, I made the following changes:

system "make check" if OS.mac?
system "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:#{gmp4.opt_prefix}/lib && make check" if OS.linux?

Is that OK?

from legacy-linuxbrew.

sjackman avatar sjackman commented on June 4, 2024

If the patch won't be merged upstream into Homebrew, I prefer as small a patch as possible, to reduce merge conflicts. In this case, I'd just use:

    system "make check" unless OS.linux? # Fails without LD_LIBRARY_PATH

The real solution is to make sure on Linux systems that the LD_LIBRARY_PATH environment variable is not cleared by superenv.

from legacy-linuxbrew.

dongli avatar dongli commented on June 4, 2024

@sjackman I think we can not put the installed gmp4, mpfr2 and so on into LD_LIBRARY_PATH, since they may cause conflicts with the system ones. I don't know why it is OK in Mac.

from legacy-linuxbrew.

dongli avatar dongli commented on June 4, 2024

@sjackman I have successfully installed gcc49, but libgcc_s.so in .linuxbrew/opt/gcc49/lib/gcc/x86_64-unknown-linux-gnu/{lib32, lib64} is not linked into .linuxbrew/opt/gcc49/lib/gcc/x86_64-unknown-linux-gnu/4.9.0, and this cause

/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status

When I $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.linuxbrew/opt/gcc49/lib/gcc/x86_64-unknown-linux-gnu/lib64, the error is gone.

from legacy-linuxbrew.

sjackman avatar sjackman commented on June 4, 2024

@dongli On Mac OS, the path to libgcc_s.1.dylib is hardcoded in the executable:

$ gcc-4.8 hello.c -o hello
$ otool -L hello
hello:
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
    /usr/local/Cellar/gcc48/4.8.2/gcc/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
$ otool -l hello |grep gcc_s
         name /usr/local/Cellar/gcc48/4.8.2/gcc/lib/libgcc_s.1.dylib (offset 24)

from legacy-linuxbrew.

sjackman avatar sjackman commented on June 4, 2024

@dongli I've compiled gcc48 on Linux and reproduced your error:

$ gcc-4.8 hello.c -o hello
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status

from legacy-linuxbrew.

dongli avatar dongli commented on June 4, 2024

So what should we do to remove this little inconvenience?

from legacy-linuxbrew.

sjackman avatar sjackman commented on June 4, 2024

I don't have a quick fix. It's going to require some troubleshooting.

from legacy-linuxbrew.

sjackman avatar sjackman commented on June 4, 2024

This appears to be a known issue, bug 32415.

This workaround worked for me:

cd `brew --prefix gcc48`/lib/gcc/x86_64-unknown-linux-gnu/4.8.2
ln -s ../lib64/libgcc_s.so* .

from legacy-linuxbrew.

sjackman avatar sjackman commented on June 4, 2024

I've created a new issue, #66.

from legacy-linuxbrew.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.