jhammond / xltop

continuous Lustre load monitor
GNU General Public License v2.0
21 stars 7 forks source link

GNU ld linker (2.25) requires '-lm' #6

Closed mtds closed 8 years ago

mtds commented 8 years ago

Hello.

Apparently the ld linker which comes with GNU binutils version 2.25 has become more 'demanding' but I cannot find exactly the reason.

During the linking phase I got the following error:

/usr/bin/ld: x_node.o: undefined reference to symbol 'expm1@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

I have fixed it adding '-lm' to all the xltop{clusd,master,servd}_LDADD defined in the src/Makefile (generated by configure).

I am not sure if there's another solution other than adding this '-lm' to Makefile.am, in order to avoid the additional step of adding it by yourself to the generated Makefile.

Regards, Matteo

jhammond commented 8 years ago

It should be enough just to add it to xltop_master_LDADD in src/Makefile.am.

mtds commented 8 years ago

Yep, that do the trick but I believe xltop_master_LDADD is not sufficient. I have modified all the declarations in the file:

xltop_LDADD = -lcurl -lev -lncurses -lm
xltop_clusd_LDADD = -lcurl -lev -lm
xltop_master_LDADD = -lconfuse -lev -lncurses -lm
xltop_servd_LDADD = -lcurl -lev -lm

otherwise the linker will still throws the same error while compiling the other xltop binaries.

jhammond commented 8 years ago

Yes. You're right.

mtds commented 8 years ago

I have tested it also on other versions of ld and the result is just fine. Will you consider including these modifications into 'src/Makefile.am' on the master branch?

If that it's the case then I will make a pull request.

Matteo

jhammond commented 8 years ago

Yes. I will include them.

On Thu, Dec 17, 2015 at 9:10 AM, Matteo Dessalvi notifications@github.com wrote:

I have tested it also on other versions of ld and the result is just fine. Will you consider including these modifications into 'src/Makefile.am' on the master branch?

If that it's the case then I will make a pull request.

Matteo

— Reply to this email directly or view it on GitHub https://github.com/jhammond/xltop/issues/6#issuecomment-165479060.

mtds commented 8 years ago

Ok, I have just submitted a PR.

jhammond commented 8 years ago

Merged.