configure: error: C compiler cannot create executables with Mavericks - macos

I've checked stackoverflow but haven't found an answer yet.
I'm trying to install wget on Mavericks as shown here.
Here's what I'm getting:
bolo:wget-1.14 Michelin$ subl config.log
bolo:wget-1.14 Michelin$ ./configure --with-ssl=openssl
configure: configuring for GNU Wget 1.14
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking build system type... i386-apple-darwin13.0.0
checking host system type... i386-apple-darwin13.0.0
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/Michelin/Downloads/wget-1.14':
configure: error: C compiler cannot create executables
See `config.log' for more details
My config.log:
https://gist.github.com/bolom/7552389
Other thing I have installed Command Line tools BUT I don't the assembler :(
B.

Below solved this for me in Mavericks. I had to use sudo for this to work.
From https://trac.macports.org/wiki/ProblemHotlist
Xcode License Agreement
When attempting to build a port which compiles an OS X app (e.g., gimp-app), the compilation may fail with an xcodebuild error. One of the possible causes of this is that an initial run of xcodebuild from the terminal may be needed to accept the EULA before any compilation can proceed. Run:
xcodebuild -license
from a terminal window and follow the prompts. After accepting the EULA, rebuild the port again.
With some ports and some versions of Xcode (e.g. libunwind-headers with Xcode 4.4+) you may need to accept the license as root, i.e.:
sudo xcodebuild -license
This will need to be repeated after any Xcode upgrade.

i'd suggest using homebrew (http://brew.sh/) to install wget:
brew install wget
an additional note for others out there: upgrading your command line tools for Mavericks is easy like this: http://www.computersnyou.com/2025/

I came across the same issue when working with Mac Ports for the first time.
When you newly install Xcode and command line tools, there's a license agreement you have to agree to first before the tools (and indeed Xcode) actually work.
Bring up a terminal session and type "ac" (no quotes)
You will be prompted to accept the license agreement. Page down and enter 'agree' at the end.
You should then be good too go!
Compiles worked for me from that point on.
Cheers

Related

Installing valgrind on Mac OS X Catalina [duplicate]

I tried to install Valgrind with the command "brew install valgrind" and I get a message that says:
"valgrind: This formula either does not compile or function as expected on macOS versions newer than Sierra due to an upstream incompatibility. Error: An unsatisfied requirement failed this build."
I also tried to "brew edit valgrind" and replace "sourceware.org/git/valgrind.git" with "git://sourceware.org/git/valgrind.git" in head section of the code, then wrote on Iterm "brew install --HEAD valgrind" but it gives me:
Last 15 lines from /Users/m/Library/Logs/Homebrew/valgrind/02.configure:
checking for gcc-ar... no
checking for perl... /usr/bin/perl
checking for gdb... /no/gdb/was/found/at/configure/time
checking dependency style of clang... none
checking for diff -u... yes
checking for clang option to accept ISO C99... none needed
checking for a supported version of gcc... ok (clang-11.0.0)
checking build system type... x86_64-pc-darwin
checking host system type... x86_64-pc-darwin
checking for a supported CPU... ok (x86_64)
checking for a 64-bit only build... yes
checking for a 32-bit only build... no
checking for a supported OS... ok (darwin)
checking for the kernel version... unsupported (19.0.0)
configure: error: Valgrind works on Darwin 10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x and 17.x (Mac OS X 10.6/7/8/9/10/11 and macOS 10.12/13)
READ THIS: https://docs.brew.sh/Troubleshooting
See https://github.com/LouisBrunner/valgrind-macos/.
Either try
brew tap LouisBrunner/valgrind
brew install --HEAD LouisBrunner/valgrind/valgrind
Or compile it from the source, if the above method doesn't work. (But they should have fixed the above method just recently.)
git clone https://github.com/LouisBrunner/valgrind-macos.git
cd valgrind-macos
./autogen.sh
./configure --prefix=/where/you/want/it/installed --enable-only64bit
make
sudo make install
Enjoy!
https://github.com/sowson/valgrind
brew install --HEAD https://raw.githubusercontent.com/sowson/valgrind/master/valgrind.rb
MacOS Catalina (10.15.4), I was able to confirm the operation.

(Configuring Bitcoin core) configure: error: libdb_cxx headers missing

I've downloaded Bitcoin core from Github and am trying to set it up via instructions from Andreas Antonopoulos Bitcoin book Mastering Bitcoin Chapter 3 (The Bitcoin client)
Currently stuck on the configure step, when I run ./configure everything is looking good till it ends with the following error:
...
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for MSG_NOSIGNAL... no
checking for Berkeley DB C++ headers... no
configure: error: libdb_cxx headers missing
I'm using homebrew, how do I fix this error?
Ah figured it out, I didn't completely finish reading all the instructions in the build-osx.md file
#### Installing berkeley-db4 using Homebrew
The homebrew package for berkeley-db4 has been broken for some time. It will install without Java though.
Running this command takes you into brew's interactive mode, which allows you to configure, make, and install by hand:
```
$ brew install https://raw.github.com/mxcl/homebrew/master/Library/Formula/berkeley-db4.rb -–without-java
```
These rest of these commands are run inside brew interactive mode:
```
/private/tmp/berkeley-db4-UGpd0O/db-4.8.30 $ cd ..
/private/tmp/berkeley-db4-UGpd0O $ db-4.8.30/dist/configure -- prefix=/usr/local/Cellar/berkeley-db4/4.8.30 --mandir=/usr/local/Cellar/berkeley-db4/4.8.30/share/man --enable-cxx
/private/tmp/berkeley-db4-UGpd0O $ make
/private/tmp/berkeley-db4-UGpd0O $ make install
/private/tmp/berkeley-db4-UGpd0O $ exit
```
After exiting, you'll get a warning that the install is keg-only, which means it wasn't symlinked to /usr/local. You don't need it to link it to build bitcoin, but if you want to, here's how:
$ brew --force link berkeley-db4
brew install berkeley-db4
then
brew link berkeley-db4 --force
worked for me. not the ones proposed here
This is what worked for me:
sudo apt install libdb5.3++ libdb5.3++-dev
For those who uses fedora like me
sudo dnf install libdb-cxx-devel
and it may give warning about incompatible libdb version, you can ignore that with
./configure --with-incompatible-bdb

Mac OS X Lion Xcode problems using RVM

I had Xcode 4.1 preview 5 working fine but decided to upgrade to the final xcode 4.1 thru the App store. I uninstalled Xcode first...
sudo /Developer/Library/uninstall-devtools –mode=all
Then installed Xcode thru the app store and rebooted.
I also removed RVM completely but... now whenever I try and install a version of Ruby it fails. In the error file i get this:
[2011-07-27 18:29:25] ./configure --prefix="/Users/holden/.rvm/usr"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking for gcc... /usr/bin/gcc-4.2
checking whether the C compiler works... no
configure: error: in `/Users/holden/.rvm/src/yaml-0.1.4':
configure: error: C compiler cannot create executables
See `config.log' for more details
There is no gcc-4.2 or any other gcc in the /usr/bin directory.
What's up with Xcode?
Apparently even after downloading and "installing" XCode from the Appstore and despite the long process after downloading where it appears to install it and the words "Installed" eventually become displayed next to it in the store. You must still manually install it again within your applications folder before it will work.
Odd.
Just bought a Mac,
what I had to do to make it work after installing Xcode and seeing that /usr/bin doesn't have gcc, was:
Enter Xcode preferences going over to the downloads tab and install Command Line Tools.
After setting up my developer account and downloading the tools I opened terminal and typed
rvm install 1.9.3 --with-gcc=clang
and everything compiled and works.
Note - after running "Install Xcode" I still only have "gcc" in /usr/bin, not gcc-4.2. But still worked fine, /usr/bin/gcc was a symlink to /usr/bin/llvm-gcc-4.2
Guy's answer above seems to fix the problem compiling Ruby in RVM with XCode 4.2 installed completely, and removed for me to install GCC from https://github.com/kennethreitz/osx-gcc-installer . This is preferable for users needing to have both RVM and XCode 4.2 installed.

How to fix this RVM error on a Macbook Pro i7 Running 10.6

I received the error described on this page http://www.fakingfantastic.com/2010/11/26/fixing-the-you-have-to-install-development-tools-first-error-with-nokogiri/ and in following their instructions i recieved the following error:
[2011-02-13 11:05:03] ./configure --prefix=/Users/MYNAME/.rvm/rubies/ruby-1.9.2-p136 --enable-shared
checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking target system type... i386-apple-darwin10.6.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/Users/MYNAME/.rvm/src/ruby-1.9.2-p136':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
I thought that this : https://gist.github.com/767866 looked like an aswer but i cannot locate .rvmrc.
EDIT: i think the problem is i386. My the 1.8.2 install is x8x_64, it seems.
EDIT 2: after a bit more work i have it spitting this error out
[2011-02-13 11:51:05] ./configure --prefix=/Users/MYNAME/.rvm/rubies/ruby-1.9.2-p136 --enable-shared --build=i386-apple-darwin10.6.0 --host=i386-apple-darwin10.6.0
checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking target system type... i386-apple-darwin10.6.0
checking for i386-apple-darwin10.6.0-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for i386-apple-darwin10.6.0-g++... no
checking for i386-apple-darwin10.6.0-c++... no
checking for i386-apple-darwin10.6.0-gpp... no
checking for i386-apple-darwin10.6.0-aCC... no
checking for i386-apple-darwin10.6.0-CC... no
checking for i386-apple-darwin10.6.0-cxx... no
checking for i386-apple-darwin10.6.0-cc++... no
checking for i386-apple-darwin10.6.0-cl.exe... no
checking for i386-apple-darwin10.6.0-FCC... no
checking for i386-apple-darwin10.6.0-KCC... no
checking for i386-apple-darwin10.6.0-RCC... no
checking for i386-apple-darwin10.6.0-xlC_r... no
checking for i386-apple-darwin10.6.0-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/Users/MYNAME/.rvm/src/ruby-1.9.2-p136':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
[2011-02-13 11:58:36] ./configure --prefix=/Users/MYNAME/.rvm/rubies/ruby-1.9.2-p136 --enable-shared
checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking target system type... i386-apple-darwin10.6.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/Users/MYNAME/.rvm/src/ruby-1.9.2-p136':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
#eggie5 said:
I would put in your os x cd and install xcode again.
Do NOT install XCode from the DVD. The version that came on the 10.6 (Snow Leopard) disk is known to be buggy. Install the latest version from Apple's XCode site. You have to be registered to download, but it's a free registration.
I suspect you upgraded to 10.6, rather than it being installed by default when you bought your machine. 10.6 is 64-bit as is its related XCode version, so everything should have been 64-bit clean. Since it isn't it smells like regular Leopard or a pre-10.6 OS. That means all RVM hosted Rubies are suspicious and need to be cleaned up, along with any gems that were compiled prior to the upgrade and update of XCode.
After installing the XCode distribution, you'll need to uninstall, then install your RVM hosted Rubies. First, update RVM to the latest rev: Type rvm -v and note the revision number. Type rvm get head to load the latest version. When it has finished loading you should see a new revision number. RVM changes fast so you want to update to the latest pretty regularly.
This is from the RVM FAQ which is very good information for working with RVM, especially the comments about using sudo with gems:
My ruby is compiling as 32 bit but I am on Mac OS X Snow Leopard which has heavy advertisement that it is 64 bit!!!
RVM compiles to your current running kernel's architecture. This means that if your kernel is running as a 32 bit kernel (uname -m) it will compile 32 bit. You can override this behavior by placing the following in your ~/.rvmrc before installing the ruby interpreter:
rvm_archflags="-arch x86_64"
I think it's a good idea to set that rather than rely on defaults, since you're probably going to be on 64-bit from now on.
Type rvm reload or close your terminal window and reopen a session.
Type rvm notes and read it. This gives you a list of prerequisites you need for a smooth install of Ruby, based on your operating system. Failure to install those means various features might not work in Ruby, which will result in random, weird failures.
Type rvm list and make note of your installed Ruby versions. Pretend your first one is ruby-1.8.7-p330. Type:
rvm uninstall ruby-1.8.7-p330
rvm install ruby-1.8.7-p330
Repeat for each one you have installed. When you are done type rvm info and see if what it says passes sanity checks.
If everything looks good, it's time to rebuild the native drivers for your gems.
Both of these steps are optional, but are part of a good periodic house-keeping:
You might want to give your gems an update if you haven't run gem update for a while. rvm ruby 'gem update' will walk through the installed Rubies, updating them.
People accumulate old gems but often don't clean them up, so, to speed up rebuilding your gems you probably should clean out your old ones. You'll have to pay attention to what its telling you as it processes, because it will let you know about dependencies that will not be met. rvm ruby 'gem clean' will walk through the installed Rubies, and clean out the old stuff.
To rebuild the native drivers type rvm ruby 'gem pristine --all', which will reinstall all your gems.
Afterward, run rvm info and make sure it's returning sane information again.
Also, as an emergency escape hatch, it's entirely safe to blow away your ~/.rvm directory, either by typing rm -f ~/.rvm or using rvm implode, then starting over. Reinstalling a Ruby is the longest part of the process, and RVM makes it pretty painless once the supporting libraries are there.
I would put in your os x cd and install xcode again.

Error when updating my Ruby version using RVM on Mac OS X 10.6.6

I tried to update Ruby in my Mac OS X 10.6.6 system. Now I have 1.8.7, and I want to update to 1.9.2.
When I typed rvm install 1.9.2 I got:
gal-harths-iMac:~ galharth$ rvm install 1.9.2
/Users/galharth/.rvm/rubies/ruby-1.9.2-p136, this may take a while depending on your cpu(s)...
ruby-1.9.2-p136 - #fetching
ruby-1.9.2-p136 - #extracted to /Users/galharth/.rvm/src/ruby-1.9.2-p136 (already extracted)
ruby-1.9.2-p136 - #configuring
Error running ' ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared ', please read /Users/galharth/.rvm/log/ruby-1.9.2-p136/configure.log
There has been an error while running configure. Halting the installation.
I installed XCode and it still doesn't work.
This is the configure.log file:
[2011-02-08 17:10:04] ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared
checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking target system type... i386-apple-darwin10.6.0
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/galharth/.rvm/src/ruby-1.9.2-p136':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
[2011-02-08 17:23:19] ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared
checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking target system type... i386-apple-darwin10.6.0
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/galharth/.rvm/src/ruby-1.9.2-p136':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
[2011-02-08 20:44:14] ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared
checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking target system type... i386-apple-darwin10.6.0
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/galharth/.rvm/src/ruby-1.9.2-p136':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
[2011-02-08 21:02:55] ./configure --prefix=/Users/galharth/.rvm/rubies/ruby-1.9.2-p136 --enable-shared
checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking target system type... i386-apple-darwin10.6.0
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/galharth/.rvm/src/ruby-1.9.2-p136':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
There are some oddities in your log file output. Your question shows you have Mac OS 10.6.6, but the log shows the OS is i386. Mac OS 10.6.6 should be x86_64. This means for some reason your system thinks it's 32-bit when it should be 64bit. Your version of XCode needs to be current, so if you didn't just download it and install it, then do so. The version of XCode on the Snow Leopard disk was buggy, and the version for Mac OS prior to Snow Leopard is out of date once you install 10.6 on your machine.
Here's some things to try. If one works you're done, otherwise try the next one.
Do rvm -v and note the version number, then rvm get head followed by rvm reload if the version number displayed after updating has changed. Try running rvm install 1.9.2-p136.
Delete the files in your ~/.rvm/src/ruby-1.9.2-p136 directory using rm ~/.rvm/src/ruby-1.9.2-p136, then try installing using the install command in #1.
Manually download a copy of Ruby 1.9.2-p136 into your ~/.rvm/archives directory and extract it into your ~/.rvm/src/ruby-1.9.2-p136 directory. You can cd ~/.rvm/archives, delete any existing old version of the archive, then use curl -O ftp://ftp.ruby-lang.org:21//pub/ruby/1.9/ruby-1.9.2-p136.tar.gz or wget ftp://ftp.ruby-lang.org:21//pub/ruby/1.9/ruby-1.9.2-p136.tar.gz to pull in a new version. Then cd ~/.rvm/src then the rm command from #2 above followed by tar zxvf ../archives/ruby-1.9.2-p136.tar.gz to extract the files, then try running the RVM install command in #1.
I have a machine that's behind a proxy that won't allow RVM to get to the Ruby repositories, causing the archive to actually be the proxy's failure notice. When RVM tried burst the tar file, it would fail, but not catch the problem, then would try to configure and fail. The fix was to manually download the archive and burst it into the src directory.
Using the command rvm install 1.9.3 --with-gcc=clang worked for me.
When this happened to me, I inserted the Snow Leopard disk, selected Optional Installs and installed the Xcode package. That solved the missing C compiler problem as described here. Thanks to this blog: http://www.brianp.net/2009/09/05/snow-leopards-ate-my-c-compiler/
In my case, once I solved the compiler problem I got a permissions error. Running as root in bash gave rvm the appropriate permissions.
If you are running Lion check to make sure you have the Command Line Tools installed. They separated them from XCode so they are a separate download now. You can find them here:
https://developer.apple.com/downloads/index.action

Resources