Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tumbleweed: No native compiler found for Ada #21

Open
okellogg opened this issue Feb 19, 2017 · 8 comments
Open

Tumbleweed: No native compiler found for Ada #21

okellogg opened this issue Feb 19, 2017 · 8 comments

Comments

@okellogg
Copy link

On my OpenSuSE Tumbleweed installation, gnatls -v gives:

GNATLS 6.3.1 20170202 [gcc-6-branch revision 245119]
Copyright (C) 1997-2016, Free Software Foundation, Inc.

Source Search Path:
   <Current_Directory>
   /usr/lib64/gcc/x86_64-suse-linux/6/adainclude

Object Search Path:
   <Current_Directory>
   /usr/lib64/gcc/x86_64-suse-linux/6/adalib

Project Search Path:
   <Current_Directory>
   /usr/x86_64-suse-linux/lib/gnat
   /usr/x86_64-suse-linux/share/gpr
   /usr/share/gpr
   /usr/lib/gnat

and gcc -v gives:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/6/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada,go --enable-offload-targets=hsa --enable-checking=release --with-gxx-include-dir=/usr/include/c++/6 --enable-ssp --disable-libssp --disable-libvtv --disable-libcc1 --enable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-6 --without-system-libunwind --enable-multilib --with-arch-32=x86-64 --with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux
Thread model: posix
gcc version 6.3.1 20170202 [gcc-6-branch revision 245119] (SUSE Linux)

and gcc -print-search-dirs gives:

install: /usr/lib64/gcc/x86_64-suse-linux/6/
programs: =/usr/lib64/gcc/x86_64-suse-linux/6/:/usr/lib64/gcc/x86_64-suse-linux/6/:/usr/lib64/gcc/x86_64-suse-linux/:/usr/lib64/gcc/x86_64-suse-linux/6/:/usr/lib64/gcc/x86_64-suse-linux/:/usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/bin/x86_64-suse-linux/6/:/usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/bin/
libraries: =/usr/lib64/gcc/x86_64-suse-linux/6/:/usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/lib/x86_64-suse-linux/6/:/usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/lib/../lib64/:/usr/lib64/gcc/x86_64-suse-linux/6/../../../x86_64-suse-linux/6/:/usr/lib64/gcc/x86_64-suse-linux/6/../../../../lib64/:/lib/x86_64-suse-linux/6/:/lib/../lib64/:/usr/lib/x86_64-suse-linux/6/:/usr/lib/../lib64/:/usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/lib/:/usr/lib64/gcc/x86_64-suse-linux/6/../../../:/lib/:/usr/lib/

In gprbuild/share/gprconfig/compilers.xml compiler_description GNAT, the section <runtimes> has this line:

  <directory group="default" >\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/adalib/</directory>

There are two parts of the path expression where the OpenSuSE compiler deviates:

  • gprconfig expects \.\./lib/ but OpenSuSE uses \.\./lib64/
  • gprconfig expects $gcc_version which in this case is 6.3.1; however, OpenSuSE uses just 6.

I have been able to work around the problem as follows:

$ su
$ cd /usr/lib
$ ln -s /usr/lib64/gcc .
$ cd /usr/lib64/gcc/x86_64-suse-linux
$ ln -s 6 6.3.1

Of course, that is a quick hack of which I am not proud :/

@t-14
Copy link
Contributor

t-14 commented Feb 19, 2017

For sure the proper way to go is to enhance the xml knowledge base, adding "ln" simply works around its insufficient knowledge of non-AdaCore-packaged distributions.

Replacing "lib" with "lib*" in a regexp seems like a no-brainer, but matching too much stuff instead of $gcc_version is potentially dangerous, so this needs some consideration.

We are currently in the process of reviewing the KB (that has been growing in a somewhat haphazard fashion for over a decade) to make it more structured and manageable, and supporting third-party distribs is one of the objectives, so we are taking note of this special case. In the meantime the easiest for you is probably to tweak the KB locally on your side to accommodate your situation.

@MarioBlunk
Copy link

The finding of okellogg saved me a lot of time while installing gtkada. I did describe a similar workaround in https://github.com/Blunk-electronic/M-1/blob/master/gtkada_install.txt . Hopefully helping others...

@paherbst
Copy link

same problem on fedora 28. the bootstrap version of gprconfig does not find fedora's gnat.

fedora 28 has gcc 8.2.1, so gprconfig is looking in /usr/lib/.../8.2.1, but fedora keeps things in /usr/lib/.../8

gnatls seems to know this. why doesn't gprconfig use data from gnatls -v?

@landgraf
Copy link
Contributor

@paherbst Please open bug report https://bugzilla.redhat.com

@ajxs
Copy link

ajxs commented Jun 29, 2019

I'm experiencing the same issue on Ubuntu 18.04

@MarioBlunk
Copy link

@ajxy . Does the procedure I described above help you ?

@ajxs
Copy link

ajxs commented Jul 1, 2019

Your link 404's for me unfortunately. I was able to resolve the issue temporarily using the technique outlined by @okellogg above.

@MarioBlunk
Copy link

ok, for the others getting stuck please see:
https://github.com/Blunk-electronic/M-1/blob/master/SW/gtkada_install.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants