问题
I installed GNAT on my OS X 10.8.5 machine with the following steps:
- Download GNAT GPL from http://libre.adacore.com/download/configurations
- Install with
./doinstall
, accepting all the default options - Added
/usr/local/gnat/bin
to$PATH
After trying to compile a simple hello world example I get this error:
$ gnat make hello
gcc -c hello.adb
gnatbind -x hello.ali
gnatbind: Cannot find: s-stalib.ali
gnatmake: *** bind failed.
Any idea why this might happen?
PS: gnat make -a hello
works, but creates tons of files and should not be required as far as i know.
Edit: As requested, here is the output of gnatls -v
GNATLS GPL 2013 (20130314)
Copyright (C) 1997-2013, Free Software Foundation, Inc.
Source Search Path:
<Current_Directory>
/usr/local/gnat/lib/gcc/x86_64-apple-darwin12.2.0/4.7.4/adainclude/
Object Search Path:
<Current_Directory>
/usr/local/gnat/lib/gcc/x86_64-apple-darwin12.2.0/4.7.4/adalib/
Project Search Path:
<Current_Directory>
/usr/local/gnat/x86_64-apple-darwin12.2.0/lib/gnat
/usr/local/gnat/share/gpr
/usr/local/gnat/lib/gnat
Here's an excerpt of the output of ls -l /usr/local/gnat/lib/gcc/x86_64-apple-darwin12.2.0/4.7.4/adalib/
:
total 39224
-rw-rwxr--@ 1 padde admin 4483 17 Apr 2013 Makefile.adalib
-rw-rwxr--@ 1 padde admin 1450 3 Jun 18:00 a-assert.ali
...
-rw-rwxr--@ 1 padde admin 3178 3 Jun 18:01 s-rpc.ali
-rw-rwxr--@ 1 padde admin 3778 3 Jun 18:01 s-scaval.ali
-rw-rwxr--@ 1 padde admin 4908 3 Jun 18:01 s-sequio.ali
-rw-rwxr--@ 1 padde admin 10542 3 Jun 18:01 s-shasto.ali
-rw-rwxr--@ 1 padde admin 6382 3 Jun 18:01 s-solita.ali
-rw-rwxr--@ 1 padde admin 8265 3 Jun 18:01 s-stausa.ali
-rw-rwxr--@ 1 padde admin 4919 3 Jun 18:01 s-stchop.ali
-rw-rwxr--@ 1 padde admin 14601 3 Jun 18:01 s-stratt.ali
-rw-rwxr--@ 1 padde admin 11024 3 Jun 18:01 s-ststop.ali
-rw-rwxr--@ 1 padde admin 5320 3 Jun 18:01 s-stusta.ali
-rw-rwxr--@ 1 padde admin 9804 3 Jun 18:01 s-taasde.ali
-rw-rwxr--@ 1 padde admin 4346 3 Jun 18:01 s-tadeca.ali
-rw-rwxr--@ 1 padde admin 4234 3 Jun 18:01 s-tadert.ali
-rw-rwxr--@ 1 padde admin 12564 3 Jun 18:01 s-taenca.ali
-rw-rwxr--@ 1 padde admin 6663 3 Jun 18:01 s-taprob.ali
-rw-rwxr--@ 1 padde admin 29033 3 Jun 18:01 s-taprop.ali
-rw-rwxr--@ 1 padde admin 13719 3 Jun 18:01 s-tarest.ali
-rw-rwxr--@ 1 padde admin 8863 3 Jun 18:01 s-tasdeb.ali
-rw-rwxr--@ 1 padde admin 747 3 Jun 18:01 s-tasinf.ali
-rw-rwxr--@ 1 padde admin 13008 3 Jun 18:01 s-tasini.ali
-rw-rwxr--@ 1 padde admin 15237 3 Jun 18:01 s-taskin.ali
-rw-rwxr--@ 1 padde admin 1259 3 Jun 18:01 s-tasloc.ali
-rw-rwxr--@ 1 padde admin 1710 3 Jun 18:01 s-taspri.ali
-rw-rwxr--@ 1 padde admin 11652 3 Jun 18:01 s-tasque.ali
-rw-rwxr--@ 1 padde admin 29450 3 Jun 18:01 s-tasren.ali
-rw-rwxr--@ 1 padde admin 1500 3 Jun 18:01 s-tasres.ali
-rw-rwxr--@ 1 padde admin 31332 3 Jun 18:01 s-tassta.ali
-rw-rwxr--@ 1 padde admin 11059 3 Jun 18:01 s-tasuti.ali
-rw-rwxr--@ 1 padde admin 7120 3 Jun 18:01 s-tataat.ali
-rw-rwxr--@ 1 padde admin 2942 3 Jun 18:01 s-tpinop.ali
-rw-rwxr--@ 1 padde admin 11318 3 Jun 18:01 s-tpoben.ali
-rw-rwxr--@ 1 padde admin 19570 3 Jun 18:01 s-tpobop.ali
-rw-rwxr--@ 1 padde admin 11075 3 Jun 18:01 s-tposen.ali
-rw-rwxr--@ 1 padde admin 1421 3 Jun 18:01 s-traces.ali
-rw-rwxr--@ 1 padde admin 3889 3 Jun 18:01 s-tratas.ali
-rw-rwxr--@ 1 padde admin 17789 3 Jun 18:01 s-utf_32.ali
-rw-rwxr--@ 1 padde admin 8312 3 Jun 18:01 s-vaflop.ali
-rw-rwxr--@ 1 padde admin 997 3 Jun 18:01 s-valboo.ali
-rw-rwxr--@ 1 padde admin 1239 3 Jun 18:01 s-valcha.ali
-rw-rwxr--@ 1 padde admin 1309 3 Jun 18:01 s-valdec.ali
-rw-rwxr--@ 1 padde admin 2921 3 Jun 18:01 s-valenu.ali
-rw-rwxr--@ 1 padde admin 1733 3 Jun 18:01 s-valint.ali
-rw-rwxr--@ 1 padde admin 1345 3 Jun 18:01 s-vallld.ali
-rw-rwxr--@ 1 padde admin 1807 3 Jun 18:01 s-vallli.ali
-rw-rwxr--@ 1 padde admin 3841 3 Jun 18:01 s-valrea.ali
-rw-rwxr--@ 1 padde admin 3078 3 Jun 18:01 s-valuns.ali
-rw-rwxr--@ 1 padde admin 2863 3 Jun 18:01 s-valwch.ali
-rw-rwxr--@ 1 padde admin 2157 3 Jun 18:01 s-veboop.ali
-rw-rwxr--@ 1 padde admin 535 3 Jun 18:01 s-vector.ali
-rw-rwxr--@ 1 padde admin 1153 3 Jun 18:01 s-vercon.ali
-rw-rwxr--@ 1 padde admin 3305 3 Jun 18:01 s-vmexta.ali
-rw-rwxr--@ 1 padde admin 2474 3 Jun 18:01 s-wchwts.ali
-rw-rwxr--@ 1 padde admin 698 3 Jun 18:01 s-widboo.ali
-rw-rwxr--@ 1 padde admin 939 3 Jun 18:01 s-widcha.ali
-rw-rwxr--@ 1 padde admin 2526 3 Jun 18:01 s-widenu.ali
-rw-rwxr--@ 1 padde admin 863 3 Jun 18:01 s-widlli.ali
-rw-rwxr--@ 1 padde admin 1126 3 Jun 18:01 s-widllu.ali
-rw-rwxr--@ 1 padde admin 1292 3 Jun 18:01 s-widwch.ali
-rw-rwxr--@ 1 padde admin 1301 3 Jun 18:01 s-wwdcha.ali
-rw-rwxr--@ 1 padde admin 5682 3 Jun 18:01 s-wwdenu.ali
-rw-rwxr--@ 1 padde admin 1957 3 Jun 18:01 s-wwdwch.ali
-rw-rwxr--@ 1 padde admin 1561 3 Jun 18:01 sequenio.ali
-rw-rwxr--@ 1 padde admin 1519 3 Jun 18:01 text_io.ali
-rw-rwxr--@ 1 padde admin 391 3 Jun 18:01 unchconv.ali
-rw-rwxr--@ 1 padde admin 389 3 Jun 18:01 unchdeal.ali
Interestingly, the requested file s-stalib.ali
is not contained in this directory.
回答1:
If you say gnatls -v
(or gnat list -v
), it lists (amongst other things) the object search path: here,
...
Object Search Path:
<Current_Directory>
/opt/gnat-gpl-2013/lib/gcc/x86_64-apple-darwin12.2.0/4.7.4/adalib/
...
What does yours say? is it right? if the files are there, are they readable?
[Later]
OK, you have 9 s-s*.ali
files, with protection -rw-rwxr--@
(I'm not sure what the @
means!), whereas I have 19, with protection -r--r--r--@
. This looks as though the installation didn't complete for some reason.
When I install GNAT, I use sudo
: sudo ./doinstall
. Could that be the difference?
The README says that doinstall
leaves install.log
in the current (distribution, I suppose) directory; that might give some clues.
If you do decide to rebuild the library, it's be best to use Makefile.adalib
in the "installed" adalib/
directory.
Good luck!
来源:https://stackoverflow.com/questions/19596211/gnatbind-cannot-find-s-stalib-ali