ornladios / ADIOS2

Next generation of ADIOS developed in the Exascale Computing Program
https://adios2.readthedocs.io/en/latest/index.html
Apache License 2.0
268 stars 125 forks source link

fail to build adios2 for archlinux due to unreference symbol error #2312

Open hubutui opened 4 years ago

hubutui commented 4 years ago

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:

  -DCMAKE_INSTALL_PREFIX=/usr \
  -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON \
  -DSZ_ROOT=/usr/include/sz
eisenhauer commented 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.

chuckatkins commented 4 years ago

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:

eisenhauer commented 4 years ago

Ah, should have noticed that before now. Something else going on then...

chuckatkins commented 4 years ago

@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.

hubutui commented 4 years ago

@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.

hubutui commented 4 years ago

Here is the new build log with make VERBOSE=1: adios2.buildlog.txt

ArchangeGabriel commented 3 years ago

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/