I was trying to install rabbitmq on OS X 10.6.8 with homebrew, and it failed.. so I tried wiping out my Homebrew installation and reinstalling. Howevever, now I get the same failure message for anything I try to install. I don't see any way to debug this either. Has anyone seen this before? I have XCode 3.2.6 installed as well. Here, I try to install git with
brew install git -v
Output
make -C templates DESTDIR='' install
: no custom templates yet
install -d -m 755 '/usr/local/Cellar/git/1.7.7.1/share/git-core/templates'
readlink: illegal option -- f
usage: readlink [-n] [file ...]
usage: dirname path
ls: /install_*: No such file or directory
(cd blt && tar cf - .) | \
(cd '/usr/local/Cellar/git/1.7.7.1/share/git-core/templates' && umask 022 && tar xof -)
/bin/sh: line 0: cd: /usr/local/Cellar/git/1.7.7.1/share/git-core/templates: No such file or directory
make[1]: *** [install] Error 1
make: *** [install] Error 2
==> Exit Status: 2
http://github.com/mxcl/homebrew/blob/master/Library/Formula/git.rb#L40
==> Environment
HOMEBREW_VERSION: 0.8
HEAD: 9a6bd3473936175163a642e28f6ce0b8a659cf6d
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: 8-core 64-bit sandybridge
OS X: 10.6.8
Kernel Architecture: x86_64
Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode: 3.2.6
GCC-4.0: build 5494
GCC-4.2: build 5666
LLVM: build 2335
MacPorts or Fink? false
X11 installed? true
==> Build Flags
CC: /usr/bin/gcc-4.2
CXX: /usr/bin/g++-4.2
LD: /usr/bin/gcc-4.2
CFLAGS: -O3 -march=core2 -w -pipe
CXXFLAGS: -O3 -march=core2 -w -pipe
MAKEFLAGS: -j8
Error: Failed executing: make prefix=/usr/local/Cellar/git/1.7.7.1 install
These existing issues may help you:
https://github.com/mxcl/homebrew/issues/6257
https://github.com/mxcl/homebrew/issues/6820
https://github.com/mxcl/homebrew/issues/6971
https://github.com/mxcl/homebrew/issues/7462
https://github.com/mxcl/homebrew/issues/8030
https://github.com/mxcl/homebrew/issues/8230
https://github.com/mxcl/homebrew/issues/8244
Otherwise, please report the bug:
https://github.com/mxcl/homebrew/wiki/checklist-before-filing-a-new-issue
:~ $
Assuming homebrew pulled down the files to /usr/local/Cellar/git/1.7.7.1 it looks like you might have an issue with the make command. A few things to try:
Check to see which 'make' is being used : which make by default should be at /usr/bin/make.
If #1 is pointing where you would expect you might try to build a simple hello world project with a make file just to check that it's working properly.
Related
It has been 2 days that I have failed to install coreutils.
Last 15 lines from /Users/Mehdi/Library/Logs/Homebrew/coreutils/03.make:
src/ginstall -c
-m 644 'man/unlink.1' '/usr/local/Cellar/coreutils/8.27/share/man/man1/gunlink.1' src/ginstall -c src/uniq '/usr/local/Cellar/coreutils/8.27/bin/./guniq' src/ginstall -c -m 644 'man/vdir.1' '/usr/local/Cellar/coreutils/8.27/share/man/man1/gvdir.1' src/ginstall -c src/unlink '/usr/local/Cellar/coreutils/8.27/bin/./gunlink' src/ginstall -c src/vdir '/usr/local/Cellar/coreutils/8.27/bin/./gvdir' src/ginstall
-c -m 644 'man/wc.1' '/usr/local/Cellar/coreutils/8.27/share/man/man1/gwc.1' src/ginstall
-c -m 644 'man/whoami.1' '/usr/local/Cellar/coreutils/8.27/share/man/man1/gwhoami.1' src/ginstall -c src/wc '/usr/local/Cellar/coreutils/8.27/bin/./gwc' src/ginstall -c -m 644 'man/yes.1' '/usr/local/Cellar/coreutils/8.27/share/man/man1/gyes.1' src/ginstall -c src/whoami '/usr/local/Cellar/coreutils/8.27/bin/./gwhoami' src/ginstall -c src/yes '/usr/local/Cellar/coreutils/8.27/bin/./gyes' src/ginstall
-c src/ginstall '/usr/local/Cellar/coreutils/8.27/bin' make[2]: *** [install-am] Error 2 make[1]: *** [install-recursive] Error 1 make:
*** [install] Error 2
Do not report this issue to Homebrew/brew or Homebrew/core!
Error: You are using macOS 10.9. We (and Apple) do not provide support for this old version. You may encounter build failures or other breakages. Please create pull-requests instead of filing issues.
As stated in Clemens’ answer, Homebrew doesn’t support macOS 10.9. You can either:
Try TigerBrew, a fork of Homebrew for old macOS versions
Install coreutils from source, with something like the following:
wget https://ftpmirror.gnu.org/coreutils/coreutils-8.25.tar.xz
tar xJf coreutils-8.25.tar.xz
cd coreutils-8.25/
./configure --prefix=/usr/local
make
sudo make install
This might be a stupid question but why are you still running OS 10.9? The current version is 10.12 and 10.13 will become out pretty soon. I'm not sure if this is related in any way to your issue but even the error message tells you that you "may encounter build failures or other breakages".
In short: Unless you have a very good reason not to (e.g. some apps that don't run on newer versions of macOS), I suggest updating to macOS 10.12 and see if it works there.
I want to install perl Gtk2, and for this I need first to have Glib installed. I tried sudo cpanm Glib, but I get an error when compiling (I also tried downloading the .tar.gz source etc., with the same effect). I also tried with an older version of Glib. I’m on OS X 10.11 (El Capitan). Here’s the error :
error: '_GStaticAssertCompileTimeAssertion_0' declared as an array with a negative size
I don’t know how to fix it… Thanks a lot if anyone can do something for me !
(BTW, brew install glib works fine, but it seems the app that I’m trying to build and run — auto-multiple-choice, for instance — is looking for a Gtk2.pm somewhere. So, the ‘glib’ installed by Homebrew is of no help.)
Benjamin
p.-s. : below is the complete log, if it helps :
cpanm (App::cpanminus) 1.7042 on perl 5.018002 built for darwin-thread-multi-2level
Work directory is /Users/benjamin/.cpanm/work/1474765262.7331
You have make /usr/bin/make
You have LWP 6.05
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Searching Glib () on cpanmetadb ...
--> Working on Glib
Fetching http://www.cpan.org/authors/id/X/XA/XAOC/Glib-1.322.tar.gz
-> OK
Unpacking Glib-1.322.tar.gz
Entering Glib-1.322
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (6.66)
Checking if you have ExtUtils::PkgConfig 1.000 ... Yes (1.15)
Checking if you have ExtUtils::Depends 0.300 ... Yes (0.306)
Configuring Glib-1.322
Running Makefile.PL
Including generated API documentation...
Checking if your kit is complete...
Looks good
Writing Makefile for Glib
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::Depends 0.300 ... Yes (0.306)
Checking if you have ExtUtils::PkgConfig 1.000 ... Yes (1.15)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.66)
Building and testing Glib-1.322
cp lib/Glib/CodeGen.pm blib/lib/Glib/CodeGen.pm
cp /Users/benjamin/.cpanm/work/1474765262.7331/Glib-1.322/typemap blib/arch/Glib/Install/typemap
cp lib/Glib/ParseXSDoc.pm blib/lib/Glib/ParseXSDoc.pm
cp doctypes blib/arch/Glib/Install/doctypes
cp devel.pod blib/lib/Glib/devel.pod
cp gperl_marshal.h blib/arch/Glib/Install/gperl_marshal.h
cp lib/Glib/MakeHelper.pm blib/lib/Glib/MakeHelper.pm
cp gperl.h blib/arch/Glib/Install/gperl.h
cp lib/Glib.pm blib/lib/Glib.pm
cp lib/Glib/Object/Subclass.pm blib/lib/Glib/Object/Subclass.pm
cp build/IFiles.pm blib/arch/Glib/Install/Files.pm
cp lib/Glib/GenPod.pm blib/lib/Glib/GenPod.pm
[ XS Glib.xs ]
[ CC Glib.c ]
In file included from Glib.xs:22:
In file included from ./gperl.h:37:
In file included from /usr/local/Cellar/glib/2.48.2/include/glib-2.0/glib-object.h:23:
In file included from /usr/local/Cellar/glib/2.48.2/include/glib-2.0/gobject/gbinding.h:28:
In file included from /usr/local/Cellar/glib/2.48.2/include/glib-2.0/glib.h:30:
In file included from /usr/local/Cellar/glib/2.48.2/include/glib-2.0/glib/galloca.h:32:
/usr/local/Cellar/glib/2.48.2/include/glib-2.0/glib/gtypes.h:422:3: error: '_GStaticAssertCompileTimeAssertion_0' declared as an array with a negative size
G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/glib/2.48.2/include/glib-2.0/glib/gmacros.h:232:103: note: expanded from macro 'G_STATIC_ASSERT'
#define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
^~~~~~~~~~~~~~~
1 error generated.
make: *** [Glib.o] Error 1
-> FAIL Installing Glib failed. See
/Users/benjamin/.cpanm/work/1474765262.7331/build.log for details. Retry with --force to force install it.
This was posted to a GitHub issue.
I tracked down the problem by running:
cpanm --verbose --build-args=NOECHO=' ' Glib
so that I could see the specific compilation command that failed:
cc -c -I. -I/usr/local/Cellar/glib/2.50.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.50.0/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.39/include -D_REENTRANT -arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -Os -DVERSION=\"1.323\" -DXS_VERSION=\"1.323\" -o Glib.o "-I/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE" Glib.c
Since the problem was something to do with mismatching sizeof's, I figured that the problem was that the architecture that Perl was building with does not the architecture that Homebrew's libglib-2.0 was built against.
The fix is to specify that you only want to build for x86_64 by setting the ARCHFLAGS environment variable:
ARCHFLAGS="-arch x86_64" cpanm --verbose Glib
This is all using the system Perl. If you want the install to work in the long run across system upgrades, you will want to install your own user Perl using either perlbrew or plenv.
I ran into the same issue.
Installing gtk+ as a prerequisite fixed it.
I'm reading the following book about operating systems. In Page 43, they use the following command to convert annotated machine code into a raw machine code file:
$ ld -o basic.bin -Ttext 0x0 --oformat binary basic.o
When running that command in my MacBook Pro (running Mavericks), I get:
ld: unknown option: -Ttext
I've did some research and found out that OS X's linker doesn't allow using a script file as the linker script.
Some other posts on the internet recommend using the following "correct" format:
$ ld -T text 0x0 --o format binary -o basic.bin basic.o
Although it didn't work for me neither.
I also tried installing binutils via homebrew, but it doesn't seems to ship with GNU linker.
The command correctly runs in Ubuntu 14.04, but I'd like to continue developing in OS X if possible.
Is there a way to obtain the same results with OS X's linker, potentially with different flags?
UPDATE:
I was able to generate a bin with the following command, using gobjcopy from binutils:
$ gobjcopy -j .text -O binary basic.o basic.bin
However I couldn't find a way to offset label addresses in the code, as I could with GNU ld with -Ttext 0x1000 for example.
I tried with --set-start <hex> without any luck:
$ gobjcopy -j .text --set-start 0x1000 -O binary basic.o basic.bin
I am following the same os-dev.pdf guide and encountered the same problem as you.
The bottom of the issue is that we need to compile a cross-compiled gcc anyway, so the solution is just to do so.
There is a good guide at OSDev but if you're running a recent version of OSX I prepared a specific guide for this on Github
Here are the commands, though please test them before pasting the whole wall of text on your computer! At the Github link you will find the full explanations, but since Stack Overflow seems to like the solution embedded on the answer, here it is.
Also, if you encounter any error, please report it back to me (here or with a Github issue) so that I can fix it for other people.
brew install gmp
brew install mpfr
brew install libmpc
brew install gcc
export CC=/usr/local/bin/gcc-4.9
export LD=/usr/local/bin/gcc-4.9
export PREFIX="/usr/local/i386elfgcc"
export TARGET=i386-elf
export PATH="$PREFIX/bin:$PATH"
mkdir /tmp/src
cd /tmp/src
curl -O http://ftp.gnu.org/gnu/binutils/binutils-2.24.tar.gz # If the link 404's, look for a more recent version
tar xf binutils-2.24.tar.gz
mkdir binutils-build
cd binutils-build
../binutils-2.24/configure --target=$TARGET --enable-interwork --enable-multilib --disable-nls --disable-werror --prefix=$PREFIX 2>&1 | tee configure.log
make all install 2>&1 | tee make.log
cd /tmp/src
curl -O http://mirror.bbln.org/gcc/releases/gcc-4.9.1/gcc-4.9.1.tar.bz2
tar xf gcc-4.9.1.tar.bz2
mkdir gcc-build
cd gcc-build
../gcc-4.9.1/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --disable-libssp --enable-languages=c --without-headers
make all-gcc
make all-target-libgcc
make install-gcc
make install-target-libgcc
You will find GNU's binutils and your cross-compiled gcc at /usr/local/i386elfgcc/bin
manually install binutils always throw errors in my macOS.
The solution is to use homebrew:
brew tap nativeos/i386-elf-toolchain
brew install i386-elf-binutils i386-elf-gcc
then, you can use i386-elf-ld command instead of ld
On my server with FreeBSD 10.0 I get the following error:
# make
/usr/bin/g++ crypto.cpp md4.cpp rsalib1.cpp base64.cpp cmdbase.cpp signer.cpp wmsigner.cpp -o wmsigner
make: exec(/usr/bin/g++) failed (No such file or directory)
*** Error code 1
Stop.
make: stopped in /tmp/wmsigner-2.0.3
/usr/bin/g++ doesn't exist, how do I install it/fix this?
gcc is still available in FreeBSD, under the ports. To install the latest version (as of this writing, 4.9) as a port, do the following:
cd /usr/ports/lang/gcc49/ && make install clean
If you want to install it as a package, do the following:
pkg install lang/gcc49
This will install the C, C++, Fortran and Java front ends as gcc49, g++49,
gfortran49, and gcj49, respectively.
It was renamed in FreeBSD 10. Fixed by creating symlink in /usr/bin:
g++# -> /usr/bin/clang++
On OS X I'm trying to install the zlib prerequisite for haskell's Cabal. I get this error:
$ sudo ./Setup build
Preprocessing library zlib-0.5.0.0…
ld: library not found for -lgmp
collect2: ld returned 1 exit status
linking dist/build/Codec/Compression/Zlib/Stream_hsc_make.o failed
command was: /usr/bin/gcc -lz -L/sw/lib/ghc-6.8.3/lib/bytestring-0.9.0.1.1 -L/sw/lib/ghc-6.8.3/lib/array-0.1.0.0 -L/sw/lib/ghc-6.8.3/lib/base-3.0.2.0 -L/sw/lib/ghc-6.8.3 -lm -lgmp -ldl dist/build/Codec/Compression/Zlib/Stream_hsc_make.o -o dist/build/Codec/Compression/Zlib/Stream_hsc_make
The library -lgmp is found in /sw/lib, so I can run that command ("/usr/bin/gcc ...") successfully if I manually add -L/sw/lib. The problem is that sudo doesn't know about /sw/lib. Behold:
$ gcc -print-search-dirs | grep sw
libraries: =/lib/i686-apple-darwin9/4.0.1/:/lib/:/usr/lib/i686-apple-darwin9/4.0.1/:/usr/lib/:./i686-apple-darwin9/4.0.1/:./:/sw/lib/i686-apple-darwin9/4.0.1/:/sw/lib/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../
$ sudo gcc -print-search-dirs | grep sw
$
How do I tell the sudo version of gcc to look in /sw/lib for libraries? Do I add an environment variable on root's .bash_profile? If so, which one?
UPDATE:
There’s probably a more proper way to do this, but here’s what worked. I created a bash script with this in it:
#!/bin/sh
export LIBRARY_PATH=/sw/lib:$LIBRARY_PATH
./Setup build
And then I ran
$ sudo ./script.sh
That compiled zlib without complaining - hooray! Unfortunately cabal-install is still giving me the error:
$ ./Setup configure
Configuring cabal-install-0.6.2…
Setup: At least the following dependencies are missing:
zlib >=0.4 && <0.6
So I went back to the cabal-install dir (which is what I'm trying to do in the first place), and ran...
$ ./bootstrap.sh
...and that installed everything as expected.
Why you use sudo ever? You should not compile as super user. Compile as normal user and install as super user.
Try setting LDFLAGS=-L/sw/lib.
GHC now comes with an installer for OS X (Leopard, not sure about Tiger). The only issue is that if you use macports or fink, these will probably not see that you have GHC installed and try to install their own version of it.