gnuastro-devel
[Top][All Lists]
Advanced

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

[gnuastro-devel] [bug #48076] GSL linking problem in Ubuntu


From: Mohammad Akhlaghi
Subject: [gnuastro-devel] [bug #48076] GSL linking problem in Ubuntu
Date: Thu, 2 Jun 2016 03:19:30 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0

Follow-up Comment #4, bug #48076 (project gnuastro):

I believe I have found the solution and I am busy implementing it now, I will
just outline it here:

The root of the problem was actually in the Autoconf functions that check for
libraries, until now we were using AC_CHECK_LIB and I had the ACTION_IF_FOUND
was set to define an unused "absolutejunk" variable. When ACTION_IF_FOUND is
defined in AC_CHECK_LIB, it will not append the library to the LIBS variable
which will be used by Automake.

As I had described in the comments, I had intentionally (wrongfully!) defined
that variable, so all the libraries are not linked for all the programs (for
example some programs don't need GSL, or some don't need CFITSIO). This was
done very early on and I didn't know that there is no harm in having unused
libraries in the list of libraries to link against: the linker will search the
library and only use the parts that are needed.

The autoconf manual suggests using AC_SEARCH_LIBS instead of AC_CHECK_LIB,
since it allows for searching a function in multiple libraries (for example in
different operating systems). Also it will automatically add the library to
the LIBS variable. A great consequence of this is that since LIBS is used in
checking the subsequent libraries, if we start checking from the lowest level
library to the highest, there will be no need to add linking flags in checking
the libraries.

With all the links defined here, we can now remove the -lLIBRARY flags from
AM_LDFLAGS in all the separate subdirectories. I will finish the
implementation and if it compiles on Ubuntu, I will push it to master (and
post a comment here).

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48076>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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