Does anyone know how to get the Eclipse C++ (2019-05 on CentOS 7) console to recognize the icpc command for Makefile Projects?
I recently downloaded Intel Parallel Studio XE 2019 update 5 from  and completed an "offline" installation following section 3.2 of the Intel Parallel Studio XE 2019 Update 4 Installation Guide for Linux OS  using a trial license. I then followed the tutorial in  to integrate the Intel compiler into Eclipse. I was then able to create a "Hello World" C++ Project through the Eclipse New Project Wizard and it compiled as expected. Unfortunately, when I changed my compiler from "g++" to "icpc" in an existing makefile project (I typically work with makefile projects), I received the following error in the Eclipse console:
"make: icpc: Command not found".
I also realized I couldn't use make from a bash terminal unless I used the compilervars.sh script as explained in . Even after using the compilervars.sh script, I was still unable to use Eclipse to build the project; which I think is expected since the script seems to set the environment variable only for the bash terminal it is used in.
Has anyone had success using Makefile Projects in Eclipse with the Intel C++ Compiler or know how to get the icpc command recognized globally on CentOS 7?
I was able to find that I could have the compilervars.sh script called by altering ~/.bashrc or /etc/profiles.d and, following the explanation in , I decided to use the latter approach by adding a symbolic link to compilervars.sh in /etc/profile.d so that the compilervars.sh script would be called at the startup of bash. This approach initially caused an error since the compilervars.sh script expects an argument to be passed. As such, I added a line in the compilervars.sh script to set the required argument if it was not passed. This solution seems to work as I am able to use makefile projects in Eclipse and from a bash shell without having to set the environment variables. Unfortunately, this solution is less elegant than I would like since I had to alter the compilervars.sh script (which means the solution will need to be repeated for updates). Does anyone know if there is a more elegant solution available?