Htop: 1.0.3 fails to build

Created on 26 May 2015  Â·  26Comments  Â·  Source: hishamhm/htop

gcc 4.9.2
libtool 2.4.2
fails with build in source and with out of source

/bin/sh ./libtool --tag=CC --mode=link gcc -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/modulefiles/../htop/1.0.3/etc\" -g -O2 -o htop htop-AvailableMetersPanel.o htop-CategoriesPanel.o htop-CheckItem.o htop-ClockMeter.o htop-ColorsPanel.o htop-ColumnsPanel.o htop-CPUMeter.o htop-CRT.o htop-DisplayOptionsPanel.o htop-FunctionBar.o htop-Hashtable.o htop-Header.o htop-htop.o htop-ListItem.o htop-LoadAverageMeter.o htop-MemoryMeter.o htop-Meter.o htop-MetersPanel.o htop-Object.o htop-Panel.o htop-BatteryMeter.o htop-Process.o htop-ProcessList.o htop-RichString.o htop-ScreenManager.o htop-Settings.o htop-IOPriorityPanel.o htop-SignalsPanel.o htop-String.o htop-SwapMeter.o htop-TasksMeter.o htop-TraceScreen.o htop-UptimeMeter.o htop-UsersTable.o htop-Vector.o htop-AvailableColumnsPanel.o htop-AffinityPanel.o htop-HostnameMeter.o htop-OpenFilesScreen.o htop-Affinity.o htop-IOPriority.o htop-IncSet.o -lncursesw -lm
libtool: link: gcc -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/modulefiles/../htop/1.0.3/etc\" -g -O2 -o htop htop-AvailableMetersPanel.o htop-CategoriesPanel.o htop-CheckItem.o htop-ClockMeter.o htop-ColorsPanel.o htop-ColumnsPanel.o htop-CPUMeter.o htop-CRT.o htop-DisplayOptionsPanel.o htop-FunctionBar.o htop-Hashtable.o htop-Header.o htop-htop.o htop-ListItem.o htop-LoadAverageMeter.o htop-MemoryMeter.o htop-Meter.o htop-MetersPanel.o htop-Object.o htop-Panel.o htop-BatteryMeter.o htop-Process.o htop-ProcessList.o htop-RichString.o htop-ScreenManager.o htop-Settings.o htop-IOPriorityPanel.o htop-SignalsPanel.o htop-String.o htop-SwapMeter.o htop-TasksMeter.o htop-TraceScreen.o htop-UptimeMeter.o htop-UsersTable.o htop-Vector.o htop-AvailableColumnsPanel.o htop-AffinityPanel.o htop-HostnameMeter.o htop-OpenFilesScreen.o htop-Affinity.o htop-IOPriority.o htop-IncSet.o -lncursesw -lm
/usr/local/binutils/2.24/bin/ld: htop-CRT.o: undefined reference to symbol 'halfdelay'
/lib64/libtinfo.so.5: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:393: recipe for target 'htop' failed
make[1]: ** [htop] Error 1
make[1]: Leaving directory '/usr/local/modulebuild/htop/1.0.3/build/build'
Makefile:292: recipe for target 'all' failed
make: *
* [all] Error 2

Most helpful comment

I fixed this error by adding -ltinfo to the Makefile entry for LIBS. So I changed the that looks like:

LIBS = -lncursesw -lm

To:

LIBS = -lncursesw -lm -ltinfo

Which was line 371 of Makefile.

All 26 comments

couldn't reproduce it here... conflict between your ncurses headers and libraries, perhaps?

I fixed this error by adding -ltinfo to the Makefile entry for LIBS. So I changed the that looks like:

LIBS = -lncursesw -lm

To:

LIBS = -lncursesw -lm -ltinfo

Which was line 371 of Makefile.

I had the same issue. Indeed adding -ltinfo to LIBS fixed it.

I will take a closer look at this. The auto-detection in the configure script should be improved.

I added auto-detection for this. I'd love to hear from those of you who had to manually add -ltinfo, if the current code fixes it.

@hishamhm what information do you need? Here is uname -a:

Linux cgrid2 2.6.32-573.7.1.el6.x86_64 #1 SMP Tue Sep 22 22:00:00 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

This is a supercomputer running redhat on a control node. The installed libraries are quite old.

@JonnoFTW does a build from a clean git clone work with no tweaks necessary?

git clone https://github.com/hishamhm/htop
cd htop
./autogen.sh
./configure
make

@hishamhm it doesn't work. I get the same error as OP.

@JonnoFTW do you have any program called ncurses*-config in your PATH? (ncurses5-config, ncurses-config, ncurses5w-config, anything like that...)

@hishamhm I have ncurses5-config ncursesw5-config

@JonnoFTW please try again from scratch:

git clone https://github.com/hishamhm/htop
cd htop
./autogen.sh
./configure
make

@hishamhm Same error again

@JonnoFTW could you send me the config.log file resulting from running configure? You can post it on http://gist.github.com, for example.

Config.log is here:
https://gist.github.com/anonymous/fcf0d3baa7c209f69199

On 8 December 2015 at 03:55, Hisham Muhammad [email protected]
wrote:

@JonnoFTW https://github.com/JonnoFTW could you send me the config.log
file resulting from running configure? You can post it on gist.github.com,
for example.

—
Reply to this email directly or view it on GitHub
https://github.com/hishamhm/htop/issues/198#issuecomment-162599491.

_Jonathan Mackenzie_
BEng (Software) Hons
PhD Candidate, Flinders University

@JonnoFTW Thank you! I think I nailed what's going on. Will commit a change soon.

@JonnoFTW I added more thorough tests in configure.ac. Please rebuild from scratch as above and let's see if ./configure detects your libraries automatically. Thanks again for helping out with this.

I still get the same error, -ltinfo isn't being added to the LIBS entry.

Thansk @JonnoFTW for the fix, @hishamhm I have the same error with tag 2.0.0: https://gist.github.com/guilbep/60281eed47ba9f4bc162 Great 2.0.0 :+1:

I want to eventually fix this, but it's hard to test without being able to reproduce locally.

Just to chime in, this problem still occurs for me with 2.0.2. Adding -ltinfo works.

@adamjstewart can you send me the config.log of the build that causes the error with 2.0.2?

@hishamhm here is the config.log and the output of the build:

config.log.txt
build-output.txt

I actually found a better workaround for the problem. When I build my own ncurses library from scratch and link to that instead, the bug goes away.

Same here with htop-2.0.2

Adding -ltinfo to the Makefile LIBS manually fixed the problem.

Details:

  • Oracle Linux Server release 6.6 (same as RHEL 6.6)
  • Autoconf 2.69

@sourcedelica
Cent OS 6.6 +1
add -ltinfo in LIBS fixed the problem

I think that's what's going on is that ncurses can be built two ways: with or without a separate termlib.

If it's configured --with-termlib then the main library will not have the termlib stuff and it will create a separate library and the extra -ltinfo flag will be required.

If it's not built with --with-termlib then those bits are included in the main library and the extra flag isn't required.

Same here with htop-2.2.0-20-g402e46b
Add -ltinfo fixed
OS:CentOS release 6.9 (Final)
ncurses:ncurses.x86_64 5.7-4.20090207.el6 @anaconda-base-201505101627.x86_64/6.2.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brendangregg picture brendangregg  Â·  8Comments

kcgthb picture kcgthb  Â·  8Comments

RalfJung picture RalfJung  Â·  4Comments

nuno-agostinho picture nuno-agostinho  Â·  6Comments

FlorentATo picture FlorentATo  Â·  7Comments