Open hubutui opened 4 years ago
@JasonRuonanWang @chuckatkins Just to get you guy's attention since I had a quick look. It looks like the problem is associated with DataMan, or at least the undefined symbol belongs to the DataManSerializer. Oddly, from looking at the build log, DataManSerializer.cpp is being built, but not DataManSerializer.tcc.
That's to be expected; the tcc files don't get individually compiled but should instead included by cpp files which should be performing the necessary template instantiations. The file separation should be:
.h
Header files containing prototypes and class definitions, including template function and class prototypes..inc
Header files containing the template specialization declarations. This is where we restrict the symbol definitions to only exist over a limited set of types. These should be included at the end of .h
files, if they're used at all, although I think we may have gotten rid of these a while ago from unnecessary complexity..cpp
Non template implementation files. These are the only files that actually get compiled..tcc
Template implementation files. This is where the body of template functions should be implemented including any per-type specialized implementations. These should be included by .cpp
files.Ah, should have noticed that before now. Something else going on then...
@hubutui ate there any extra compiler flags being set in the build environment? Maybe LTO? That could explain symbols getting unexpectedly removed after successfully building libadios2.
@chuckatkins ArchLinux use these flags:
#-- Compiler and Linker Flags
CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt"
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
According to cmake package guidelines, cmake might not use these flags set by makepkg
. I could run the building again with make VERBOSE=1
to check it.
Here is the new build log with make VERBOSE=1
:
adios2.buildlog.txt
I’m having the same issue while trying to build ADIOS2 for the official Arch Linux repos. Our CMake has since be patched to respect our distro flags.
My build log with VERBOSE=1
: https://paste.xinu.at/DBJCz/
Describe the bug fail to build adios2 for archlinux, check the complete build log here
Desktop (please complete the following information):
Additional context cmake configuration: