更新GPS Community Edition 2019 IDE的编译器 [英] Updating the Compiler for the GPS Community Edition 2019 IDE

查看:279
本文介绍了更新GPS Community Edition 2019 IDE的编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始从事一个项目,要求我的编译器必须高于GNAT 4.8.5-当我进入:帮助>关于

I've recently started working on a project that requires my complier to be above GNAT 4.8.5 - When I go to: Help > About

您可以看到我使用的版本是4.8.5

You can see that the version I'm using is 4.8.5

另外,当我运行gnatls -v命令时,我可以看到这个...

Also, when I run the gnatls -v command, I can see this...

[parallels@localhost ~]$ gnatls -v

GNATLS 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 1997-2013, Free Software Foundation, Inc.

Source Search Path:
   <Current_Directory>
   /usr/lib/gcc/x86_64-redhat-linux/4.8.5/adainclude/


Object Search Path:
   <Current_Directory>
   /usr/lib/gcc/x86_64-redhat-linux/4.8.5/adalib/


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

[parallels@localhost ~]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --disable-multilib --enable-languages=c,c++,ada
Thread model: posix
gcc version 7.3.0 (GCC) 
[parallels@localhost ~]$ 

请有人能告诉我如何更新我的GNAT编译器吗?另外,我正在使用Centos 7操作系统.

Please could someone be able to tell me how to update my GNAT compiler? Also, I'm using the Centos 7 Operating System.

谢谢

劳埃德

推荐答案

您不需要安装编译器,您已经拥有3个(至少):

You don't need to install a compiler, you already have 3 (at least):

    /usr/bin 中的
  • gcc 4.8.5(系统编译器) 在/usr/local/bin
  • 中创建的
  • gcc 7.3.0(您刚刚构建的) /home/parallels/opt/GNAT/2019/bin中的
  • gcc 8.3.1(来自GNAT CE 2019)
  • gcc 4.8.5 (the system compiler) in /usr/bin
  • gcc 7.3.0 (that you just built) in /usr/local/bin
  • gcc 8.3.1 (from GNAT CE 2019) in /home/parallels/opt/GNAT/2019/bin

您的 PATH确定仅说gcc时选择的GCC,以及说gnatls,..等时选择的GNATLS.

Your PATH determines which GCC you pick up when you say just gcc, and which GNATLS you pick up when you say just gnatls, .. etc.

根据上一篇文章,您的PATH是:

According to a previous post, your PATH is:

$ echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/var/lib/snapd/snap/bin:/home/parallels/.local/bin:/home/parallels/bin/home/parallels/opt/GNAT/2019/bin/home/parallels/opt/GNAT/2019/bin

因此,当您只说gcc时,系统会查看PATH中的第一个条目(以冒号分隔),然后就出现了.所以它执行了.

so when you say just gcc the system looks at the first entry in the PATH (which is colon-separated) and .. there it is! so it executes that.

如果您在Ada支持下构建了7.3.0 GCC,它将在同一位置找到gnatl.我非常怀疑您没有这样做,因此当您说只是gnatls时,系统在/usr/local/bin中显示-没有运气-在/usr/local/sbin中显示-没有运气-然后在/usr/bin中显示-哎呀!但这就是您不想要的4.8.5 GCC.

If you'd built your 7.3.0 GCC with Ada support, it would have found gnatls in the same place. I have a very strong suspicion that you didn't, so when you say just gnatls the system looks in /usr/local/bin - no luck - then in /usr/local/sbin - no luck - then in /usr/bin - whoopee! but that's the 4.8.5 GCC that you don't want.

再次查看您的PATH,最后一部分被弄乱了-您添加了/home/parallels/bin/home/parallels/opt/GNAT/2019/bin(两次),但不包括冒号分隔符,导致路径不存在. (/home/parallels/bin可能是系统添加的-我假设/home/parallels是您的主目录).

Looking again at your PATH, the last part is mangled - you've added /home/parallels/bin and /home/parallels/opt/GNAT/2019/bin (twice) without including the colon separators, resulting in a nonexistent path. (/home/parallels/bin may well have been added by the system - I assume that /home/parallels is your home directory).

您需要做的是通过将放在PATH中的位置第一,来确保您选择了GNAT CE 2019随附的编译器.一种方法是编辑外壳启动文件.

What you need to do is to make sure that you pick up the compiler that came with GNAT CE 2019 by putting its location first in your PATH. One way of doing this is by editing your shell startup files.

我不知道CENTOS如何设置帐户,也不知道您的外壳是什么.假设它是bash(类型为ps -p $$,应该与bash-bash一起返回;我无能为力),您需要编辑其中一个shell启动文件-我有点尚不清楚,但是我认为它将是~/.bashrc(~是您的主目录的简写);请参阅此处以获取详细信息.找到最后一个提及PATH并在该行之后立即插入

I don't know how CENTOS sets accounts up, and I don't know what your shell is. Assuming it's bash (type ps -p $$, should come back with bash or perhaps -bash; anything else, I can't help), you need to edit one of the shell startup files - I'm a little unclear about this, but I think it'll be ~/.bashrc (~ is shorthand for your home directory); see here for the gory details. Find the last mention of PATH and immediately after that line insert

export PATH=/home/parallels/opt/GNAT/2019/bin:$PATH

打开一个新的终端窗口,然后说gnatls -v-您应该选择GNAT CE 2019之一.

Open a new terminal window and say e.g. gnatls -v - you should pick up the GNAT CE 2019 one.

这篇关于更新GPS Community Edition 2019 IDE的编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆