brew install coreutils failing 10.9.5 OSX - ruby

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.

Related

How can I install lua5.3 for Centos7

Good day,
I really spent almost all after-noon looking to install lua5.3 on Centos 7.
I mostly found information to install Lua5.1 but we really need a version 5.2 or 5.3.
If I found information for 5.3, it was not for Centos.
Until now, the best I could do, is to download the source version from lua web site
enter link description here
But I still can not install it.
Here are my steps, may be you can help to continue
curl -R -O http://www.lua.org/ftp/lua-5.3.4.tar.gz
tar zxf lua-5.3.4.tar.gz
cd lua-5.3.4
make linux test
The problem, from that point how can I install it.
I tried
make
and
make linux
make linux make me a fatal error
[root#pc6 lua-5.3.4]# make linux cd src && make linux make1:
Entering directory /root/install-package/lua-5.3.4/src' make all
SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" make[2]:
Entering directory/root/install-package/lua-5.3.4/src' gcc
-std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -c -o lua.o lua.c lua.c:82:31: fatal error: readline/readline.h: No such
file or directory #include
^ compilation terminated. make[2]: * [lua.o] Error 1 make[2]: Leaving directory
/root/install-package/lua-5.3.4/src' make[1]: *** [linux] Error 2
make[1]: Leaving directory/root/install-package/lua-5.3.4/src' make:
* [linux] Error 2
So what do you suggest me to do. Centos 7 has been istalled today. May do I miss to install a dependent a library?
Thank for your help
The download page which you mention says:
There are detailed instructions in the package
This link points to the README, which says:
If you're running Linux and get compilation errors, make sure you have installed the readline development package (which is probably named libreadline-dev or readline-devel).
If you don't want to install readline, try make posix or make posix MYCFLAGS=-DLUA_USE_DLOPEN MYLIBS=-ldl instead. You may need to do make clean first.
If you are feeling lazy, the IUS repo has prebuilt packages of lua5.3 for el7 under the name lua53u (u presumably stands for "update") (and lua53u-devel, etc, depending on what you need).
Simply enable the repo and then install:
# enable repos
yum install -y epel-release https://repo.ius.io/ius-release-el7.rpm
# install
yum install -y lua53u

GNU Linker equivalent command in OS X

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

how do I set up my gcc again

I've tried to set up CUDA and XCode on my mac to work together, but it failed.
During the process I went to /usr/bin/ and type:
and typed > sudo rm gcc
then > sudo ln -s /opt/local/bin/gcc-4.2 gcc
I think I screwed up something because now when I type in
> gcc
into the terminal, it says
-bash: gcc: command not found
how do I fix it and make the default gcc 4.2?
try doing
sudo ln -s $(which gcc-4.2) gcc
instead. This will find the version of gcc-4.2 you've installed and link the default gcc to it.

A clean Homebrew won't install anything

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.

changing search-dirs for $ sudo gcc

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.

Resources