Author Topic: Intel fortran compiler: command line error: option '/g' is ambiguous  (Read 6032 times)

Offline llama

  • Single posting newcomer
  • *
  • Posts: 3
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))

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"

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Intel fortran compiler: command line error: option '/g' is ambiguous
« Reply #1 on: November 30, 2017, 08:54:25 am »
have you searched in Project->Build Options->Compiler options and Additional compiler options?

Offline llama

  • Single posting newcomer
  • *
  • Posts: 3
Re: Intel fortran compiler: command line error: option '/g' is ambiguous
« Reply #2 on: November 30, 2017, 07:38:02 pm »
have you searched in Project->Build Options->Compiler options and Additional compiler options?

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
« Last Edit: November 30, 2017, 08:09:12 pm by llama »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Intel fortran compiler: command line error: option '/g' is ambiguous
« Reply #3 on: November 30, 2017, 08:12:23 pm »
Probably it is in Project -> Build options -> click on the root of the tree on the left -> Compiler options.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline llama

  • Single posting newcomer
  • *
  • Posts: 3
Re: Intel fortran compiler: command line error: option '/g' is ambiguous
« Reply #4 on: November 30, 2017, 08:40:33 pm »
Indeed it is. Thank you