User forums > Using Code::Blocks
Intel fortran compiler: command line error: option '/g' is ambiguous
(1/1)
llama:
I am running Code::Blocks version svn11210 on windows 7 64bit. The compiler I use is Intel Fortran 18 update 1
When I ...
Try to compile a hello world (which compiles fine in the command line), it fails with the following errors
Build log:
--- Code: ----------------- Clean: Debug in Testing (compiler: Intel Fortran Compiler for Windows)---------------
Cleaned "Testing - Debug"
-------------- Build: Debug in Testing (compiler: Intel Fortran Compiler for Windows)---------------
ifort.exe /nologo -Wall -g /Qopenmp /O2 /module:obj\Debug\ /c main.f90 /object:obj\Debug\main.obj
ifort.exe /nologo /exe:bin\Debug\Testing.exe obj\Debug\main.obj /Qopenmp
ifort: command line warning #10157: ignoring option '/W'; argument is of wrong type
ifort: command line error: option '/g' is ambiguous
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 1 warning(s) (0 minute(s), 0 second(s))
--- End code ---
It seems that it is passing arguments to ifort with -arg syntax when it wants /arg only, but I can't figure out where these originate from (I've looked through the compiler options for anything weird). If I switch the project to gfortran, it compiles and runs fine. To make ifort work I'm running CB from the following .bat file to set up environment variables:
--- Code: ---call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.1.156\windows\bin\ifortvars.bat" -arch intel64
call "C:\Program Files (x86)\CodeBlocks\codeblocks.exe"
--- End code ---
BlueHazzard:
have you searched in Project->Build Options->Compiler options and Additional compiler options?
llama:
--- Quote from: BlueHazzard on November 30, 2017, 08:54:25 am ---have you searched in Project->Build Options->Compiler options and Additional compiler options?
--- End quote ---
Aha! I'm still not sure where the -Wall comes from, but that's the source of the -g, and getting rid of that fixes things. Thanks!
I would like to know where -Wall comes from though... I found the linker adding -s in release mode and removed that, but -Wall is still a mystery
oBFusCATed:
Probably it is in Project -> Build options -> click on the root of the tree on the left -> Compiler options.
llama:
Indeed it is. Thank you
Navigation
[0] Message Index
Go to full version