Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 515880 - sci-mathematics/Macaulay2-1.6 - .../work/M2-release-1.6-stable-20130514/M2/libraries/final/lib/libcf.a(cf_factor.o): In function `NTL::Vec<NTL::Pair<NTL::ZZX, long> >::Vec(...)': /usr/include/NTL/vector.h:101: undefined reference to `NTL::Vec<NTL::Pair<NT
Summary: sci-mathematics/Macaulay2-1.6 - .../work/M2-release-1.6-stable-20130514/M2/li...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Thomas Kahle (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-30 18:28 UTC by Martin von Gagern
Modified: 2016-03-07 13:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (sci-mathematics:Macaulay2-1.6:20140630-172914.log,442.46 KB, text/plain)
2014-06-30 18:29 UTC, Martin von Gagern
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2014-06-30 18:28:42 UTC
Building Macaulay2 fails for me:

…/M2/libraries/final/lib/libcf.a(cf_factor.o): In function `NTL::Vec<NTL::Pair<NTL::ZZX, long> >::Vec(NTL::Vec<NTL::Pair<NTL::ZZX, long> > const&)':
/usr/include/NTL/vector.h:101: undefined reference to `NTL::Vec<NTL::Pair<NTL::ZZX, long> >::operator=(NTL::Vec<NTL::Pair<NTL::ZZX, long> > const&)'
…/M2/libraries/final/lib/libcf.a(cf_factor.o): In function `NTL::Vec<NTL::Pair<NTL::zz_pX, long> >::Vec(NTL::Vec<NTL::Pair<NTL::zz_pX, long> > const&)':
/usr/include/NTL/vector.h:101: undefined reference to `NTL::Vec<NTL::Pair<NTL::zz_pX, long> >::operator=(NTL::Vec<NTL::Pair<NTL::zz_pX, long> > const&)'
…/M2/libraries/final/lib/libcf.a(cf_factor.o): In function `NTL::Vec<NTL::Pair<NTL::GF2X, long> >::Vec(NTL::Vec<NTL::Pair<NTL::GF2X, long> > const&)':
/usr/include/NTL/vector.h:101: undefined reference to `NTL::Vec<NTL::Pair<NTL::GF2X, long> >::operator=(NTL::Vec<NTL::Pair<NTL::GF2X, long> > const&)'

and so on. Looking at vector.h, I find the inlined in line 101 which is the line the error messages mention. I find the declaration of that method operator one line later, in 102. And starting at line 377 I see a template for the method implementation. So that looks fine.

Looking at the Macaulay build log, however, I see -fno-implicit-templates among the compiler flags. The problem here, as far as I can see it, is the fact that NTL recently changed from macros to templates, so that M2 isn't prepared to instantiate those templates.

I'm not sure about the beast way to fix this. I'd like to enable automatic template instantiation for just one namespace, but I don't think there is a way to do that. So I fear we might have to add instantiations till the linker is happy, then enclose them in some conditional compilation block to ensure backwards compatibility.
Comment 1 Martin von Gagern 2014-06-30 18:29:17 UTC
Created attachment 380000 [details]
build log
Comment 2 Martin von Gagern 2014-06-30 18:36:23 UTC
Also reported this upstream as issue 147.
Comment 3 Martin von Gagern 2014-07-01 05:09:12 UTC
(In reply to Martin von Gagern from comment #2)
> Also reported this upstream as issue 147.

Upstream decided this is a downstream packaging issue. Or at least an issue which is not present in their master branch, so their next release, 1.7 expected some time this summer, should fix things. Perhaps the upstream upgrade of factory from 3.1.6 to 4.0.0+m4 is the relevant change, so one approach might be cherry-picking those changes into a Gentoo patch. Another approach might be simply accepting the incompatibility, and declaring a blocker for >=ntl-6. A third option could be explicitely instantiating all templates within the ntl shared library, at least all those which have associated typedefs for backwards compatibility. And the idea about adding conditional template instantiations to the code remains valid as well, but for that I need someone who understands the Macaulay2 build system, as I can't get my modifications to take effect in an incremental build, and doing a complete build after each change takes too long.
Comment 4 Thomas Kahle (RETIRED) gentoo-dev 2016-03-07 13:40:32 UTC
Should be long fixed in 1.8 branch.