Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Linking a package against sci-physics/root

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
AstroFloyd
n00b
n00b
User avatar
Posts: 59
Joined: Tue Oct 18, 2011 3:29 pm

Linking a package against sci-physics/root

  • Quote

Post by AstroFloyd » Thu Jan 13, 2022 4:48 pm

I am trying to write an ebuild that will install a package that will be called sci-libs/gds-dtt-2.19.7. Its libraries need to be linked to those of the sci-physics/root package, which is in portage, so I installed v6.24.06-r1 thence. The gds-dtt installer uses autotools and its configure locates the root installation correctly, as sitting in the (unusual) path /usr/lib/root/6.24, and the root-config script, which can provide compiler flags:

Code: Select all

checking for root-config... /usr/lib/root/6.24/bin/root-config
checking for ROOT... checking for ROOT cling... yes
/usr/lib/root/6.24
However, when linking, the libraries are not found:

Code: Select all

           /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lGui
           /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lCore
           /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lImt
           /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lNet
           /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lHist
           etc...
I'm guessing I need to get the correct compiler options from root-config into my ebuild somehow, but I am not sure how to do this. (I naively tried

Code: Select all

CXXFLAGS="${CXXFLAGS} `root-config --cflags`"
but external commands are not allowed.) It is possible that my question boils down to "how can I call external commands to change e.g. the CXXFLAGS environment variable in an ebuild?".

The tarball for the package can be found here and I posted my current ebuild and metadata.xml. I have written ebuilds for (hopefully) all dependencies, which can be found in the AstroFloyd overlay, which can be added using e.g. app-portage/layman.
Top
Phoenix591
Guru
Guru
Posts: 506
Joined: Mon Sep 17, 2007 3:52 am

  • Quote

Post by Phoenix591 » Fri Jan 14, 2022 11:20 am

There's probably a better way to fix this particular problem, but use the flag-o-matic eclass to manipulate *FLAGS.
Top
larrys
Tux's lil' helper
Tux's lil' helper
Posts: 81
Joined: Mon Jul 20, 2020 9:41 pm
Location: New Jersey

  • Quote

Post by larrys » Fri Jan 14, 2022 11:36 am

I was thinking this could be fixed by adding

Code: Select all

AM_LDFLAGS = "-L$(rootlib) "
to the top-level Makefile.am. Automake also supports per-program variables like "foo_LDFLAGS". OP already has the "rootlib" variable set by configure using the "root-config" script. It just needs to be passed to Automake and added to the link step. Don't really think the ebuild is the right place to handle this.
Top
AstroFloyd
n00b
n00b
User avatar
Posts: 59
Joined: Tue Oct 18, 2011 3:29 pm

  • Quote

Post by AstroFloyd » Fri Jan 14, 2022 1:21 pm

Thanks for your help, I'll have a look at your suggestions. Meanwhile I also found a workaround here:

Code: Select all

 if [[ ${EBUILD_PHASE} != depend ]]; then
    # safely execute commands in global scope here
    CXXFLAGS="${CXXFLAGS} `root-config --cflags`"
    LDFLAGS="${LDFLAGS} `root-config --libs`"
fi
Not sure how good this practice is though...
Top
sam_
Developer
Developer
User avatar
Posts: 2817
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Mon Jan 17, 2022 6:30 am

AstroFloyd wrote:Thanks for your help, I'll have a look at your suggestions. Meanwhile I also found a workaround here:

Code: Select all

 if [[ ${EBUILD_PHASE} != depend ]]; then
    # safely execute commands in global scope here
    CXXFLAGS="${CXXFLAGS} `root-config --cflags`"
    LDFLAGS="${LDFLAGS} `root-config --libs`"
fi
Not sure how good this practice is though...
Order of preference:
1. Do it in the build system!
2. Do it in the ebuild. You should be able to just do append-cxxflags, append-ldflags (or append-libs ideally) from flag-o-matic.eclass.
3. Do it in the environment (ew).
Top
Post Reply

5 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic