-
Notifications
You must be signed in to change notification settings - Fork 63
duplicate symbol typeinfo under MacOS #734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Unfortunately unable to replicate because the Mac I use with 10.14 is crashed at the observatory, physical access denied because of Covid :((
|
can you confirm that the file instantiate_templates.cpp is as in |
The machine with OSX 10.14.4 was just restarted, compilation with Clang 10 is OK. I will test now GCC.
|
Hi @GillesDuvert, |
Replicated on OSX 10.14.4 with GCC 8, lot of messages (similar)
unclear for me why so much dependencies should be switch OFF for GCC and not for Clang |
This comes probably from the
could you comment out the corresponding #include line in each of these files and check that re-compilation goes well? (it does, for me). |
Hi @GillesDuvert, I tried commenting out the #include "datatypes.hpp" |
same for me : if commented, compilation OK with Clang, failed with GCC @hivon: same than me :( cmake ..... -Dmagick=off just for tests ?! |
few tools : doxygen, a tool in clang, cppclean by Google. https://stackoverflow.com/questions/614794/detecting-superfluous-includes-in-c-c |
I spend some time on this issue last week
I plan to come back on OSX soon because my test-bed is back online :) |
working today on that with the help of Eric, thanks.
gives :
|
maybe it is related to lines around 217 in datatypes.hpp with :
|
The C++ code is indeed a bit convoluted. Splitting the huge datatypes file was too easy to be honest 😄 It seems that some linkers are less regarding than others, because indeed in the current state compiling two .cpp files create duplicate symbols for the same things. When the linker is accomodating, things go well and the fact that Data_<> is defined twice is transparent as the definition is the same. But this definitely needs to be sorted out. |
should we then wait with rc3 till solving it? |
Ok for me. Wait rc4 ! I would say, as long as it's compiling fine for me on 10.14.4 with CLang on the same machine, and CLang is present by default, it is more or less non blocking. The problem with 10.15.4 and X11 #780 is more annoying for me |
Still no wxWidgets on MacOS? |
I don't know ! I have no way to test. |
how about removing |
I can try, but later ! this evening |
FWIW, compilation OK on my Debian laptop with gcc 8.3 |
(waiting from my oven) not working for me :( (osx + gcc version 8.2.0 (Homebrew GCC 8.2.0) ) |
not working means what? does not compile (should, as it compiles with linux+gcc) or has the same duplicate symbol problem as above? |
Sorry. Same duplicate symbols (compilation goes to the end) |
everything is explained here. |
@acoulais, coudl you try with:
#ifndef INSTANTIATE_TEMPLATES_HPP_
#define INSTANTIATE_TEMPLATES_HPP_
inline template class Data_< SpDByte>;
inline template class Data_< SpDInt>;
inline template class Data_< SpDUInt>;
inline template class Data_< SpDLong>;
inline template class Data_< SpDULong>;
inline template class Data_< SpDLong64>;
inline template class Data_< SpDULong64>;
inline template class Data_< SpDPtr>;
inline template class Data_< SpDFloat>;
inline template class Data_< SpDDouble>;
inline template class Data_< SpDString>;
inline template class Data_< SpDObj>;
inline template class Data_< SpDComplex>;
inline template class Data_< SpDComplexDbl>;
#endif and 2) the end of datatypes.cpp modified such as: return Real2Int<SizeT,double>(real((*this)[i]));
}
template class Data_< SpDByte>;
template class Data_< SpDInt>;
template class Data_< SpDUInt>;
template class Data_< SpDLong>;
template class Data_< SpDULong>;
template class Data_< SpDLong64>;
template class Data_< SpDULong64>;
template class Data_< SpDPtr>;
template class Data_< SpDFloat>;
template class Data_< SpDDouble>;
template class Data_< SpDString>;
template class Data_< SpDObj>;
template class Data_< SpDComplex>;
template class Data_< SpDComplexDbl>;
//#include "instantiate_templates.hpp" pls notice the #include instantiate template is commented out 😄 |
I think I made the tests as carefully as I can (on a new copy of the master)
but the compilation succeed.
|
Too bad. #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
// by default intel C++ defines __GNUC__
#pragma interface
#endif at lines 29-32 from datatypes.hpp (i precise that every of the above changes produces always a correct compilation and code on my side, linux+gcc 8.4.0) |
Yes, I played in this region yesterday, tryng to add similar flags than clang ones I will try now |
nop 👎 before, it was only 252 duplicate, now : ld: 1260 duplicate symbols for architecture x86_64 what is strange for me is that we have other machines with GCC 7, 8, 9 and no problem. Only problem here with this special compiler :( |
Yes, I would say the GDL code passes almost everywhere because the compilers are quite friendly. |
@alaingdl or @hivon, does this branch compile ? |
Still fails for me on Fedora Rawhide on 32-bit arm: |
@opoplawski thank you, that was a pitiful attempt on my side. Unfortunately compiling the base gdl objects menagerie when they are templated in so many files & includes needs skills I do not have. |
please have a try now that #882 is merged |
closed by #1776 |
This problem looks a bit like #677.
Under MacOS 10.14.6, with GNU CC 8.3.0 (as well as 9.2.0),
the release 1.0.0-rc.2 (as well as the git version of March 24),
crashes at linking with the error message
Any way out ?
The text was updated successfully, but these errors were encountered: