Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ncursesw-sup gem fail on Mac OS X: cannot find ncursesw library #134

Closed
gardner opened this issue Aug 20, 2013 · 12 comments
Closed

ncursesw-sup gem fail on Mac OS X: cannot find ncursesw library #134

gardner opened this issue Aug 20, 2013 · 12 comments

Comments

@gardner
Copy link

gardner commented Aug 20, 2013

gardner-MacBookPro:~ gardner$ gem install sup
Fetching: xapian-ruby-1.2.15.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed xapian-ruby-1.2.15.1
Fetching: ncursesw-sup-1.3.1.3.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing sup:
    ERROR: Failed to build gem native extension.

    /Users/gardner/.rvm/rubies/ruby-1.9.3-p286/bin/ruby extconf.rb
checking for unistd.h... yes
checking for locale.h... yes
checking for ncurses.h... yes
checking for wmove() in -lncursesw... no
checking for wmove() in -lpdcurses... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
    --with-ncurseswlib
    --without-ncurseswlib
    --with-pdcurseslib
    --without-pdcurseslib
extconf.rb:45:in `<main>': ncurses library not found (RuntimeError)


Gem files will remain installed in /Users/gardner/.rvm/gems/ruby-1.9.3-p286/gems/ncursesw-sup-1.3.1.3 for inspection.
Results logged to /Users/gardner/.rvm/gems/ruby-1.9.3-p286/gems/ncursesw-sup-1.3.1.3/./gem_make.out
@gardner
Copy link
Author

gardner commented Aug 20, 2013

gem_make.out

/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/bin/ruby extconf.rb
checking for unistd.h... yes
checking for locale.h... yes
checking for ncurses.h... yes
checking for wmove() in -lncursesw... no
checking for wmove() in -lpdcurses... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
    --with-ncurseswlib
    --without-ncurseswlib
    --with-pdcurseslib
    --without-pdcurseslib
extconf.rb:45:in `<main>': ncurses library not found (RuntimeError)

@gardner
Copy link
Author

gardner commented Aug 20, 2013

mkmf.log

have_header: checking for unistd.h... -------------------- yes

"clang -o conftest -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/x86_64-darwin11.4.2 -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/ruby/backward -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/Users/gardner/.rvm/usr/include -fno-common -pipe -g -Wformat -Werror=format-security conftest.c  -L. -L/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/lib -L. -L/Users/gardner/.rvm/usr/lib     -lruby.1.9.1  -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main() {return 0;}
/* end */

"clang -E -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/x86_64-darwin11.4.2 -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/ruby/backward -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/Users/gardner/.rvm/usr/include -fno-common -pipe -g -Wformat -Werror=format-security  conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <unistd.h>
/* end */

--------------------

have_header: checking for locale.h... -------------------- yes

"clang -E -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/x86_64-darwin11.4.2 -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/ruby/backward -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/Users/gardner/.rvm/usr/include -fno-common -pipe -g -Wformat -Werror=format-security  conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <locale.h>
/* end */

--------------------

have_header: checking for ncurses.h... -------------------- yes

"clang -E -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/x86_64-darwin11.4.2 -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/ruby/backward -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/Users/gardner/.rvm/usr/include -fno-common -pipe -g -Wformat -Werror=format-security  conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <ncurses.h>
/* end */

--------------------

have_library: checking for wmove() in -lncursesw... -------------------- no

"clang -o conftest -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/x86_64-darwin11.4.2 -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/ruby/backward -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/Users/gardner/.rvm/usr/include -fno-common -pipe -g -Wformat -Werror=format-security conftest.c  -L. -L/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/lib -L. -L/Users/gardner/.rvm/usr/lib     -lruby.1.9.1 -lncursesw  -lpthread -ldl -lobjc "
conftest.c:5:53: error: use of undeclared identifier 'wmove'
int t() { void ((*volatile p)()); p = (void ((*)()))wmove; return 0; }
                                                    ^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: /*top*/
4: int main() {return 0;}
5: int t() { void ((*volatile p)()); p = (void ((*)()))wmove; return 0; }
/* end */

"clang -o conftest -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/x86_64-darwin11.4.2 -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/ruby/backward -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/Users/gardner/.rvm/usr/include -fno-common -pipe -g -Wformat -Werror=format-security conftest.c  -L. -L/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/lib -L. -L/Users/gardner/.rvm/usr/lib     -lruby.1.9.1 -lncursesw  -lpthread -ldl -lobjc "
conftest.c:5:11: warning: implicit declaration of function 'wmove' is invalid in C99 [-Wimplicit-function-declaration]
int t() { wmove(); return 0; }
          ^
1 warning generated.
ld: library not found for -lncursesw
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: /*top*/
4: int main() {return 0;}
5: int t() { wmove(); return 0; }
/* end */

--------------------

have_library: checking for wmove() in -lpdcurses... -------------------- no

"clang -o conftest -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/x86_64-darwin11.4.2 -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/ruby/backward -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/Users/gardner/.rvm/usr/include -fno-common -pipe -g -Wformat -Werror=format-security conftest.c  -L. -L/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/lib -L. -L/Users/gardner/.rvm/usr/lib     -lruby.1.9.1 -lpdcurses  -lpthread -ldl -lobjc "
conftest.c:5:53: error: use of undeclared identifier 'wmove'
int t() { void ((*volatile p)()); p = (void ((*)()))wmove; return 0; }
                                                    ^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: /*top*/
4: int main() {return 0;}
5: int t() { void ((*volatile p)()); p = (void ((*)()))wmove; return 0; }
/* end */

"clang -o conftest -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/x86_64-darwin11.4.2 -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1/ruby/backward -I/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/Users/gardner/.rvm/usr/include -fno-common -pipe -g -Wformat -Werror=format-security conftest.c  -L. -L/Users/gardner/.rvm/rubies/ruby-1.9.3-p286/lib -L. -L/Users/gardner/.rvm/usr/lib     -lruby.1.9.1 -lpdcurses  -lpthread -ldl -lobjc "
conftest.c:5:11: warning: implicit declaration of function 'wmove' is invalid in C99 [-Wimplicit-function-declaration]
int t() { wmove(); return 0; }
          ^
1 warning generated.
ld: library not found for -lpdcurses
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: /*top*/
4: int main() {return 0;}
5: int t() { wmove(); return 0; }
/* end */

--------------------

@gauteh
Copy link
Member

gauteh commented Aug 20, 2013

Hey, thanks for the extensive info..! some other users have had the same issue in #49. But we haven't found a solution yet.

What version of mac os x do you run? have you installed ncurses as in the mac os x wiki guide [0]?

[0] https://github.com/sup-heliotrope/sup/wiki/Mac-OSX

@gauteh
Copy link
Member

gauteh commented Dec 17, 2013

Closing, need more info.

@gauteh gauteh closed this as completed Dec 17, 2013
@philip-peterson
Copy link

+1, please reopen.

Mac OS X 10.7.5

I have installed ncurses using the instructions linked above, however, when I gem install sup, it complains that 'pdcurses' isn't available, same as gardner. I can't seem to find pdcurses on my machine; is something supposed to install it automatically?

Edit: Even after sudo make install-ing pdcurses, I get:

checking for wmove() in -lncursesw... no
checking for wmove() in -lpdcurses... no

and the error given during the gem install is extconf.rb:48: ncurses library not found (RuntimeError). However, just compiling a regular old C file with clang test.c -lncurses, there is no error, so I would think that libncurses is installed correctly...

@gauteh
Copy link
Member

gauteh commented Jan 15, 2014

Hi,

please try to use Ruby 1.9.3. What version of ncurses have you installed? (homebrew / macports)? Did you try the instructions here: #49 (comment).

Also check the troubleshooting section of the wiki page.

Regular ncurses is probably installed, but we require the wide-char version: ncursesw. This one will have to be installed manually and 'activated' so that the ncursesw gem can find it and not the old.

@gauteh
Copy link
Member

gauteh commented Jan 17, 2014

Could you try to use GCC and not clang, also please post the output of mkmf.log which is created by extconf.rb when building the gem. You might want to check out the ncursesw-ruby[0] from the git repository and build it:

$ git clone https://github.com/sup-heliotrope/ncursesw-ruby.git
$ cd ncursesw-ruby.git
$ ruby extconf.rb # this creates the mkmf.log file.
$ make

or to package the gem and install it from the repository:

$ gem build ncursesw.gemspec
$ gem install ncursesw-1.4.3.gem # where 1.4.3 is the latest version released

[0] https://github.com/sup-heliotrope/ncursesw-ruby

@cro
Copy link

cro commented Jan 17, 2014

I was able to make this work with clang and MacPorts by doing port install nurses (this installs nurses 5.9) and then editing extconf.rb to add -L/opt/local/lib to the $CFLAGS line (e.g. $CFLAGS += " -g -Wformat -Werror=format-security -Waddress -L/opt/local/lib"). You get some warnings about the -L switch being ignored later in the process but it doesn't seem to make a difference. The only thing I'm not sure about is how to test if I am actually using the ncursesw support in sup. Most of my email work is done with English speakers so I don't see many wide characters.
This is Mac OS 10.9.1 (Mavericks).

@gauteh
Copy link
Member

gauteh commented Apr 10, 2014

Closing. Please reopen if issue persists.

@gauteh gauteh closed this as completed Apr 10, 2014
@jfelchner
Copy link

I just got this exact same error. Mavericks. Homebrew installed ncurses v5.9. Ruby 2.1.2.

gem install ncursesw fails with the initial message in this post.

@jfelchner
Copy link

Turns out a brew link --force ncurses was required.

@korsmakolnikov
Copy link

same issue on Maverics, ruby 2.2.2, and Ubuntu 15.10 both on ncurses and ncursesw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants