Chris Dolopikos
Chris Dolopikos

Reputation: 3

Gnatmake compilation error after compiling .adb on Mac os

I just installed the AdaCore community compiler the dwarvin version (gnat-community-2018-20180523-arm-elf-darwin-bin.dmg), with the GPS. Using the respective installer from adacore. I also managed to add on my starting script the path of gnat. Till here everything works fine, gnat --version return the appriate version etc.

But when I want to compile a .adb file using gnatmake filename.adb

user$ gnatmake filename.adb

gcc -c filename.adb
gcc: error trying to exec 'gnat1': execvp: No such file or directory
gnatmake: "filename.adb" compilation error

And even after using gnatmake -c filename.adb I get

gcc -c filname.adb
gcc: error trying to exec 'gnat1': execvp: No such file or directory
gnatmake: "filename.adb" compilation error

I asked my professor for help he said use the VM provided (for Windows) I just want to avoid using a VM. Please help me resolve this error.

After running the following command gnatmake filname.adb -cargs -c the following came up.

gcc -c -v filename.adb
Using built-in specs.
COLLECT_GCC=/opt/gps//bin/gcc
Target: x86_64-apple-darwin16.7.0
Configured with: ../src/configure --enable-languages=ada,c,c++,objc --enable-lto --with-stage1-ldflags=-static-libstdc++ --with-boot-ldflags=-static-libstdc++ --disable-libcilkrts --with-bugurl=URL:mailto:[email protected] --disable-nls --without-libiconv-prefix --disable-libstdcxx-pch --disable-libada --enable-checking=release --disable-multilib --with-mpfr=/gnatmail/sandbox/community/x86_64-darwin/mpfr_stable-c/install --with-gmp=/gnatmail/sandbox/community/x86_64-darwin/gmp_stable-c/install --with-mpc=/gnatmail/sandbox/community/x86_64-darwin/mpc_stable-c/install --with-build-time-tools=/gnatmail/sandbox/community/x86_64-darwin/gcc_current-c/build/buildtools/bin --prefix=/gnatmail/sandbox/community/x86_64-darwin/gcc_current-c/pkg --build=x86_64-apple-darwin16.7.0
Thread model: posix
gcc version 7.3.1 20180524 (for GNAT Community 2018 20180523) (GCC) 
COLLECT_GCC_OPTIONS='-gnatea' '-c' '-v' '-gnatez' '-mtune=core2' '-mmacosx-version-min=10.14.2'
 gnat1 -quiet -dumpbase filename.adb -auxbase filename -gnatez -gnatea -gnatez -mtune=core2 -mmacosx-version-min=10.14.2 -fPIC filename.adb -o /var/folders/9r/52d5kqc906v4phl9jgjrxdlr0000gn/T//ccQlDd19.s
gcc: error trying to exec 'gnat1': execvp: No such file or directory
gnatmake: "filename.adb" compilation error

Upvotes: 0

Views: 1105

Answers (1)

Simon Wright
Simon Wright

Reputation: 25491

Now we can see how the compiler complains (thanks for the update in the question), it looks as though you have an installation problem.

Here, I get (edited down to remove the less significant parts)

[...]
COLLECT_GCC=/opt/gnat-ce-2018//bin/gcc

You have /opt/gps//bin/gcc, so your "prefix" (under which the installation is to be found) is /opt/gps, where mine is /opt/gnat-ce-2018 (I don’t know why there are two slashes there, doesn’t seem to matter). Then,

[...]
 /opt/gnat-ce-2018/bin/../libexec/gcc/x86_64-apple-darwin16.7.0/7.3.1/gnat1 -quiet -dumpbase [...]

where you just have gnat1. So, you should have a file /opt/gps/libexec/gcc/x86_64-apple-darwin16.7.0/7.3.1/gnat1, and it should be executable.

I’d try reinstalling.

Upvotes: 1

Related Questions