Giter Site home page Giter Site logo

Cannot build anything from source. about brew HOT 15 CLOSED

rwhogg avatar rwhogg commented on August 18, 2024
Cannot build anything from source.

from brew.

Comments (15)

sjackman avatar sjackman commented on August 18, 2024 1

As a workaround try either deleting this line:
https://github.com/Linuxbrew/brew/blob/master/Library/Homebrew/os/linux/hardware.rb#L5

    :core => "-march=prescott",

Or try changing this line to

    :core => "-march=native",

from brew.

sjackman avatar sjackman commented on August 18, 2024 1

CPU: quad-core 64-bit presler
Looks good to me. And you can compile software now without setting HOMEBREW_ARCH?

from brew.

rwhogg avatar rwhogg commented on August 18, 2024

From https://gist.github.com/anonymous/e9ee006389eb2f2d14b34e4db5c195f0#file-01-configure-L15-L19

checking for gcc... /usr/bin/gcc-4.8
checking whether the C compiler works... no
configure: error: in `/tmp/gdbm-20160516-20156-s31fqz/gdbm-1.11':
configure: error: C compiler cannot create executables
See `config.log' for more details

From https://gist.github.com/anonymous/e9ee006389eb2f2d14b34e4db5c195f0#file-config-log-L91-L92

configure:3659: /usr/bin/gcc-4.8 -Os -w -pipe -march=prescott -isystem/home/zkanda/.linuxbrew/include -L/home/zkanda/.linuxbrew/lib -Wl,--dynamic-linker=/home/zkanda/.linuxbrew/lib/ld.so -Wl,-rpath,/home/zkanda/.linuxbrew/lib conftest.c  >&5
conftest.c:1:0: error: CPU you selected does not support x86-64 instruction set

from brew.

rwhogg avatar rwhogg commented on August 18, 2024

@zkanda, can I ask for some clarification about your computer architecture? The gist says you're running this on an Intel Prescott.

According to Wikipedia, there are both 32-bit and 64-bit versions of the Prescott. Which one are you using? We unfortunately don't support 32-bit architectures at this time (but would welcome assistance if you'd like to help support it).

From GCC's web site:

‘prescott’
    Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction set support. 

Is that part of your CFLAGS variable or did Linuxbrew insert it itself?

Thanks a bunch!

By the way, I'll probably move this issue to Linuxbrew/brew if I determine that it's a bug in Linuxbrew itself and not just gdbm in particular.

from brew.

rwhogg avatar rwhogg commented on August 18, 2024

From @zkanda on May 16, 2016 11:47

Yes, this is not just about gdbm, everything that I need to compile is having this issue. This is running in VM in our server which is supposed to be 64-bit.

Here is the output of uname -a

→ uname -a
Linux dev-server 3.19.0-59-generic #65~14.04.1-Ubuntu SMP Tue Apr 19 18:57:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

I didn't change any CFLAGS settings as I don't even know how to do that but I would be willing to help on whatever I can.

from brew.

zkanda avatar zkanda commented on August 18, 2024

I tried the first workaround and it now compiles.

from brew.

sjackman avatar sjackman commented on August 18, 2024

Glad to hear that the work around worked for you. Thanks for the bug report, Zakatell.

from brew.

sjackman avatar sjackman commented on August 18, 2024

I'm not sure what the fix should be.

prescott    Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction set support. 
nocona      Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE, SSE2 and SSE3 instruction set support.

https://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/i386-and-x86_002d64-Options.html

It looks to me like -march=prescott is for 32-bit and it should be -march=nocona for 64-bit.
I'm not sure, but perhaps this line needs to be split up into 32-bit and 64-bit processors:
https://github.com/Linuxbrew/brew/blob/master/Library/Homebrew/os/linux/hardware.rb#L73

      when 0x0f
        case cpu_model
        when 0x06, 0x03, 0x04
          :core # Presler and Prescott
        else

from brew.

sjackman avatar sjackman commented on August 18, 2024

I've added a HOMEBREW_ARCH environment variable. See #42. Try

export HOMEBREW_ARCH=native

from brew.

sjackman avatar sjackman commented on August 18, 2024

If you're able to do some troubleshooting for us, could you try applying the following patch and then report the output of brew config:

diff --git a/Library/Homebrew/os/linux/hardware.rb b/Library/Homebrew/os/linux/hardware.rb
index 8e44693..e1ae500 100644
--- a/Library/Homebrew/os/linux/hardware.rb
+++ b/Library/Homebrew/os/linux/hardware.rb
@@ -71,7 +71,7 @@ module LinuxCPUs
       when 0x0f
         case cpu_model
         when 0x06, 0x03, 0x04
-          :core # Presler and Prescott
+          cpu_family_model
         else
           cpu_family_model
         end

Incidentally, this patch should also work around your issue.

from brew.

zkanda avatar zkanda commented on August 18, 2024

Tested the patch and it seems to be working as well, here's my brew config

○ → brew config
HOMEBREW_VERSION: 0.9.9
ORIGIN: https://github.com/Linuxbrew/brew
HEAD: b5ed40ce119e6bee0846e8f0a33531151b49cc76
Last commit: 13 hours ago
Core tap ORIGIN: https://github.com/Linuxbrew/homebrew-core
Core tap HEAD: 4d7312aa37084141dce5d52a0963186e809fa302
Core tap last commit: 6 hours ago
HOMEBREW_PREFIX: /home/zkanda/.linuxbrew
HOMEBREW_REPOSITORY: /home/zkanda/.linuxbrew
HOMEBREW_CELLAR: /home/zkanda/.linuxbrew/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://linuxbrew.bintray.com
CPU: quad-core 64-bit 0xf06
Kernel: Linux 3.19.0-59-generic x86_64 GNU/Linux
OS: Ubuntu 14.04.4 LTS
Codename: trusty
OS glibc: 2.19
OS gcc: 4.8.4
Linuxbrew glibc: N/A
Linuxbrew gcc: N/A
Clang: N/A
X11: 2.7.8 => /usr
System Ruby: 1.9.3-p484 => /usr/bin/ruby1.9.1
Perl: /usr/bin/perl
Python: /usr/bin/python => /usr/bin/python2.7
Ruby: /usr/bin/ruby => /usr/bin/ruby1.9.1
Java: N/A

from brew.

sjackman avatar sjackman commented on August 18, 2024

CPU: quad-core 64-bit 0xf06
Looks like Prescott (Intel Core Duo) and Presler need to be separated.

from brew.

sjackman avatar sjackman commented on August 18, 2024

I've committed a fix for this issue. Can you test it out and after brew update report the output of brew config?

from brew.

zkanda avatar zkanda commented on August 18, 2024

Updated, here's the new brew-config

○ → brew config
HOMEBREW_VERSION: 0.9.9
ORIGIN: https://github.com/Linuxbrew/brew
HEAD: b21be51aaef7a4d4a328c3182002c217f55a80c1
Last commit: 3 hours ago
Core tap ORIGIN: https://github.com/Linuxbrew/homebrew-core
Core tap HEAD: 788c967783c39a359122d4a64ac4572971ac77be
Core tap last commit: 28 hours ago
HOMEBREW_PREFIX: /home/zkanda/.linuxbrew
HOMEBREW_REPOSITORY: /home/zkanda/.linuxbrew
HOMEBREW_CELLAR: /home/zkanda/.linuxbrew/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://linuxbrew.bintray.com
CPU: quad-core 64-bit presler
Kernel: Linux 3.19.0-59-generic x86_64 GNU/Linux
OS: Ubuntu 14.04.4 LTS
Codename: trusty
OS glibc: 2.19
OS gcc: 4.8.4
Linuxbrew glibc: N/A
Linuxbrew gcc: N/A
Clang: N/A
X11: N/A
System Ruby: 1.9.3-p484 => /usr/bin/ruby1.9.1
Perl: /usr/bin/perl
Python: /usr/bin/python => /usr/bin/python2.7
Ruby: /usr/bin/ruby => /usr/bin/ruby1.9.1
Java: N/A

from brew.

zkanda avatar zkanda commented on August 18, 2024

Yes, definitely, thank you so much for looking into these.

from brew.

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.