taskGNU Astronomy Utilities - Tasks: task #14157, Installed script for automatic...


You are not allowed to post comments on this tracker with your current authentication level.

task #14157: Installed script for automatic linking using Libtool

Submitter:  Mohammad Akhlaghi <makhlaghi>
Submitted:  Fri 16 Sep 2016 05:34:55 PM UTC
Should Start On:  Fri 16 Sep 2016 03:00:00 PM UTC Should be Finished on:  Fri 16 Sep 2016 03:00:00 PM UTC
Category:  Libraries Priority:  5 - Normal
Item Group:  Enhancement Status:  Postponed
Privacy:  Public Percent Complete:  30%
Assigned to:  None Open/Closed:  Open
Effort:  0.00

Fri 16 Sep 2016 05:34:55 PM UTC, original submission:  

With a recent commit, the "Automatic linking script" subsection was added to the "Libraries". A small shell function is introduced in this section for using Libtool to automatically link with all the necessary libraries Gnuastro depends on. The function is shown below, (to be put in `.bashrc' and after correcting PREFIX)

function gnuastro-gcc {
  libtool --mode=link gcc $1.c $2 PREFIX/lib/libgnuastro.la -o $1

With this shell function instead of running something like this (in the extreme case where all libraries would be necessary):

$ gcc myprog.c -o myprog -lgnuastro -lwcs -lcfitsio -lgsl -lgslcblas -pthread -lm

You can just run (see the subsection for a little more detailed explanation):

$ gnuastro-gcc myprog

Libtool's `libgnuastro.la' has all the necessary information for correct linking, we (the user) doesn't have to memorize them (or look them up in the manual).

Here, I am proposing to create this script when running `make install' and installing it along with the rest of Gnuastro. In the installed script we can use environment variables like `CPPFLAGS', `LDADD' or etc, along with all the extra information that `./configure' has found (like the compiler) to allow people to build small Gnuastro programs much more easier.

Mohammad Akhlaghi <makhlaghi>
Group administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by makhlaghi (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.11