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

Linking Praat against the native GSL library



[Cc:ing to the Debian-Med group, which is the official maintainer of the praat package in Debian.]

Hi Paul and David,

It has been recently brought to my attention the efforts of the Linaro Enterprise Group in detecting assembly code embedded in software packaged for Debian:

      https://wiki.linaro.org/LEG/Engineering/OPTIM/Assembly

Praat is listed in their results:

      https://docs.google.com/spreadsheet/ccc?key=0AlPnaP13iYU0dGJsajBNSTdEQXFuTnBmUnRpY1BGNXc&pli=1#gid=0

The reason is that the Praat executable includes libraries that are shipped as shared libraries in the Debian distribution. If I understand correctly from what is written in the files:

     external/espeak/READ_ME.TXT
     external/glpk/READ_ME.TXT
     external/flac/READ_ME.TXT
     external/portaudio/READ_ME.TXT
     external/mp3/mp3.h

you had modified the external libraries such that linking against the native shlib versions of them will not work. However, I could not find indications that you need an embedded version of GSL. I tried to build the praat package for Debian by linking against the native libgsl0 (see patched attached below) and it seems to work (the version of GSL currently in Debian is 1.15). Please, tell me whether you think this could be inappropriate for the Debian/Ubuntu users.

All the best,

Rafael



Description: Link against the external GSL library
Author: Rafael Laboissiere <rafael@laboissiere.net>
Last-Update: 2013-04-10

--- praat-5.3.44.orig/makefile
+++ praat-5.3.44/makefile
@@ -11,7 +11,6 @@ include makefile.defs
 
 # Makes the Praat executable in the source directory.
 all:
-	$(MAKE) -C external/gsl
 	$(MAKE) -C external/glpk
 	$(MAKE) -C external/mp3
 	$(MAKE) -C external/flac
@@ -39,7 +38,7 @@ all:
 		sys/libsys.a num/libnum.a kar/libkar.a \
 		external/espeak/libespeak.a external/portaudio/libportaudio.a \
 		external/flac/libflac.a external/mp3/libmp3.a \
-		external/glpk/libglpk.a external/gsl/libgsl.a \
+		external/glpk/libglpk.a -lgsl -lgslcblas \
 		$(LIBS) $(LDFLAGS)
 
 clean:
--- praat-5.3.44.orig/contrib/ola/Makefile
+++ praat-5.3.44/contrib/ola/Makefile
@@ -4,7 +4,7 @@
 
 include ../../makefile.defs
 
-CPPFLAGS = -I ../../dwtools -I ../../fon -I ../../sys -I ../../dwsys -I ../../stat -I ../../num -I ../../external/gsl -D_DEBUG -D_REENTRANT
+CPPFLAGS = -I ../../dwtools -I ../../fon -I ../../sys -I ../../dwsys -I ../../stat -I ../../num -I /usr/include/gsl -D_DEBUG -D_REENTRANT
 
 OBJECTS = KNN.o \
    KNN_threads.o Pattern_to_Categories_cluster.o KNN_prune.o FeatureWeights.o praat_contrib_Ola_KNN.o manual_KNN.o
@@ -23,4 +23,4 @@ libOla.a: $(OBJECTS)
 	ar cq libOla.a $(OBJECTS)
 	$(RANLIB) libOla.a
 
-$(OBJECTS): *.h ../../sys/*.h ../../dwtools/*.h ../../fon/*.h ../../dwsys/*.h ../../stat/*.h ../../num/*.h ../../external/gsl/*.h
+$(OBJECTS): *.h ../../sys/*.h ../../dwtools/*.h ../../fon/*.h ../../dwsys/*.h ../../stat/*.h ../../num/*.h
--- praat-5.3.44.orig/dwsys/Makefile
+++ praat-5.3.44/dwsys/Makefile
@@ -3,7 +3,7 @@
 
 include ../makefile.defs
 
-CPPFLAGS =  -I ../stat -I ../num -I ../sys -I dwsys -I ../external/gsl -I ../kar
+CPPFLAGS =  -I ../stat -I ../num -I ../sys -I dwsys -I /usr/include/gsl -I ../kar
 
 all: libdwsys.a
 
@@ -30,5 +30,5 @@ libdwsys.a: $(OBJECTS) NUMmachar.o
 	ar cq libdwsys.a $(OBJECTS)
 	$(RANLIB) libdwsys.a
 
-$(OBJECTS): *.h ../stat/*.h ../num/NUM.h ../sys/*.h ../external/gsl/*.h ../dwsys/*.h ../kar/*.h
+$(OBJECTS): *.h ../stat/*.h ../num/NUM.h ../sys/*.h ../dwsys/*.h ../kar/*.h
 
--- praat-5.3.44.orig/num/Makefile
+++ praat-5.3.44/num/Makefile
@@ -3,7 +3,7 @@
 
 include ../makefile.defs
 
-CPPFLAGS = -I ../external/gsl -I ../external/glpk -I ../sys -I ../dwsys
+CPPFLAGS = -I /usr/include/gsl -I ../external/glpk -I ../sys -I ../dwsys
 
 OBJECTS = NUM.o NUMarrays.o NUMrandom.o NUMsort.o NUMear.o NUMlinprog.o
 
@@ -21,4 +21,4 @@ libnum.a: $(OBJECTS)
 	ar cq libnum.a $(OBJECTS)
 	$(RANLIB) libnum.a
 
-$(OBJECTS): *.h ../external/gsl/*.h ../external/glpk/*.h ../sys/*.h ../dwsys/*.h
+$(OBJECTS): *.h ../external/glpk/*.h ../sys/*.h ../dwsys/*.h

Reply to: