satamas / fortran-plugin

Fortran language plugin for IntelliJ Idea
Apache License 2.0
80 stars 18 forks source link

Add support for Intel Fortran compiler #78

Open soraoka opened 3 years ago

soraoka commented 3 years ago

I cannot seem to get CLion's Fortran plugin to work with the Intel Fortran compiler. I only tried on Windows, but will need it to work on Linux also. It only needs to call iFort.exe (or ifx.exe). The current (as of 7/28/2021) Intel Fortran compiler is in the OneAPI package. MS Visual Studio 2019 integrates with it just fine. I wanted to use CLion to step thru C code and into Fortran code. I got the following message from a CLion developer: Hi Tom!

I consulted with the developer of the Fortran plugin. The Intel compiler for Fortran is integrated only with Visual Studio and therefore works only in Visual Studio or in CLI which takes all that is needed from VS. It seems CMake doesn't fully support this compiler. Hence the Fortran plugin doesn't work with it. Feel free to create a feature request in the plugin tracker - https://github.com/satamas/fortran-plugin/issues.

Best regards, Anna Falevskaya JetBrains http://www.jetbrains.com The Drive to Develop

Leonard-Reuter commented 3 years ago

I regularly use the Fortran intel compiler with cmake (and the clion plugin) without any issue. What exactly is not working?

In any case, in principle, your problem is not really related to Clion or the fortran plugin but to cmake. Did you try building your cmake project from the command line? Clion does nothing but calling cmake for you, which is independent of the compiler etc.

Best Leonard

soraoka commented 3 years ago

Hey Leonard,

Thanks for replying so quickly.  I think the main problem is my
ignorance.  I'm a very senior java developer assigned to build
C/Fortran libraries. :-)

Attached is a screenshot of my hello world fortran app, CMakeLists.txt
file and build output that shows "failed".

Tom

Quoting Leonard Reuter @.***>:

 

I regularly use the Fortran intel compiler with cmake (and the
clion plugin) without any issue. What exactly is not working?

In any case, in principle, your problem is not really related to
Clion or the fortran plugin but to cmake. Did you try building your
cmake project from the command line? Clion does nothing but calling
cmake for you, which is independent of the compiler etc.

Best Leonard

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub[1], or unsubscribe[2].

Links:

[1] https://github.com/satamas/fortran-plugin/issues/78#issuecomment-888372297 [2]
https://github.com/notifications/unsubscribe-auth/ADZNEZSQMUD44H5C4R7NQTTT2AKC5ANCNFSM5BEN2V5A

Leonard-Reuter commented 3 years ago

@soraoka I can't see the attachements, if you answer via mail and attach them. you have to upload them here: https://github.com/satamas/fortran-plugin/issues/78

soraoka commented 3 years ago

clionscreenshot

Leonard-Reuter commented 3 years ago

can you scroll further down to the error message? you can also copy-paste the text.

soraoka commented 3 years ago

"C:\Program Files\JetBrains\CLion 2021.2\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_DEPENDS_USE_COMPILER=FALSE -G "CodeBlocks - NMake Makefiles" C:\Users\tom.soraoka\CLionProjects\untitled3 -- The Fortran compiler identification is unknown Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.1 Build 20201112_000000 Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

-- Detecting Fortran compiler ABI info -- Detecting Fortran compiler ABI info - failed -- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/2021.1.1/windows/bin/intel64/ifort.exe -- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/2021.1.1/windows/bin/intel64/ifort.exe - broken CMake Error at C:/Program Files/JetBrains/CLion 2021.2/bin/cmake/win/share/cmake-3.20/Modules/CMakeTestFortranCompiler.cmake:51 (message): The Fortran compiler

"C:/Program Files (x86)/Intel/oneAPI/compiler/2021.1.1/windows/bin/intel64/ifort.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/Users/tom.soraoka/CLionProjects/untitled3/cmake-build-debug/CMakeFiles/CMakeTmp

Run Build Command(s):nmake -f Makefile /nologo cmTC_6a86c\fast &&   "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x86\nmake.exe"  -f CMakeFiles\cmTC_6a86c.dir\build.make /nologo -L                  CMakeFiles\cmTC_6a86c.dir\build
Building Fortran object CMakeFiles/cmTC_6a86c.dir/testFortranCompiler.f.obj
    C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\intel64\ifort.exe    -c C:\Users\tom.soraoka\CLionProjects\untitled3\cmake-build-debug\CMakeFiles\CMakeTmp\testFortranCompiler.f -o CMakeFiles\cmTC_6a86c.dir\testFortranCompiler.f.obj
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.1 Build 20201112_000000
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.

Linking Fortran executable cmTC_6a86c.exe
    C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\intel64\ifort.exe "CMakeFiles\cmTC_6a86c.dir\testFortranCompiler.f.obj"  -o cmTC_6a86c.exe
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.1 Build 20201112_000000
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 14.29.30038.1
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:cmTC_6a86c.exe 
-subsystem:console 
CMakeFiles\cmTC_6a86c.dir\testFortranCompiler.f.obj 
LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'
NMAKE : fatal error U1077: 'C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\intel64\ifort.exe' : return code '0x450'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred! See also "C:/Users/tom.soraoka/CLionProjects/untitled3/cmake-build-debug/CMakeFiles/CMakeOutput.log". See also "C:/Users/tom.soraoka/CLionProjects/untitled3/cmake-build-debug/CMakeFiles/CMakeError.log".

[Finished]

satamas commented 3 years ago

I only tried on Windows but will need it to work on Linux also

If it's an option I would suggest trying it on Linux first. On Windows, the Intel compiler requires MS build tools and it's hard to use them separately. It should be easier on Linux

Regarding the issue, I'll take a look at what can be done on Windows

soraoka commented 3 years ago

Thank you. I have a centos 7 box I can try it on.