Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Intel Fortran compiler #78

Open
soraoka opened this issue Jul 28, 2021 · 9 comments
Open

Add support for Intel Fortran compiler #78

soraoka opened this issue Jul 28, 2021 · 9 comments

Comments

@soraoka
Copy link

soraoka commented Jul 28, 2021

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
Copy link

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
Copy link
Author

soraoka commented Jul 28, 2021 via email

@Leonard-Reuter
Copy link

@soraoka I can't see the attachements, if you answer via mail and attach them. you have to upload them here: #78

@soraoka
Copy link
Author

soraoka commented Jul 28, 2021

clionscreenshot

@Leonard-Reuter
Copy link

Leonard-Reuter commented Jul 28, 2021

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

@soraoka
Copy link
Author

soraoka commented Jul 28, 2021

"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
Copy link
Owner

satamas commented Jul 29, 2021

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
Copy link
Author

soraoka commented Aug 3, 2021

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

@smoothdeveloper
Copy link

An update here, in https://youtrack.jetbrains.com/issue/CPP-42977 it came that to use clion / fortran plugin with intel fortran compiler on windows, it is required to specify a toolchain script that invokes "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 vs2022.

The issue that remains is that the debugging doesn't seem to pick up any breakpoint, I was wondering if there was any way to diagnose it and if any people using this plugin with intel compiler, disregarding the platform, could confirm wether debugging works or not?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants