Hi, the main problem here is that on ppc64el optimization (>= O2) seems to make the symbol disappear :
$ nm
./obj-powerpc64le-linux-gnu/CMakeFiles/diamond.dir/src/dp/needleman_wunsch.cpp.o|c++filt
|grep needle
0000000000001b50 T needleman_wunsch(sequence, sequence, int, int, int, int,
unsigned int, unsigned int, Diag_graph&, bool)
0000000000000000 W Fixed_score_buffer<int> const& needleman_wunsch<int,
Global>(sequence, sequence, int&, Global const&, int const&)
and we should see this one as well :
0000000000000000 W Fixed_score_buffer<int> const& needleman_wunsch<int,
Local>(sequence, sequence, int&, Local const&, int const&)
I don't know the intrinsics of this but I saw that kind of symbol blinking
issue in
c++ another time (also on weak symbols).
I tried two workarounds for this :
1. Force the symbol with c++ explicit function template instantiation for the
latter
prototype instead of relying on implicit instantiation in needleman_wunsch.cpp
--- diamond-aligner-0.9.8+dfsg.orig/src/dp/needleman_wunsch.cpp 2017-06-16
09:55:41.000000000 +0000
+++ diamond-aligner-0.9.8+dfsg/src/dp/needleman_wunsch.cpp 2017-06-28
10:12:20.000000000 +0000
@@ -322,4 +322,6 @@
}
print_diag(i0, j0, l, score, diags, q, s);
print_hsp(hsp, q);
-}
\ No newline at end of file
+}
+
+template Fixed_score_buffer<int> const& needleman_wunsch<int, Local>(sequence,
sequence, int&, Local const&, int const&);
This works and is compatible with all optimisation levels.
I am not a c++ expert at all and if there is a better solution, I'd be glad to
hear from.
http://en.cppreference.com/w/cpp/language/function_template
2. Use a lower optimisation level : O1 . In this case we don't follow the
Debian policy
but we don't change the upstream source code. But there will be other
modifications needed :
I noticed in :
/usr/bin/c++ -I/«BUILDDIR»/diamond-aligner-0.9.8+dfsg/src -g -O2
-fdebug-prefix-map=/«BUILDDIR»/diamond-aligner-0.9.8+dfsg=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -Wall -Wno-uninitialized -Wno-deprecated-declarations
-Wno-ignored-attributes -Wno-unused-variable -O3 -DNDEBUG -o
CMakeFiles/diamond.dir/src/dp/needleman_wunsch.cpp.o -c
/«BUILDDIR»/diamond-aligner-0.9.8+dfsg/src/dp/needleman_wunsch.cpp
that cmake still passes -O3 -DNDEBUG because of "set(CMAKE_BUILD_TYPE Release)"
where
we would need "set(CMAKE_BUILD_TYPE Release)" :
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=711515
And then in this case NDEBUG will not be defined and we need :
--- diamond-aligner-0.9.8+dfsg.orig/src/search/trace_pt_buffer.h
2017-06-16 09:55:41.000000000 +0000
+++ diamond-aligner-0.9.8+dfsg/src/search/trace_pt_buffer.h 2017-06-28
10:50:55.525390648 +0000
@@ -22,6 +22,10 @@
#include "../util/async_buffer.h"
#include "../basic/match.h"
+#ifndef NDEBUG
+#include <cstddef>
+#endif
+
#pragma pack(1)
because upstream code compilation fails "trace_pt_buffer.h:148:4: error:
‘ptrdiff_t’ was not declared in this scope"
F.
pgpwpHj_9puf_.pgp
Description: PGP signature

