Re: Build problems with afno
Hello Andreas & Udo,
the project needed a few more patches (all attached).
Udo: I did not report these problems in the upstream github project,
mainly because one has to fork the project and can not simply attach a
patch to an issue.
The patches:
01: silence some warnings that will become errors if C++11 should become
the default with g++.
02: correct the initialization of minscore_ - it was initialized from
itself.
03: unistd.h needs to be pulled in now manually.
04: Fixes the template scope problem Andreas actually asked about.
05: Updated Andreas the configure.ac/Makefile.am patch to properly link
libprotobuf to the executables.
It now compiles and links on my Debian testing machine - a few warnings
are left though. I leave it to Andreas to merge the patches into the
Debian scm - you can just replace the contents of debian/patches with
the attached files.
Best,
Gert
Author: Gert Wollny <gw.fossdev@gmail.com
Last-Update: Wed, 08 Jan 2014 11:55:33 +0100
Description: Force initialization to unsigned because the conversion is narrowing
Here this is still only a warning but with C++11 this will be an error.
diff -ur -x Makefile.in anfo-0.98/src/anfo-tool.cc anfo-0.98.debian/src/anfo-tool.cc
--- anfo-0.98/src/anfo-tool.cc 2010-09-24 14:18:59.000000000 +0200
+++ anfo-0.98.debian/src/anfo-tool.cc 2014-01-08 11:37:35.884269960 +0100
@@ -461,8 +461,8 @@
{ "output-wiggle", 0 , POPT_ARG_STRING, 0, opt_output_wiggle, "write depth-of-coverage in WIG format to FILE", "FILE" },
{ "duct-tape", 0 , POPT_ARG_STRING, 0, opt_duct_tape, "mock-assemble into contigs named NAME", "NAME" },
- { "set-slope", 0 , POPT_ARG_DFLT, ¶m.slope, 0, "set slope parameter to S", "S" },
- { "set-intercept", 0 , POPT_ARG_DFLT, ¶m.intercept, 0, "set length discount parameter to L", "L" },
+ { "set-slope", 0 , (unsigned)POPT_ARG_DFLT, ¶m.slope, 0, "set slope parameter to S", "S" },
+ { "set-intercept", 0 , (unsigned)POPT_ARG_DFLT, ¶m.intercept, 0, "set length discount parameter to L", "L" },
{ "set-genome", 0 , POPT_ARG_STRING, ¶m.genome, 0, "set interesting genome parameter to G", "G" },
{ "clear-genome", 0 , POPT_ARG_VAL, ¶m.genome, 0, "clear interesting genome parameter", 0 },
Author: Gert Wollny <gw.fossdev@gmail.com
Last-Update: Wed, 08 Jan 2014 11:55:33 +0100
Description: Correct initialization of minscore_
diff -ur -x Makefile.in anfo-0.98/src/anfo_common.h anfo-0.98.debian/src/anfo_common.h
--- anfo-0.98/src/anfo_common.h 2010-09-24 14:19:00.000000000 +0200
+++ anfo-0.98.debian/src/anfo_common.h 2014-01-08 11:33:26.118447741 +0100
@@ -66,7 +66,7 @@
{}
Housekeeper( vector<string> left, vector<string> right, int minscore )
- : minscore_( minscore_ ), trim_left_( left ), trim_right_( right ) {}
+ : minscore_( minscore ), trim_left_( left ), trim_right_( right ) {}
virtual void put_result( const Result& ) ;
} ;
Author: Gert Wollny <gw.fossdev@gmail.com
Last-Update: Wed, 08 Jan 2014 11:55:33 +0100
Description: Include unistd.h to make F_OK available
diff -ur -x Makefile.in anfo-0.98/src/conffile.h anfo-0.98.debian/src/conffile.h
--- anfo-0.98/src/conffile.h 2010-09-24 14:15:00.000000000 +0200
+++ anfo-0.98.debian/src/conffile.h 2014-01-08 11:35:28.621379698 +0100
@@ -22,6 +22,7 @@
#include <google/protobuf/text_format.h>
#include <fstream>
#include <string>
+#include <unistd.h>
/*! \page configuration Configuration Files, Metadata, Output Format
*
Author: Gert Wollny <gw.fossdev@gmail.com
Last-Update: Wed, 08 Jan 2014 11:55:33 +0100
Description: Correct ordering of template declarations to honor new scope rules
diff -ur -x Makefile.in anfo-0.98/src/stream.h anfo-0.98.debian/src/stream.h
--- anfo-0.98/src/stream.h 2010-09-24 14:19:00.000000000 +0200
+++ anfo-0.98.debian/src/stream.h 2014-01-08 11:34:01.542138919 +0100
@@ -141,6 +141,9 @@
output::Hit* mutable_hit_to( output::Result* ) ;
output::Hit* mutable_hit_to( output::Result*, const string& ) ;
+inline output::Hit::Operation cigar_op( uint32_t c ) { return (output::Hit::Operation)(c & 0xf) ; }
+inline uint32_t cigar_len( uint32_t c ) { return c >> 4 ; }
+
//! \brief computes (trimmed) query length from CIGAR line
template< typename C > unsigned len_from_bin_cigar( const C& cig )
{
@@ -166,8 +169,6 @@
return l ;
}
-inline output::Hit::Operation cigar_op( uint32_t c ) { return (output::Hit::Operation)(c & 0xf) ; }
-inline uint32_t cigar_len( uint32_t c ) { return c >> 4 ; }
inline uint32_t mk_cigar( output::Hit::Operation op, uint32_t len ) { return len << 4 | op ; }
inline void push_op( std::vector<unsigned>& s, unsigned m, output::Hit::Operation op )
diff -ur -x Makefile.in anfo-0.98/src/util.h anfo-0.98.debian/src/util.h
--- anfo-0.98/src/util.h 2010-09-24 14:19:00.000000000 +0200
+++ anfo-0.98.debian/src/util.h 2014-01-08 11:30:42.819871162 +0100
@@ -44,6 +44,13 @@
}
template< typename T >
+T throw_errno_if_eq( T x, T y, const char* a, const char* b = 0 )
+{
+ if( x == y ) throw_errno( a, b ) ;
+ return x ;
+}
+
+template< typename T >
T throw_errno_if_minus1( T x, const char* a, const char* b = 0 )
{ return throw_errno_if_eq( x, (T)(-1), a, b ) ; }
@@ -51,12 +58,6 @@
T throw_errno_if_null( T x, const char* a, const char* b = 0 )
{ return throw_errno_if_eq( x, (T)0, a, b ) ; }
-template< typename T >
-T throw_errno_if_eq( T x, T y, const char* a, const char* b = 0 )
-{
- if( x == y ) throw_errno( a, b ) ;
- return x ;
-}
template< typename T >
T throw_if_negative( T x, const char* a, const char* b = 0 )
Author: Andreas Tille <tille@debian.org>, Gert Wollny <gw.fossdev@gmail.com
Last-Update: Wed, 08 Jan 2014 11:55:33 +0100
Description: Enable using autoreconf and add protobuf to global link command
diff -ur -x Makefile.in anfo-0.98/src/Makefile.am anfo-0.98.debian/src/Makefile.am
--- anfo-0.98/src/Makefile.am 2010-09-24 16:00:06.000000000 +0200
+++ anfo-0.98.debian/src/Makefile.am 2014-01-08 11:44:35.008758531 +0100
@@ -15,9 +15,9 @@
BUILT_SOURCES = config.pb.h output.pb.h config.pb.cc output.pb.cc
CLEANFILES = config.pb.h output.pb.h config.pb.cc output.pb.cc anfo.scm
-CFLAGS += $(protobuf_CFLAGS)
-CXXFLAGS += $(protobuf_CFLAGS)
-LDADD = libanfo.la
+AM_CFLAGS = $(protobuf_CFLAGS)
+AM_CXXFLAGS = $(protobuf_CFLAGS)
+LDADD = libanfo.la $(protobuf_LIBS)
libanfo_la_LDFLAGS = -version-info 0:0:0
libanfo_la_LIBADD = $(protobuf_LIBS) -lpthread
@@ -40,10 +40,10 @@
sed -e "s#__LIBDIR__#$(libdir)#g" < $(srcdir)/anfo.scm.in >> anfo.scm
config.pb.cc: config.proto
- $(PROTOC) -I. -I$(dir $(PROTOC))../include --cpp_out=. config.proto
+ protoc -I. -I/usr/include --cpp_out=. config.proto
output.pb.cc: output.proto
- $(PROTOC) -I. -I$(dir $(PROTOC))../include --cpp_out=. output.proto
+ protoc -I. -I/usr/include --cpp_out=. output.proto
config.pb.h: config.pb.cc
@:
--- anfo-0.98.orig/configure.ac
+++ anfo-0.98/configure.ac
@@ -72,3 +72,6 @@
src/Makefile
])
AC_OUTPUT
+
+m4_pattern_allow([AM_PROG_AR])
+AM_PROG_AR
01-silence-narrowing-conversion.patch
02-correct-minscore-self-initialization.patch
03-include-unistd-forF_OK.patch
04-reorder-template-for-new-scope-rules.patch
05-autoreconf.patch
Reply to: