oneAPI Registration, Download, Licensing and Installation
Support for Getting Started questions related to download, Installation and licensing for Intel oneAPI Toolkits and software development tools.

Using Fortran Compiler in oneAPI

zliu7
Beginner
1,659 Views

Hello,

I am the student and i need to use fortran to run some of my codes, but i can not find a place to open the fortran compiler. Can you pls suggest me a way to open the compiler? Thank you.

( I have already installed the HPC tool kits)

0 Kudos
5 Replies
zliu7
Beginner
1,653 Views

I alredy had my .f code written with notepad, now i just wan to bring them into a folder and using the command window to run.

0 Kudos
RahulV_intel
Moderator
1,642 Views

Hi,


Firstly, you need to source the oneAPI environment.


On Linux:

source /opt/intel/oneapi/setvars.sh


On Windows:

  • Open Intel oneAPI command prompt for Visual Studio which will automatically source the oneAPI environment.
  • Alternatively, you may source the setvars.bat file directly from the command prompt.

"C:\Program Files (x86)\Intel\oneAPI\setvars.bat"


Compiler path:

ifort: C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\bin\intel64

ifx: C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\bin


The Intel® Fortran Compiler Classic (ifort driver) in the Intel® oneAPI HPC Toolkit includes a full implementation of the Fortran 2018 standard. 


The Intel® Fortran Compiler (Beta) (ifx driver) is also included in the Intel® oneAPI HPC Toolkit. The Intel® Fortran Compiler (Beta) (ifx) is a new compiler based on the Intel® Fortran Compiler Classic (ifort) frontend and runtime libraries, using LLVM backend technology.


To compile:

ifort filename

ifx filename


More information here:

https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-fortran-compiler-release-notes.html


Thanks,

Rahul


zliu7
Beginner
1,625 Views

Thank you very much Rahul! But when i followed the instruction, i wasn't sure which one is the "Intel oneAPI command prompt for Visual Studio", so i went with the alternative approach, but it showed me the error message in the pic, i didnt install my visual studio in the drive C, is there a way i can redirect the setvars.bat file to the directory where i installed my visual studio? Thank you.

zliu7_0-1614030102307.png

zliu7_1-1614030279430.png

 

 

0 Kudos
RahulV_intel
Moderator
1,573 Views

Hi,


Apologies for the late response.

It looks like your Visual Studio has not been integrated with the oneAPI during installation.


Since your issue is related to installation, we are redirecting your query to the oneAPI installer forum (https://community.intel.com/t5/Registration-Download-Licensing/bd-p/registration-download-licensing-instal).


Thanks,

Rahul


0 Kudos
Soumya_M_Intel
Moderator
1,555 Views

Hi Zhibo,


Based on the information, I would suggest you go through the below steps:

 

·      Make sure that Visual Studio 2019 is installed first with appropriate component selection and then Intel® oneAPI Toolkit has been installed.

 

·      For Intel® Compilers for Windows*, it is necessary to install the Desktop development with C++ component from Visual Studio. This component is not installed by default.

 

However, if the issue persists, kindly get back to me here with:


·      a screenshot of the 'About' from the Help section of the Visual Studio and

·      the build number of Visual Studio 2019 in use


Looking forward to your findings.


Regards,

Soumya


0 Kudos
Reply