C compiler can't create executables - macos

I'm trying to install the elastic beanstalk cli, like so:
./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer
But I'm getting the following error:
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.7.2.tar.xz...
-> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
Installing Python-3.7.2...
python-build: use readline from homebrew
BUILD FAILED (OS X 11.1 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/96/df02xppj77g7dx698gtmwmrw0000gn/T/python-build.20210319024756.38557
Results logged to /var/folders/96/df02xppj77g7dx698gtmwmrw0000gn/T/python-build.20210319024756.38557.log
Last 10 log lines:
checking for python3.7... python3.7
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
checking whether the C compiler works... no
configure: error: in `/var/folders/96/df02xppj77g7dx698gtmwmrw0000gn/T/python-build.20210319024756.38557/Python-3.7.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
Exiting due to failure
For some reason, the installation script isn't detecting the C compiler. Of course, both the gcc and the cc commands work in the terminal. I'm using macOS 11.1. How do I fix this?

You need to run the commands using Roseta, and arch command can be used to run commands via Rosetta:
arch -x86_64 ./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer

Related

PyEnv BUILD FAILED installing Python on MacOS Ventura 13.2.1

I'm working on a project from https://github.com/luigifreda/pyslam which uses only python 3.6.9, so I tried to install it:
pyenv install 3.6.9
and encountered a build failed:
python-build: use openssl#1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.6.9.tar.xz...
-> https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz
Installing Python-3.6.9...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 13.2.1 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/01/bx2q2rbn099ch5d1gr1zm5fc0000gn/T/python-build.20230216230654.91605
Results logged to /var/folders/01/bx2q2rbn099ch5d1gr1zm5fc0000gn/T/python-build.20230216230654.91605.log
Last 10 log lines:
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for a sed that does not truncate output... /usr/bin/sed
checking for --with-cxx-main=<compiler>... no
checking for the platform triplet based on compiler characteristics... darwin
configure: error: internal configure error for the platform triplet, please file a bug report
make: *** No targets specified and no makefile found. Stop.
MacOS Venture 13.2.1
Pyenv: 2.3.13
Home brew 4.0.1
Available python versions: 3.6.8
I have tried uninstalling and reinstalling and followed the installation from https://github.com/pyenv/pyenv#set-up-your-shell-environment-for-pyenv, but it's still not working. Any suggestions?

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.

How to install specific version of ruby (1.8.6) with rbenv?

I have some old source code that runs on ruby 1.8 and rails 2.3 . I have rbenv on my system. How can I install exactly this version of ruby (v1.8.6) with rbenv?
$ rbenv install 1.8.6
Downloading ruby-1.8.6.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.bz2
Installing ruby-1.8.6...
WARNING: ruby-1.8.6 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
ruby-build: use readline from homebrew
BUILD FAILED (OS X 10.14.2 using ruby-build 20190423)
Inspect or clean up the working tree at /var/folders/_w/98n31_kn03qfjt51p2hmrfqh0000gp/T/ruby-build.20190701155134.45412
Results logged to /var/folders/_w/98n31_kn03qfjt51p2hmrfqh0000gp/T/ruby-build.20190701155134.45412.log
Last 10 log lines:
/var/folders/_w/98n31_kn03qfjt51p2hmrfqh0000gp/T/ruby-build.20190701155134.45412 ~
/var/folders/_w/98n31_kn03qfjt51p2hmrfqh0000gp/T/ruby-build.20190701155134.45412/ruby-1.8.6 /var/folders/_w/98n31_kn03qfjt51p2hmrfqh0000gp/T/ruby-build.20190701155134.45412 ~
checking build system type... i686-apple-darwin18.2.0
checking host system type... i686-apple-darwin18.2.0
checking target system type... i686-apple-darwin18.2.0
checking for gcc... /usr/local/bin/gcc-4.2
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.
make: *** No targets specified and no makefile found. Stop.
I've tried this solution but it does not work for me...
https://github.com/rbenv/ruby-build/issues/999
Any ideas?

Installing glib from git in mac os x and gettext

I'm trying build glib from source in Mac OS X.
I've clone glib repo from gnome site.
The autogen.sh script seems to run fine. But when it starts it shows this message :
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
This seems spooky. However it finishes without showing any error. After spawning configure script it stops with the error :
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
configure: error:
*** You must have either have gettext support in your C library, or use the
*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html
Although i've install gettext from macports and it seems to be there :
arif#dev:~/sak/glib$ls /opt/local/lib/ | grep gettext
gettext
libgettextlib-0.18.3.dylib
libgettextlib.dylib
libgettextlib.la
libgettextpo.0.dylib
libgettextpo.a
libgettextpo.dylib
libgettextpo.la
libgettextsrc-0.18.3.dylib
libgettextsrc.dylib
libgettextsrc.la
One thing i've noticed that although gettext is installed, it does not have pkg-config file. Maybe that's why its happening .
arif#dev:~/sak/glib$ls /opt/local/lib/pkgconfig/ | grep gettext
comes out with nothing.
I ran into something similar and you might want to try to set CFLAGS="-L/opt/local/lib -I/opt/local/include". It seems that those are not included by default when running the gettext tests. You can either CFLAGS to the configure call or probably also to the autogen.sh

Installing RPostgresql on a Mac with OSX 10.7.2

I'm trying to install rpostgresql on a mac. I want to be able to connect to a server using an IP address and read the data into a dataframe. I downloaded the package from CRAN, and ran the following line:
install.packages('/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz', type='source')
This started to compile the package but resulted with the following error message:
> install.packages('/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz', type='source')
Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
(as ‘lib’ is unspecified)
inferring 'repos = NULL' from the file name
* installing *source* package ‘RPostgreSQL’ ...
** package ‘RPostgreSQL’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
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 pg_config... /usr/bin/pg_config
checking for "/usr/include/libpq-fe.h"... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
*** arch - x86_64
gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -I/usr/include -I/usr/local/include -fPIC -g -O2 -c RS-DBI.c -o RS-DBI.o
make: gcc-4.2: No such file or directory
make: *** [RS-DBI.o] Error 1
ERROR: compilation failed for package ‘RPostgreSQL’
* removing ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RPostgreSQL’
Warning in install.packages :
installation of package ‘/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz’ had non-zero exit status
I've looked through advice on the rpostgresql webpage (1, 2) but a lot of the suggestions are more than a year old so I thought there might be more recent advice on how to install this package.
If you want to connect to a postgre db, you also can use RODBC. Just install an ODBC driver (Lion should already include that for postgres) and you are ready to go.
I do that for conecting to my local postgre / postgis server and it works just fine.
You need Xcode installed in order to compile. Go into the Mac app store and search for, then install Xcode. It's free.
you can tell whether you already have gcc by doing a quick which gcc-4.2. My guess is that you do not. After installing Xcode, you should get /usr/bin/gcc-4.2 in response.
****EDIT****
After the comments about how you installed Xcode and still don't have gcc-4.2, I did a little bit of reading and it looks like you need to do one of the options listed in this Stack Overflow question: Setting GCC 4.2 as the default compiler on Mac OS X Leopard
This makes me wonder where my gcc-4.2 came from. Probably some fortuitous accident when I first got my MBP.
Since postgresql is required to build the package from source, you will need to install it. The easiest way to do so, if you use homebrew, is to simply do the following in a Terminal:
## install postgresql
brew install postgresql
## install the R package
Rscript -e "install.packages('RPostgreSQL', type = 'source')"
## remove postgresql (optional)
brew remove postgresql

Resources