Trying to install Ruby 1.9.3-p547 exits with WARNING: unrecognized options: --with-libyaml-dir, --with-readline-dir - ruby

I've been trying to install Ruby 1.9.3-p547 for the past 2 days on OS X 10.9.3 with rbenv:
CC="/usr/local/Cellar/gcc/4.8.3/bin/gcc" rbenv install 1.9.3-p547
but it keeps reporting an error:
Installing ruby-1.9.3-p547...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977
Results logged to /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977.log
Last 10 log lines:
x ruby-1.9.3-p547/golf_prelude.c
/var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977/ruby-1.9.3-p547 /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977 ~/code/dpplus
configure: WARNING: unrecognized options: --with-libyaml-dir, --with-readline-dir
checking build system type... x86_64-apple-darwin13.2.0
checking host system type... x86_64-apple-darwin13.2.0
checking target system type... x86_64-apple-darwin13.2.0
checking whether the C compiler works... no
configure: error: in `/var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby- build.20140528111136.82977/ruby-1.9.3-p547':
configure: error: C compiler cannot create executables
See `config.log' for more details
BUILD FAILED
Inspect or clean up the working tree at /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977
Results logged to /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977.log
Last 10 log lines:
/var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977/ruby-1.9.3-p547 /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977 ~/code/dpplus
configure: WARNING: unrecognized options: --with-libyaml-dir, --with-readline-dir
checking build system type... x86_64-apple-darwin13.2.0
checking host system type... x86_64-apple-darwin13.2.0
checking target system type... x86_64-apple-darwin13.2.0
checking whether the C compiler works... no
configure: error: in `/var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby- build.20140528111136.82977/ruby-1.9.3-p547':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found. Stop.
I've been trying with gcc 4.8.3, gcc 4.6, readline and libyaml (all from Homebrew). It works with apple-gcc42 (from Homebrew as well), but this gives a problem with the Spring-gem.

I had the same problem and I was missing Xcode command line tools. I've installed it with the following command:
xcode-select --install
Hope this helps you.

Related

gem install pg | error: ‘PQERRORS_SQLSTATE’ undeclared

I am working in openSuse Leap, using rbenv. After upgrading from Leap 15.1 to 15.2 I have a problem. I cannot make 'gem install pg'.
Reproduce:
gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
current directory: /home/alex/.rbenv/versions/2.6.6/lib64/ruby/gems/2.6.0/gems/pg-1.2.3/ext
/home/alex/.rbenv/versions/2.6.6/bin/ruby -I /home/alex/.rbenv/versions/2.6.6/lib64/ruby/2.6.0 -r ./siteconf20200827-12823-54e7ke.rb extcon
f.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.
---
find / -name "pg_config" -print
/usr/lib/postgresql10/bin/pg_config
gem install pg -- --with-pg-config=/usr/lib/postgresql10/bin/pg_config
Building native extensions with: '--with-pg-config=/usr/lib/postgresql10/bin/pg_config'
This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
current directory: /home/alex/.rbenv/versions/2.6.6/lib64/ruby/gems/2.6.0/gems/pg-1.2.3/ext
/home/alex/.rbenv/versions/2.6.6/bin/ruby -I /home/alex/.rbenv/versions/2.6.6/lib64/ruby/2.6.0 -r ./siteconf20200827-12620-silryo.rb extconf.rb --with-pg-config\=/usr/lib/postgresql10/bin/pg_config
Using config values from /usr/lib/postgresql10/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... yes
checking for PQsetSingleRowMode()... yes
checking for PQconninfo()... yes
checking for PQsslAttribute()... yes
checking for PQresultVerboseErrorMessage()... yes
checking for PQencryptPasswordConn()... yes
checking for PQresultMemorySize()... yes
checking for timegm()... yes
checking for rb_gc_adjust_memory_usage()... yes
checking for unistd.h... yes
checking for inttypes.h... yes
checking for C99 variable length arrays... yes
creating extconf.h
creating Makefile
current directory: /home/alex/.rbenv/versions/2.6.6/lib64/ruby/gems/2.6.0/gems/pg-1.2.3/ext
make "DESTDIR=" clean
current directory: /home/alex/.rbenv/versions/2.6.6/lib64/ruby/gems/2.6.0/gems/pg-1.2.3/ext
make "DESTDIR="
compiling gvl_wrappers.c
compiling pg.c
In file included from /home/alex/.rbenv/versions/2.6.6/include/ruby-2.6.0/ruby.h:33:0,
from pg.h:20,
from pg.c:49:
pg.c: In function ‘Init_pg_ext’:
pg.c:470:64: error: ‘PQERRORS_SQLSTATE’ undeclared (first use in this function); did you mean ‘PQERRORS_TERSE’?
rb_define_const(rb_mPGconstants, "PQERRORS_SQLSTATE", INT2FIX(PQERRORS_SQLSTATE));
^
/home/alex/.rbenv/versions/2.6.6/include/ruby-2.6.0/ruby/ruby.h:261:33: note: in definition of macro ‘RB_INT2FIX’
#define RB_INT2FIX(i) (((VALUE)(i))<<1 | RUBY_FIXNUM_FLAG)
^
pg.c:470:56: note: in expansion of macro ‘INT2FIX’
rb_define_const(rb_mPGconstants, "PQERRORS_SQLSTATE", INT2FIX(PQERRORS_SQLSTATE));
^~~~~~~
pg.c:470:64: note: each undeclared identifier is reported only once for each function it appears in
rb_define_const(rb_mPGconstants, "PQERRORS_SQLSTATE", INT2FIX(PQERRORS_SQLSTATE));
^
/home/alex/.rbenv/versions/2.6.6/include/ruby-2.6.0/ruby/ruby.h:261:33: note: in definition of macro ‘RB_INT2FIX’
#define RB_INT2FIX(i) (((VALUE)(i))<<1 | RUBY_FIXNUM_FLAG)
^
pg.c:470:56: note: in expansion of macro ‘INT2FIX’
rb_define_const(rb_mPGconstants, "PQERRORS_SQLSTATE", INT2FIX(PQERRORS_SQLSTATE));
^~~~~~~
pg.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1: warning: unrecognized command line option ‘-Wno-cast-function-type’
make: *** [Makefile:245: pg.o] Ошибка 1
make failed, exit code 2
Gem files will remain installed in /home/alex/.rbenv/versions/2.6.6/lib64/ruby/gems/2.6.0/gems/pg-1.2.3 for inspection.
Results logged to /home/alex/.rbenv/versions/2.6.6/lib64/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/pg-1.2.3/gem_make.out
OpenSuse Support Forum recommended that I report a bug on bugzilla:
'Looks like although dependencies are satisfied, there is an upstream compilation error likely due to a change in supported methods. Code identified the error, then tried to resolve on its own (apparently there is some error checking and fixes already in the code, maybe errors like this has happened before). That kind of error isn't likely going to be solved by an end user.'
But this did not solve the problem, please take a look.
Any ideas? Help would be very helpful.
UPD
LC_ALL=C sudo zypper in postgresql postgresql-server postgresql-contrib
[sudo] password for root:
Loading repository data...
Reading installed packages...
'postgresql' is already installed.
No update candidate for 'postgresql-12.0.1-lp152.5.5.noarch'. The highest available version is already installed.
'postgresql-server' is already installed.
No update candidate for 'postgresql-server-12.0.1-lp152.5.5.noarch'. The highest available version is already installed.
'postgresql-contrib' is already installed.
No update candidate for 'postgresql-contrib-12.0.1-lp152.5.5.noarch'. The highest available version is already installed.
Resolving package dependencies...
Nothing to do.
Not sure about Leap, but under Tumbleweed I solved exactly the same problem by removing postgresql10-devel and installing both postgresql12-devel and postgresql12-server-devel.

checking whether the C compiler works... no; configure: error: C compiler cannot create executables

I am using OSx, attempting to install a haskell package 'SDL-mixer' via 'cabal install SDL-mixer'. I get the following error:
$ cabal install SDL-mixerResolving dependencies...
Configuring SDL-mixer-0.6.2.0...
Failed to install SDL-mixer-0.6.2.0
Build log ( /Users/matthewherzl/.cabal/logs/SDL-mixer-0.6.2.0.log ):
cabal: Entering directory '/var/folders/v7/gzwp_4j12gd_3d2pt2cl52yr0000gn/T/cabal-tmp-7633/SDL-mixer-0.6.2.0'
[1 of 1] Compiling Main ( /var/folders/v7/gzwp_4j12gd_3d2pt2cl52yr0000gn/T/cabal-tmp-7633/SDL-mixer-0.6.2.0/dist/setup/setup.hs, /var/folders/v7/gzwp_4j12gd_3d2pt2cl52yr0000gn/T/cabal-tmp-7633/SDL-mixer-0.6.2.0/dist/setup/Main.o )
Linking /var/folders/v7/gzwp_4j12gd_3d2pt2cl52yr0000gn/T/cabal-tmp-7633/SDL-mixer-0.6.2.0/dist/setup/setup ...
Configuring SDL-mixer-0.6.2.0...
configure: WARNING: unrecognized options: --with-compiler
checking for sdl-config... /usr/local/bin/sdl-config
checking for gcc... /usr/bin/clang
checking whether the C compiler works... no
configure: error: in `/private/var/folders/v7/gzwp_4j12gd_3d2pt2cl52yr0000gn/T/cabal-tmp-7633/SDL-mixer-0.6.2.0':
configure: error: C compiler cannot create executables
See `config.log' for more details.
cabal: Leaving directory '/var/folders/v7/gzwp_4j12gd_3d2pt2cl52yr0000gn/T/cabal-tmp-7633/SDL-mixer-0.6.2.0'
cabal: Error: some packages failed to install:
SDL-mixer-0.6.2.0 failed during the configure step. The exception was:
ExitFailure 77
Other questions pose similar errors, but I have not found a solution that works for my case.
Some things I've tried:
validated that gcc is present on my machine, and works to successfully compile a c program.
restarted my machine
removed and reinstalled xcode
uninstalled and reinstalled gcc
installed clang
attempted to install in sandbox
I get the same error in each case.
It seems there is something I need to change in my OS setup; any ideas on how to fix?

Why can't Open MPI configure find pmi2.h library?

Hi I am trying to compile Open MPI 1.10 with pmi2.h so that I can use it with srun command according to instructions here https://www.open-mpi.org/faq/?category=slurm
This is my configure command
[avinash#baribu openmpi-1.10.0]$ ./configure CC=gcc CXX=g++ FC=gfortran --prefix=/home/avinash/openmpi110 --with-slurm --with-sge --with-pmi=/usr/include/slurm
but I get the error message at the end
--- MCA component common:pmi (m4 configuration macro)
checking for MCA component common:pmi compile mode... dso
checking if user requested PMI support... yes
checking if PMI support can be built... no
configure: WARNING: PMI support requested (via --with-pmi) but neither pmi.h
configure: WARNING: nor pmi2.h were found under locations:
configure: WARNING: /usr/include/slurm
configure: WARNING: /usr/include/slurm/slurm
configure: WARNING: Specified path: /usr/include/slurm
configure: WARNING: OR neither libpmi nor libpmi2 were found under:
configure: WARNING: /usr/include/slurm/lib
configure: WARNING: /usr/include/slurm/lib64
configure: WARNING: Specified path:
configure: error: Aborting
which is weird because I see a pmi2.h file in /usr/include/slurm
[avinash#baribu openmpi-1.10.0]$ ls /usr/include/slurm
pmi2.h pmi.h slurmdb.h slurm_errno.h slurm.h smd_ns.h spank.h
I will appreciate any help with the configuration. Thanks.
Your best bet is to email the information requested under http://www.open-mpi.org/community/help/ to the Open MPI users mailing list. The config.log file, in particular, will likely contain more information.

Installing Ruby 1.9.3 Troubles with Clang

I am attempting to install Ruby 1.9.3 on Mac OS X Lion, same method as I discovered here:
Basically it's:
rvm install 1.9.3 --with-gcc=clang --with-readline-dir=$rvm_path/usr
However, this time Clang throws an error on the --with-readline-dir option:
Larson:~ andrewjl$ rvm install 1.9.3 --with-gcc=clang --with-readline-dir=$rvm_path/usr
clang: error: unsupported option '--with-readline'
clang: error: unsupported option '--with-opt-dir=/Users/andrewjl/.rvm/usr'
Is this an issue with Clang? Does anybody know how to get around this?
EDIT
After trying Shigeya's answer I get this error:
Larson:~ andrewjl$ rvm install 1.9.3-p125 --patch xcode-debugopt-fix-r34840.diff --with-readline-dir=$rvm_path/usr --with-openssl-dir=$rvm_path/usr --with-tcl-lib=/usr --with-tk-lib=/usr
Installing Ruby from source to: /Users/andrewjl/.rvm/rubies/ruby-1.9.3-p125, this may take a while depending on your cpu(s)...
ruby-1.9.3-p125 - #fetching
ruby-1.9.3-p125 - #downloading ruby-1.9.3-p125, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9505k 100 9505k 0 0 52267 0 0:03:06 0:03:06 --:--:-- 50727
ruby-1.9.3-p125 - #extracting ruby-1.9.3-p125 to /Users/andrewjl/.rvm/src/ruby-1.9.3-p125
ruby-1.9.3-p125 - #extracted to /Users/andrewjl/.rvm/src/ruby-1.9.3-p125
Applying patch 'xcode-debugopt-fix-r34840.diff' (located at /Users/andrewjl/.rvm/patches/ruby/1.9.3/p125/xcode-debugopt-fix-r34840.diff)
ruby-1.9.3-p125 - #autoreconf
Error running 'autoreconf', please read /Users/andrewjl/.rvm/log/ruby-1.9.3-p125/autoreconf.log
ruby-1.9.3-p125 - #configuring
Error running ' ./configure --prefix=/Users/andrewjl/.rvm/rubies/ruby-1.9.3-p125 --enable-shared --disable-install-doc --with-readline --with-opt-dir=/Users/andrewjl/.rvm/usr --with-openssl --with-tcl-lib=/usr --with-tk-lib=/usr --with-libyaml --with-gcc=clang ', please read /Users/andrewjl/.rvm/log/ruby-1.9.3-p125/configure.log
There has been an error while running configure. Halting the installation.
Here's the log file error:
/usr/local/include/fuse/fuse_compat.h:69:10: fatal error: 'sys/statfs.h' file not found
#include <sys/statfs.h>
^
clang: error: unable to execute command: Broken pipe: 13
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://developer.apple.com/bugreporter/ and include command line arguments and all diagnostic information.
clang: note: diagnostic msg: Error generating preprocessed source(s).
yes
checking for strip... strip
checking for prefix of external symbols... _
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for if make is GNU make... yes
checking for nroff... /usr/bin/nroff
.ext/include/x86_64-darwin11.4.0/ruby/config.h updated
ruby library version = 1.9.1
configure: creating ./config.status
config.status: creating Makefile
configure: WARNING: unrecognized options: --with-readline, --with-openssl, --with-tcl-lib, --with-tk-lib, --with-libyaml
In file included from <built-in>:143:
In file included from <command line>:1:
In file included from /usr/local/include/fuse/fuse.h:26:
/usr/local/include/fuse/fuse_common.h:32:2: error: #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
#error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
^
In file included from <built-in>:143:
In file included from <command line>:1:
In file included from /usr/local/include/fuse/fuse.h:857:
/usr/local/include/fuse/fuse_compat.h:69:10: fatal error: 'sys/statfs.h' file not found
#include <sys/statfs.h>
^
clang: error: unable to execute command: Broken pipe: 13
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://developer.apple.com/bugreporter/ and include command line arguments and all diagnostic information.
clang: note: diagnostic msg: Error generating preprocessed source(s).
configure: WARNING: unrecognized options: --with-readline, --with-openssl, --with-tcl-lib, --with-tk-lib, --with-libyaml
config.status: creating ruby-1.9.pc
./configure: line 18932: syntax error near unexpected token `('
./configure: line 18932: ` sed 's/{\$([^(){}]*)[^{}]*}//g' ${srcdir}/common.mk'
Refer to this answer.
Even though both ruby-1.9.3-p125 and ruby-1.9.3-p194 some support for clang, installing Ruby with clang is generally not recommended.
(Note: I had to accept edit proposal first, then edit. Thank you very much for contribution.)

homebrew install postgresql problem

I'm new to OSX and want to install postgresql, as it is my preferred db for django.
I installed xcode and can start it, which is a prerequisite for homebrew.
Then I installed homebrew and run brew install postgresql, getting the following warning and errors. First of all I get an Xcode is not installed warning, whereas it is definitely installed. I think the reason for this warning is described in this post: https://github.com/mxcl/homebrew/issues/2567
Below the traceback.
TK$ brew install postgresql
Warning: Xcode is not installed! Builds may fail!
==> Downloading ftp://ftp.cwru.edu/pub/bash/readline-6.1.tar.gz
File already downloaded and cached to /Users/TK/Library/Caches/Homebrew
==> Downloading patches
######################################################################## 100.0%
######################################################################## 100.0%
==> Patching
patching file complete.c
patching file patchlevel
patching file readline.h
patching file patchlevel
==> ./configure --prefix=/usr/local/Cellar/readline/6.1 --mandir=/usr/local/Cell
checking build system type... i386-apple-darwin10.7.3
checking host system type... i386-apple-darwin10.7.3
Beginning configuration for readline-6.1 for i386-apple-darwin10.7.3
checking whether make sets $(MAKE)... no
checking for gcc... /usr/bin/cc
checking for C compiler default output file name...
configure: error: in `/private/tmp/homebrew-readline-6.1-3bbC/readline-6.1':
configure: error: C compiler cannot create executables
See `config.log' for more details.
==> Exit Status: 77
http://github.com/mxcl/homebrew/blob/master/Library/Formula/readline.rb#L24
==> Environment
/usr/local/Library/Homebrew/utils.rb:275:in `llvm_build_version': undefined method `/' for "/Developer":String (NoMethodError)
from /usr/local/Library/Homebrew/cmd/--config.rb:9:in `llvm'
from /usr/local/Library/Homebrew/cmd/--config.rb:61:in `config_s'
from /usr/local/bin/brew:116
If i run brew-config I get the following trackeback.
TK$ brew --config
Error: undefined method `/' for "/Developer":String
Please report this bug: https://github.com/mxcl/homebrew/wiki/new-issue
/usr/local/Library/Homebrew/utils.rb:275:in `llvm_build_version'
/usr/local/Library/Homebrew/cmd/--config.rb:9:in `llvm'
/usr/local/Library/Homebrew/cmd/--config.rb:61:in `config_s'
/usr/local/Library/Homebrew/cmd/--config.rb:5:in `__config'
/usr/local/bin/brew:82:in `send'
/usr/local/bin/brew:82
Any idea what I did wrong?
configure: error: C compiler cannot create executables
and
Error: undefined method `/' for "/Developer":String
suggest that you do not have Xcode and gnu c++ installed. Install code from your OS disk or register as a developer (free) and get XCode 3 or buy Xcode from AppStore,

Resources