Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#13292 closed defect (fixed)

vim fails to configure, tgetent() not found

Reported by: griff.rees@… Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version: 1.5.0
Keywords: Cc: griff.rees@…, raimue (Rainer Müller), nox@…, themolok@…
Port:

Description

vim (not the app version) fails when checking for dependencies. Perhaps there's something wrong with the version of ncurses?

checking whether stack_t has an ss_base field... no
checking --with-tlib argument... ncurses
checking for linking with ncurses library... OK
checking for tgetent()... configure: error: NOT FOUND!
      You need to install a terminal library; for example ncurses.
      Or specify the name of the library with --with-tlib.

Warning: the following items did not execute (for vim): org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install
Error: Status 1 encountered during processing.

Change History (26)

comment:1 Changed 16 years ago by cssdev

Cc: raimue@… added
Milestone: Port Bugs
Owner: changed from macports-dev@… to raimue@…

Please assign issues to the port maintainer when you create them.

comment:2 in reply to:  description ; Changed 16 years ago by nox@…

Cc: griff.rees@… nox@… added
Summary: vim doesn't compilevim fails to configure, tgetent() not found

Replying to griff.rees@gmail.com:

vim (not the app version) fails when checking for dependencies. Perhaps there's something wrong with the version of ncurses?

checking whether stack_t has an ss_base field... no
checking --with-tlib argument... ncurses
checking for linking with ncurses library... OK
checking for tgetent()... configure: error: NOT FOUND!
      You need to install a terminal library; for example ncurses.
      Or specify the name of the library with --with-tlib.

Warning: the following items did not execute (for vim): org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install
Error: Status 1 encountered during processing.

Are you running on Leopard?

comment:3 in reply to:  2 Changed 16 years ago by griff.rees@…

Replying to nox@macports.org:

Replying to griff.rees@gmail.com:

vim (not the app version) fails when checking for dependencies. Perhaps there's something wrong with the version of ncurses?

checking whether stack_t has an ss_base field... no
checking --with-tlib argument... ncurses
checking for linking with ncurses library... OK
checking for tgetent()... configure: error: NOT FOUND!
      You need to install a terminal library; for example ncurses.
      Or specify the name of the library with --with-tlib.

Warning: the following items did not execute (for vim): org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install
Error: Status 1 encountered during processing.

Are you running on Leopard?

No I'm on Tiger, but I may be Leopardizing soon ;). Sorry about not assigning it originally. Will do in future. Also thanks for the quick reply.

comment:4 Changed 16 years ago by raimue (Rainer Müller)

Maybe you have some other ncurses lying around in /usr/local or a similar place? Please check that. I don't have any problems to link vim against ncurses from MacPorts.

comment:5 Changed 16 years ago by griff.rees@…

mmm! Well, I will try that as soon as I get home. I also recently uninstalled Fink. Dunno if that should make a difference...

I thought macports was self-contained though: only relying on its own version of libraries rather than system-level. I suppose another ncurses may be interfering, but shouldn't the default config script specify the local /opt/ version of everything anyway? I do have ncurses installed via macports...

I'll report back as soon as I get home.

Thanks very much for your help.

comment:6 Changed 16 years ago by raimue (Rainer Müller)

As far as I know, gcc itself checks in some common directories (including /usr/local) first for the libraries, so this might interfere with MacPorts.

comment:7 Changed 16 years ago by nox@…

Yes:

#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks

comment:8 Changed 16 years ago by griff.rees@…

ah! ok, the only ncurses I can find that might be relevant are:

/usr/include/ncurses.h
/usr/include/ncurses_dll.h
/usr/lib/libncurses.5.4.dylib
/usr/lib/libncurses.5.dylib
/usr/lib/libncurses.dylib
/usr/share/man/man3/ncurses.3x

How can I make sure macports picks up the right one? I'm afraid to remove this one... should I just rename it for the time being or is there a slicker solution?

thanks very much for you help.

comment:9 Changed 16 years ago by raimue (Rainer Müller)

Works for me even with these files. Do you still have problems?

comment:10 Changed 16 years ago by griff.rees@…

:) I've moved to Leopard and don't have any problems. Sorry if that's a bit frustrating. You should probably close the bug. Dunno what was going on, but everything's ok now. Thanks very much for your help.

comment:11 Changed 16 years ago by raimue (Rainer Müller)

Resolution: worksforme
Status: newclosed

Thanks for your feedback anyway. Resolved as worksforme.

comment:12 Changed 16 years ago by ian_purvis@…

Resolution: worksforme
Status: closedreopened

I have this issue on my machine as well (core2duo macbook, leopard), but only if I specify the +ruby variant:

Error: Target org.macports.configure returned: configure failure: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_editors_vim/work/vim71" && ./configure --prefix=/opt/local --enable-gui=no --without-x --disable-gpm --disable-nls --mandir=/opt/local/share/man --with-tlib=ncurses --enable-multibyte --enable-rubyinterp " returned error 1

and:

checking --with-tlib argument... ncurses
checking for linking with ncurses library... OK
checking for tgetent()... configure: error: NOT FOUND!

I don't know if it helps, but here is something that may be related somehow: If I download the svn version of vim, and create a similar configure string...

./configure --enable-gui=no --without-x --disable-gpm --disable-nls --with-tlib=ncurses --enable-multibyte --enable-rubyinterp

...configure will work successfully, only to afterwards have the linker break down with some "ld: symbol(s) not found for architecture ppc" and "ld: symbol(s) not found for architecture i386" errors. If I then re-configure adding "--with-mac-arch=intel", I get the tgetent() ncurses error.

If only this would work, I could get some ruby omni completion... :(

-Ian

comment:13 Changed 16 years ago by themolok@…

I can reproduce this if python is not installed from macports.

comment:14 Changed 16 years ago by nox@…

Cc: themolok@… added

themolok: Relying on software outside of MacPorts tree is unsupported.

comment:15 Changed 16 years ago by themolok@…

I meant that if you don't install python and try to install vim +python , then that error comes out. Probably the variants +python should depend on python25 or something like that.

comment:16 Changed 16 years ago by raimue (Rainer Müller)

That's a good hint, I will look into it.

comment:17 in reply to:  description Changed 16 years ago by ian.c.purvis@…

sorry, earlier post had my old email address... can you add this one to the cc? thanks..

comment:18 Changed 16 years ago by olivier@…

I run a core 2 duo MBP running Leopard and trying to install vim using macports gives me the tgetent() error as well. However, it is important to note that this only occurs when adding the +ruby option.

I set the configuration options to +python and +perl and it worked fine. ncurses is installed properly and other applications depending upon it seem to be working fine. The issue seems to be directly related to using the +ruby option, since it compiles fine with ncurses without that option.

comment:19 in reply to:  18 Changed 16 years ago by olivier@…

Replying to olivier@olivieryiptong.com:

I run a core 2 duo MBP running Leopard and trying to install vim using macports gives me the tgetent() error as well. However, it is important to note that this only occurs when adding the +ruby option.

I set the configuration options to +python and +perl and it worked fine. ncurses is installed properly and other applications depending upon it seem to be working fine. The issue seems to be directly related to using the +ruby option, since it compiles fine with ncurses without that option.

Oops, my bad, I didn't read the last comments. Both Ruby and Python are not macports installations.

comment:20 Changed 16 years ago by jlist@…

The problem is that the build of ruby that ships with Leopard is a Universal build. The vim configure script interrogates ruby to get the LDFLAGS that it was built with, so it ends up with the Universal LDFLAGS ("-arch ppc -arch intel").

Then ports tries to link against the ncurses from ports, which you will have built yourself at some stage (so will be platform specific) and it fails because it will be looking for entry points for the other architecture (probably for ppc) in ncurses.

The reason that the ./configure works when run directly is because MacPorts sets LDFLAGS to a default of -L${prefix}/lib (by default /opt/local/lib) and so it uses the libncurses in /opt/local/lib, ie. the ncurses that was installed with ports. When run directly, ./configure defaults to the system default of /usr/lib which has the Universal ncurses. But if you do that then later when the build tries to link it fails because it's looking for the other architectures during the linking.

So, the reality is that you can't really embed the Universal ruby interpreter that ships with Leopard into the arch-specific vim that will be build by MacPorts. So either don't do it, or install ruby from MacPorts first.

comment:21 Changed 16 years ago by raimue (Rainer Müller)

That explanation sounds reasonable. I didn't know vim links anything in for the python/perl/ruby support. So I will change the bin: dependencies to port:, which will make it mandatory to have the ports installed.

comment:22 Changed 16 years ago by jlist@…

Yeah, it works as you'd expect if you install ruby from ports (and ensure that the /opt/local/bin/ruby is before the /usr/bin/ruby in your path).

comment:23 Changed 16 years ago by jlist@…

Also, I don't think that vim links against ruby/perl/python. The linking errors come when you run ./configure yourself, because although configure will then complete successfully the linking will fail because you're trying to link arch vim against the Universal libncurses.

The reason that ruby throws a spanner in the works is because it adds its own LDFLAGS to vim's LDFLAGS to ensure (or try to) that vim gets compiled to be compatible with ruby.

comment:24 in reply to:  22 Changed 16 years ago by raimue (Rainer Müller)

Replying to jlist@silentcow.com:

Yeah, it works as you'd expect if you install ruby from ports (and ensure that the /opt/local/bin/ruby is before the /usr/bin/ruby in your path).

MacPorts sanitizes the environment so that at build time ${prefix}/bin will always be first in PATH.

comment:25 Changed 16 years ago by raimue (Rainer Müller)

Resolution: fixed
Status: reopenedclosed

Committed in r36437.

comment:26 Changed 15 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.