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

Re: C++ help for freebayes needed



Am Di., 17. Dez. 2019 um 15:08 Uhr schrieb Andreas Tille <andreas@an3as.eu>:
>
> Hi,
>
> I intended to upgrade freebayes to its latest upstream version.  Unfortunately
> it does not build against the Debian packaged libs.  I've reported this upstream
> as issue
>
>     https://github.com/ekg/freebayes/issues/579
>
> May be it makes sense to discuss the issue there since upstream might want to
> take over latest versions of the used libraries sooner or later as well.
>
> Kind regards and thanks for any hint to solve the build issue

I just took a really, really quick look at it (< 5min). Looks like
there are multiple issues to be solved, for example the IntervalTree
template accepts two class types (Value and Scalar) and only one is
provided. That's an upstream bug that upsteam needs to solve, so there
isn't much you can do. I am very certain this build fails in any
circumstance, unless IntervalTree is downgraded, maybe.
Additionally, in
https://sources.debian.org/src/htslib/1.10-2/cram/cram_io.h/#L511
(included by this software) implicitly casting void* to something else
is illegal in C++. So either `unsigned char *tmp = realloc(b->data,
len);` has to be changed to `unsigned char *tmp = (unsigned char *)
realloc(b->data, len);` to be valid in both C and C++ (a clean
solution, but possibly impractical), or, the better way in this case,
the C library headers need to be wrapped in a block like this:
```

#ifdef __cplusplus
extern "C" {
#endif

/* include all C headers here */

#ifdef __cplusplus
}
#endif
```

Usually, many C headers already have this, but apparently this one
hasn't. That may fix this and any other issues as well (I haven't
tested that though). If it doesn't, the compiler has to be told that
this instruction is okay to use in the particular header, or the C
code has to be fixed to accomodate for that.

I hope this helps.
Cheers,
    Matthias

-- 
I welcome VSRE emails. See http://vsre.info/


Reply to: