Results 1 to 9 of 9

Thread: How to detect GCC using CMakeFiles? (avogadrolibs dev ask this)

  1. #1
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    134

    Default How to detect GCC using CMakeFiles? (avogadrolibs dev ask this)

    So I have been trying to build avogadrolibs.

    https://github.com/OpenChemistry/avogadrolibs
    https://build.opensuse.org/package/s...t/avogadrolibs


    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.

    https://discuss.avogadro.cc/t/instal...2-fails/3065/6
    https://github.com/OpenChemistry/avo...ibs/issues/455

    Which dev suggest that, quote,
    There seems to be a similar openSUSE patch for a different package:
    https://www.mail-archive.com/opensus...msg166302.html

    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

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,833
    Blog Entries
    15

    Default Re: How to detect GCC using CMakeFiles? (avogadrolibs dev ask this)

    Quote Originally Posted by andythe_great View Post
    So I have been trying to build avogadrolibs.

    https://github.com/OpenChemistry/avogadrolibs
    https://build.opensuse.org/package/s...t/avogadrolibs


    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.

    https://discuss.avogadro.cc/t/instal...2-fails/3065/6
    https://github.com/OpenChemistry/avo...ibs/issues/455

    Which dev suggest that, quote,


    What does this mean? What do I tell them?

    Thanks
    Hi
    Add the following to the beginning of %build;

    Code:
    %global _lto_cflags %{_lto_cflags} -ffat-lto-objects
    I would surmise your building static libs as well....

    Ref: https://en.opensuse.org/openSUSE:LTO...enSUSE:Factory
    Last edited by malcolmlewis; 15-Apr-2020 at 06:17. Reason: Add lto reference
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    134

    Default Re: How to detect GCC using CMakeFiles? (avogadrolibs dev ask this)

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Add the following to the beginning of %build;

    Code:
    %global _lto_cflags %{_lto_cflags} -ffat-lto-objects
    I would surmise your building static libs as well....

    Ref: https://en.opensuse.org/openSUSE:LTO...enSUSE:Factory
    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?

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,833
    Blog Entries
    15

    Default Re: How to detect GCC using CMakeFiles? (avogadrolibs dev ask this)

    Quote Originally Posted by andythe_great View Post
    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...
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    134

    Default Re: How to detect GCC using CMakeFiles? (avogadrolibs dev ask this)

    Quote Originally Posted by malcolmlewis View Post
    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

  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,833
    Blog Entries
    15

    Default Re: How to detect GCC using CMakeFiles? (avogadrolibs dev ask this)

    Quote Originally Posted by andythe_great View Post
    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....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  7. #7
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    134

    Default Re: How to detect GCC using CMakeFiles? (avogadrolibs dev ask this)

    Quote Originally Posted by malcolmlewis View Post
    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?

  8. #8
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,833
    Blog Entries
    15

    Default Re: How to detect GCC using CMakeFiles? (avogadrolibs dev ask this)

    Quote Originally Posted by andythe_great View Post
    The dev are asking this, I don't know the answer...
    https://gcc.gnu.org/onlinedocs/gccint/LTO-Overview.html

    Show the dev the log file as will see all the flags passed;
    https://build.opensuse.org/build/hom...gadrolibs/_log

    eg;
    Code:
    [   57s] -- Performing Test HAS_FLTO
    [   57s] -- Performing Test HAS_FLTO - Success
    [   57s] -- LTO enabled
    AFAIK it all has to do with reproducible builds.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  9. #9
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    134

    Default Re: How to detect GCC using CMakeFiles? (avogadrolibs dev ask this)

    Quote Originally Posted by malcolmlewis View Post
    https://gcc.gnu.org/onlinedocs/gccint/LTO-Overview.html

    Show the dev the log file as will see all the flags passed;
    https://build.opensuse.org/build/hom...gadrolibs/_log

    eg;
    Code:
    [   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.

    https://github.com/OpenChemistry/avo...ibs/issues/455

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •