So I have been trying to build avogadrolibs.
Avogadro libraries provide 3D rendering, visualization, analysis and data processing useful in computational chemistry, molecular modeling, bioinformatics, materials science, and related areas. - O...
But it encounter an error E: lto-no-text-in-archive which make the build failed.
The dev suggest that it might be openSUSE issue.
General Discussion
Support
I don’t use docker, so I’m not sure if this is the right one. https://hub.docker.com/r/opensuse/tumbleweed Right now, I am targeting Tumbleweed instead of Leap 15.2 since msgpack on Leap 15.2 is too old and could not be be use to build mmtf-cpp....
opened 12:09AM - 07 Apr 20 UTC
closed 07:00PM - 02 May 20 UTC
Hello,
I am trying to build avogadrolibs 1.93.0 on openSUSE Tumbleweed with c… make gcc.
I encounter multiple errors saying E: lto-no-text-in-archive
cmake give some hint: This archive does not contain a non-empty .text section. The archive was not reated with -ffat-lto-objects option.
I have added %global _lto_cflags %%{_lto_cflags} -ffat-lto-objects to cmake, which fix the error.
However, the package maintainer won't accept this, as it is not actually a fix. They gave no explanation.
I have no clue what this error it is trying to say. Maybe have to add -ffat-lto-objects to it.
Thanks.
```
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/BallStick.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/BondCentric.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Bonding.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/CoordinateEditor.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/CopyPaste.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Crystal.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/CrystalScene.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/CustomElements.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Editor.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Force.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/GamessInput.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Hydrogens.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/ImportPQR.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/LammpsInput.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Licorice.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/LineFormatInput.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Manipulator.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/MeasureTool.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Meshes.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/MolecularProperties.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/MongoChem.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Navigator.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/NetworkDatabases.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/OpenBabel.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/OverlayAxes.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/POVRay.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/PlayerTool.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/PluginDownloader.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/QuantumInput.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/ScriptFileFormats.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Select.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Selection.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/SpaceGroup.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Spectra.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Surfaces.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Symmetry.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/SymmetryScene.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/ThreeDMol.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/VRML.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/VanDerWaals.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/VanDerWaalsAO.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Wireframe.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/apbs.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/commands.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/liblibgwavi.a
[ 254s] This archive does not contain a non-empty .text section. The archive was not
[ 254s] created with -ffat-lto-objects option.
```
Which dev suggest that, quote,
There seems to be a similar openSUSE patch for a different package:
commit trousers for openSUSE:Factory
If there’s a way to detect your particular version of GCC, we can try to handle in our CMakeFiles.
What does this mean? What do I tell them?
Thanks
Hi
Add the following to the beginning of %build;
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
I would surmise your building static libs as well…
Ref: openSUSE:LTO - openSUSE Wiki
malcolmlewis:
Hi
Add the following to the beginning of %build;
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
I would surmise your building static libs as well…
Ref: openSUSE:LTO - openSUSE Wiki
Hello,
I did that before, however the science repo maintainer won’t accept that as a fix.
https://build.opensuse.org/request/show/780593 Also, did you mean that I should put devel-static into devel package?
Hi
Is the static library needed? If not, use cmake to disable the static build. If you do need the static lib then upstream will need to tweak the code for the lto flag…
The static lib is needed for the software to work properly. I will tell them that they need to add the flag.
Thanks
Hi
AFAIK it may also need code tweaks…
The dev are asking this, I don’t know the answer…
I’m okay with that - but presumably that’s needed for particular versions of GCC?
This seems very distro specific, it would be great to get some explanation, along with why I can’t reproduce it here using a very recent GCC - are you adding other compiler flags we aren’t using by default?
Show the dev the log file as will see all the flags passed;
https://build.opensuse.org/build/home:andythe_great/openSUSE_Tumbleweed/x86_64/avogadrolibs/_log
eg;
57s] -- Performing Test HAS_FLTO
57s] -- Performing Test HAS_FLTO - Success
57s] -- LTO enabled
AFAIK it all has to do with reproducible builds.
Hello,
Update on the situation, the dev could not figured out how or why they should change their cmake file.
Quote from Avogadro dev:
I spent some time looking into this, but IMHO, the package maintainer is wrong. As you said, the openSUSE docs recommend exactly that:
the easiest to achieve this is by adding, somewhere near the top of the .spec file:
%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects
If the package maintainer has another solution, patch, I’m happy to consider it. But I can’t find any way to detect that the compiler is using LTO, so I don’t see how our cmake files should change.
I just merged patches from Fedora and other downstream maintainers - and would be happy to merge any changes the openSUSE maintainer suggests.
Any suggestion on this? Thanks.
opened 12:09AM - 07 Apr 20 UTC
closed 07:00PM - 02 May 20 UTC
Hello,
I am trying to build avogadrolibs 1.93.0 on openSUSE Tumbleweed with c… make gcc.
I encounter multiple errors saying E: lto-no-text-in-archive
cmake give some hint: This archive does not contain a non-empty .text section. The archive was not reated with -ffat-lto-objects option.
I have added %global _lto_cflags %%{_lto_cflags} -ffat-lto-objects to cmake, which fix the error.
However, the package maintainer won't accept this, as it is not actually a fix. They gave no explanation.
I have no clue what this error it is trying to say. Maybe have to add -ffat-lto-objects to it.
Thanks.
```
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/BallStick.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/BondCentric.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Bonding.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/CoordinateEditor.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/CopyPaste.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Crystal.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/CrystalScene.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/CustomElements.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Editor.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Force.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/GamessInput.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Hydrogens.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/ImportPQR.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/LammpsInput.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Licorice.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/LineFormatInput.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Manipulator.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/MeasureTool.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Meshes.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/MolecularProperties.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/MongoChem.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Navigator.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/NetworkDatabases.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/OpenBabel.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/OverlayAxes.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/POVRay.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/PlayerTool.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/PluginDownloader.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/QuantumInput.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/ScriptFileFormats.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Select.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Selection.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/SpaceGroup.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Spectra.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Surfaces.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Symmetry.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/SymmetryScene.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/ThreeDMol.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/VRML.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/VanDerWaals.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/VanDerWaalsAO.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/Wireframe.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/apbs.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/avogadro2/staticplugins/commands.a
[ 254s] avogadrolibs-devel-static.x86_64: E: lto-no-text-in-archive (Badness: 10000) /usr/lib64/liblibgwavi.a
[ 254s] This archive does not contain a non-empty .text section. The archive was not
[ 254s] created with -ffat-lto-objects option.
```