gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master e398df6e: Build system: dependence of programs


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master e398df6e: Build system: dependence of programs on library within Make
Date: Fri, 2 Feb 2024 09:40:23 -0500 (EST)

branch: master
commit e398df6e41d9eeaad0e3927544b00826150d4b4c
Author: Thorsten Alteholz <thorsten@alteholz.dev>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Build system: dependence of programs on library within Make
    
    Until now, when a change was made to the library's source, the programs
    would not be re-built (assuming they were already built). The problem was
    that Gnuastro's library was only passed as a linking library with
    '-lgnuastro'; therefore Automake would just pass it to 'ld'; not check it
    as a prerequisite.
    
    With this commit, the direct path of 'libgnuastro.la' is used:
    $(top_builddir)/lib/libgnuastro.la. Therefore the makefile is able to add a
    real dependency and Libtool will worry about the linking
    details.
    
    Unfortunately this requires more CPU cycles during development as every
    binary has to be relinked if a change is made in the library. To fix this,
    we have the '--enable-*' options at configure time (for example
    '--enable-noisechisel'; available in all programs) that will only build the
    requested programs during developement.
---
 NEWS                        | 2 ++
 bin/TEMPLATE/Makefile.am    | 3 ++-
 bin/arithmetic/Makefile.am  | 5 ++++-
 bin/buildprog/Makefile.am   | 3 ++-
 bin/convertt/Makefile.am    | 3 ++-
 bin/convolve/Makefile.am    | 3 ++-
 bin/cosmiccal/Makefile.am   | 3 ++-
 bin/crop/Makefile.am        | 3 ++-
 bin/fits/Makefile.am        | 3 ++-
 bin/match/Makefile.am       | 3 ++-
 bin/mkcatalog/Makefile.am   | 3 ++-
 bin/mkprof/Makefile.am      | 3 ++-
 bin/noisechisel/Makefile.am | 3 ++-
 bin/query/Makefile.am       | 3 ++-
 bin/segment/Makefile.am     | 3 ++-
 bin/statistics/Makefile.am  | 3 ++-
 bin/table/Makefile.am       | 3 ++-
 bin/warp/Makefile.am        | 3 ++-
 18 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/NEWS b/NEWS
index bfaabbcd..beeaf909 100644
--- a/NEWS
+++ b/NEWS
@@ -247,6 +247,8 @@ See the end of the file for license conditions.
   - gal_wcs_write: as in 'gal_fits_img_write'.
 
 ** Bugs fixed
+  - bug #46225: Programs don't depend on libs in Makefiles; fixed by
+    Thorsten Alteholz.
   - bug #52295: Cosmology library integrals crash for high z; fixed by
     Thorsten Alteholz.
   - bug #52674: Correcting Clang warnings on macOS during compilation;
diff --git a/bin/TEMPLATE/Makefile.am b/bin/TEMPLATE/Makefile.am
index 6afe3253..5169cf73 100644
--- a/bin/TEMPLATE/Makefile.am
+++ b/bin/TEMPLATE/Makefile.am
@@ -36,7 +36,8 @@ bin_PROGRAMS = astTEMPLATE
 ## the 'libgnu' (that is indirectly linked through 'libgnuastro') can't see
 ## those variables. We thus need to explicitly link with 'libgnu' first.
 astTEMPLATE_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                    -lgnuastro $(CONFIG_LDADD)
+                    $(top_builddir)/lib/libgnuastro.la \
+                    $(CONFIG_LDADD)
 
 astTEMPLATE_SOURCES = main.c ui.c TEMPLATE.c
 
diff --git a/bin/arithmetic/Makefile.am b/bin/arithmetic/Makefile.am
index 9249c2ca..ba30db5c 100644
--- a/bin/arithmetic/Makefile.am
+++ b/bin/arithmetic/Makefile.am
@@ -32,7 +32,10 @@ bin_PROGRAMS = astarithmetic
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 astarithmetic_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                      -lgnuastro $(CONFIG_LDADD)
+                      $(top_builddir)/lib/libgnuastro.la \
+                      $(CONFIG_LDADD)
+
+
 
 astarithmetic_SOURCES = main.c ui.c arithmetic.c operands.c
 
diff --git a/bin/buildprog/Makefile.am b/bin/buildprog/Makefile.am
index 56673fd8..8c88c117 100644
--- a/bin/buildprog/Makefile.am
+++ b/bin/buildprog/Makefile.am
@@ -39,7 +39,8 @@ bin_PROGRAMS = astbuildprog
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 astbuildprog_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                     -lgnuastro $(CONFIG_LDADD)
+                     $(top_builddir)/lib/libgnuastro.la \
+                     $(CONFIG_LDADD)
 
 # Basic program sources.
 astbuildprog_SOURCES = main.c ui.c buildprog.c
diff --git a/bin/convertt/Makefile.am b/bin/convertt/Makefile.am
index bb39b380..9a2874b8 100644
--- a/bin/convertt/Makefile.am
+++ b/bin/convertt/Makefile.am
@@ -32,7 +32,8 @@ bin_PROGRAMS = astconvertt
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 astconvertt_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                    -lgnuastro $(CONFIG_LDADD)
+                    $(top_builddir)/lib/libgnuastro.la \
+                    $(CONFIG_LDADD)
 
 astconvertt_SOURCES = main.c ui.c convertt.c color.c
 
diff --git a/bin/convolve/Makefile.am b/bin/convolve/Makefile.am
index 7de8e3de..a95b308d 100644
--- a/bin/convolve/Makefile.am
+++ b/bin/convolve/Makefile.am
@@ -32,7 +32,8 @@ bin_PROGRAMS = astconvolve
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 astconvolve_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                    -lgnuastro $(CONFIG_LDADD)
+                    $(top_builddir)/lib/libgnuastro.la \
+                    $(CONFIG_LDADD)
 
 astconvolve_SOURCES = main.c ui.c convolve.c
 
diff --git a/bin/cosmiccal/Makefile.am b/bin/cosmiccal/Makefile.am
index 2945a799..7984ffea 100644
--- a/bin/cosmiccal/Makefile.am
+++ b/bin/cosmiccal/Makefile.am
@@ -32,7 +32,8 @@ bin_PROGRAMS = astcosmiccal
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 astcosmiccal_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                     -lgnuastro $(CONFIG_LDADD)
+                     $(top_builddir)/lib/libgnuastro.la \
+                     $(CONFIG_LDADD)
 
 astcosmiccal_SOURCES = main.c ui.c cosmiccal.c
 
diff --git a/bin/crop/Makefile.am b/bin/crop/Makefile.am
index 403bb277..f717e029 100644
--- a/bin/crop/Makefile.am
+++ b/bin/crop/Makefile.am
@@ -32,7 +32,8 @@ bin_PROGRAMS = astcrop
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 astcrop_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                -lgnuastro $(CONFIG_LDADD)
+                $(top_builddir)/lib/libgnuastro.la \
+                $(CONFIG_LDADD)
 
 astcrop_SOURCES = main.c ui.c crop.c wcsmode.c onecrop.c
 
diff --git a/bin/fits/Makefile.am b/bin/fits/Makefile.am
index c385a6b7..2967824c 100644
--- a/bin/fits/Makefile.am
+++ b/bin/fits/Makefile.am
@@ -33,7 +33,8 @@ bin_PROGRAMS = astfits
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 astfits_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                -lgnuastro $(CONFIG_LDADD)
+                $(top_builddir)/lib/libgnuastro.la \
+                $(CONFIG_LDADD)
 
 astfits_SOURCES = main.c ui.c extension.c fits.c keywords.c meta.c
 
diff --git a/bin/match/Makefile.am b/bin/match/Makefile.am
index 2f6ec1b6..71a6d981 100644
--- a/bin/match/Makefile.am
+++ b/bin/match/Makefile.am
@@ -32,7 +32,8 @@ bin_PROGRAMS = astmatch
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 astmatch_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                 -lgnuastro $(CONFIG_LDADD)
+                 $(top_builddir)/lib/libgnuastro.la \
+                 $(CONFIG_LDADD)
 
 astmatch_SOURCES = main.c ui.c match.c
 
diff --git a/bin/mkcatalog/Makefile.am b/bin/mkcatalog/Makefile.am
index 17e6641a..01f587a3 100644
--- a/bin/mkcatalog/Makefile.am
+++ b/bin/mkcatalog/Makefile.am
@@ -32,7 +32,8 @@ bin_PROGRAMS = astmkcatalog
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 astmkcatalog_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                     -lgnuastro $(CONFIG_LDADD)
+                     $(top_builddir)/lib/libgnuastro.la \
+                     $(CONFIG_LDADD)
 
 astmkcatalog_SOURCES = main.c ui.c mkcatalog.c columns.c upperlimit.c parse.c
 
diff --git a/bin/mkprof/Makefile.am b/bin/mkprof/Makefile.am
index 5a2a74cb..06e9ac1e 100644
--- a/bin/mkprof/Makefile.am
+++ b/bin/mkprof/Makefile.am
@@ -32,7 +32,8 @@ bin_PROGRAMS = astmkprof
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 astmkprof_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                  -lgnuastro $(CONFIG_LDADD)
+                  $(top_builddir)/lib/libgnuastro.la \
+                  $(CONFIG_LDADD)
 
 astmkprof_SOURCES = main.c ui.c mkprof.c oneprofile.c profiles.c
 
diff --git a/bin/noisechisel/Makefile.am b/bin/noisechisel/Makefile.am
index 6eb13154..8c1375c2 100644
--- a/bin/noisechisel/Makefile.am
+++ b/bin/noisechisel/Makefile.am
@@ -32,7 +32,8 @@ bin_PROGRAMS = astnoisechisel
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 astnoisechisel_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                       -lgnuastro $(CONFIG_LDADD)
+                       $(top_builddir)/lib/libgnuastro.la \
+                       $(CONFIG_LDADD)
 
 astnoisechisel_SOURCES = main.c ui.c detection.c noisechisel.c sky.c     \
   threshold.c
diff --git a/bin/query/Makefile.am b/bin/query/Makefile.am
index 453d8361..728a1946 100644
--- a/bin/query/Makefile.am
+++ b/bin/query/Makefile.am
@@ -32,7 +32,8 @@ bin_PROGRAMS = astquery
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 astquery_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                 -lgnuastro $(CONFIG_LDADD)
+                 $(top_builddir)/lib/libgnuastro.la \
+                 $(CONFIG_LDADD)
 
 astquery_SOURCES = main.c ui.c query.c astron.c gaia.c ned.c tap.c \
                    vizier.c
diff --git a/bin/segment/Makefile.am b/bin/segment/Makefile.am
index 9881d114..0ac2621d 100644
--- a/bin/segment/Makefile.am
+++ b/bin/segment/Makefile.am
@@ -32,7 +32,8 @@ bin_PROGRAMS = astsegment
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 astsegment_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                   -lgnuastro $(CONFIG_LDADD)
+                   $(top_builddir)/lib/libgnuastro.la \
+                   $(CONFIG_LDADD)
 
 astsegment_SOURCES = main.c ui.c segment.c clumps.c
 
diff --git a/bin/statistics/Makefile.am b/bin/statistics/Makefile.am
index 78df37f5..09eb5c5e 100644
--- a/bin/statistics/Makefile.am
+++ b/bin/statistics/Makefile.am
@@ -32,7 +32,8 @@ bin_PROGRAMS = aststatistics
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 aststatistics_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                      -lgnuastro $(CONFIG_LDADD)
+                      $(top_builddir)/lib/libgnuastro.la \
+                      $(CONFIG_LDADD)
 
 aststatistics_SOURCES = main.c ui.c contour.c sky.c statistics.c
 
diff --git a/bin/table/Makefile.am b/bin/table/Makefile.am
index 521c7ddf..c2a74548 100644
--- a/bin/table/Makefile.am
+++ b/bin/table/Makefile.am
@@ -32,7 +32,8 @@ bin_PROGRAMS = asttable
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 asttable_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                 -lgnuastro $(CONFIG_LDADD)
+                 $(top_builddir)/lib/libgnuastro.la \
+                 $(CONFIG_LDADD)
 
 asttable_SOURCES = main.c ui.c arithmetic.c table.c
 
diff --git a/bin/warp/Makefile.am b/bin/warp/Makefile.am
index 292ff4e5..dc40f2f6 100644
--- a/bin/warp/Makefile.am
+++ b/bin/warp/Makefile.am
@@ -32,7 +32,8 @@ bin_PROGRAMS = astwarp
 
 ## Reason for linking with 'libgnu' described in 'bin/TEMPLATE/Makefile.am'.
 astwarp_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
-                -lgnuastro $(CONFIG_LDADD)
+                $(top_builddir)/lib/libgnuastro.la \
+                $(CONFIG_LDADD)
 
 astwarp_SOURCES = main.c ui.c warp.c
 



reply via email to

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