This is honestly so confusing and I really appreciate you guys helping out with it.
This is what I received as output when I ran setvars in the Pycharm terminal:
PS C:\Program Files (x86)\Intel\oneAPI> .\setvars.bat
:: initializing oneAPI environment...
initializing Visual Studio command-line environment...
Visual Studio version 16.5.5 environment configured.
Visual Studio environment initialized for: 'x64'
: advisor -- latest
: compiler -- latest
: dal -- latest
: debugger -- latest
: dev-utilities -- latest
: dnnl -- latest
: dpcpp-ct -- latest
: inspector -- latest
: intelpython -- latest
: ipp -- latest
: ippcp -- latest
: itac -- latest
: mkl -- latest
: mpi -- latest
: tbb -- latest
: vpl -- latest
: vtune -- latest
:: oneAPI environment initialized ::
I cd
'd back to the directory with my fortran file, and ran the command
f2py -c -m fortranfile fortranfile.f90
which resulted in
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
customize MSVCCompiler using build_ext
get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
customize GnuFCompiler
Could not locate executable g77
Could not locate executable f77
customize IntelVisualFCompiler
Could not locate executable ifort
Could not locate executable ifl
customize AbsoftFCompiler
Could not locate executable f90
customize CompaqVisualFCompiler
Could not locate executable DF
customize IntelItaniumVisualFCompiler
Could not locate executable efl
customize Gnu95FCompiler
Could not locate executable gfortran
Could not locate executable f95
customize G95FCompiler
customize IntelEM64VisualFCompiler
customize IntelEM64TFCompiler
Could not locate executable efort
Could not locate executable efc
customize PGroupFlangCompiler
Could not locate executable flang
don't know how to compile Fortran code on platform 'nt'
warning: build_ext: f77_compiler=None is not available.
building 'fortran' extension
error: extension 'fortranfile' has Fortran sources but no Fortran compiler found
The numpy.distutils._msvccompiler module being missing is a recurring error but I am not sure if it would affect this at all. Would I need to move my Fortran files into the folder with ifort.exe or ifc.exe? I really don’t know if this would even be possible but I am grasping at straws…
I actually tried running the command
f2py -c --fcompiler=intel --compiler=Pycharm C:\Users\user\project\fortranfile.f90
but it said that it didn’t know how to compile C/C++ code on platform ‘nt’ with Pycharm compiler.
Another thing, I was reading through f2py help and I noticed two things that I had missed. One of the options is
--include-paths <path1>:<path2>:... Search include files from the given directories.
I have not completely read through the code in the Fortran files that I am trying to compile (I didn’t write them), so is it possible that there are includes that must be noted? Unfortunately I can’t post the source code, but I can edit it (NDA).
The other thing I noticed was the note at the bottom of the help log that said
Using the following macros may be required with non-gcc Fortran
compilers:
-DPREPEND_FORTRAN -DNO_APPEND_FORTRAN -DUPPERCASE_FORTRAN
-DUNDERSCORE_G77
Lastly, sorry for the info dump, I am currently working in Pycharm, and I just took another look at the Intel website and it says
"Development Environment Flexibility
Use the compiler in command line or in a supported IDE:
- Microsoft Visual Studio* (Windows* only)
- Eclipse* C/C++ Development Tooling (CDT) (Linux* only)
- Xcode (macOS* and Intel Fortran Compiler Classic only)"
… Maybe I will just have to try to get my project into Visual Studio.