bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Linux and -lm


From: Jeffrey Walton
Subject: Linux and -lm
Date: Sat, 29 Aug 2020 07:27:28 -0400

Hi Everyone/Patrick,

A quick note since I'm making a testing pass on GSL...

Ubuntu 18.04 LTS x86_64 (fully patched) fails to link out of the box
due to a missing -lm. The symptom is undefined references for symbols
like sincos.

It may be a good idea to add an Autoconf test for:

* -lm, to avoid the link error on Linux
* -Wl,--as-needed to discard unneeded libraries

-lm goes in LIBS, and -Wl,--as-needed goes in AM_CFLAGS when available.

Autoconf will probably be the best in this case since -lm may be
missing on the target platform. I'm not sure how AIX, BSDs, OS X and
Solaris are going to act. I have not gotten that far in testing.

Jeff



reply via email to

[Prev in Thread] Current Thread [Next in Thread]