Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Eclipse C++ Makefile Project icpc Command Not Found

Patterson__Jesse
Beginner
2,323 Views

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 [1] and completed an "offline" installation following section 3.2 of the Intel Parallel Studio XE 2019 Update 4 Installation Guide for Linux OS [2] using a trial license. I then followed the tutorial in [3] 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 [4]. 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?

 

References:

  1. https://software.seek.intel.com/ps-l
  2. https://software.intel.com/en-us/download/parallel-studio-xe-2019-install-guide-linux
  3. https://software.intel.com/en-us/get-started-with-cpp-compiler-19.0-for-linux-parallel-studio-xe-2019
  4. https://software.intel.com/en-us/articles/setting-up-the-build-environment-for-using-intel-c-or-fortran-compilers
0 Kudos
3 Replies
Viet_H_Intel
Moderator
2,324 Views

I wonder what Eclipse version you had on your system?

0 Kudos
Patterson__Jesse
Beginner
2,324 Views

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 [1], 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?

1. https://unix.stackexchange.com/questions/64258/what-do-the-scripts-in-etc-profile-d-do

0 Kudos
Reply