Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
201 Views

visual studio 2017 output code 1 but no error description

Jump to solution

I am using IVF 2017 update 8 (must use this version to be compatible integration with commercial software) using VS 2017. 15.9.27. When I compile in VS and the code has an error, I get 'compilation aborted for <filename> (code 1)' but no error description or link in the output window. I can't figure out what is configured wrong. Any suggestions? The link to the build log similarly shows the same line without explanation.

The build log shows this statement:

ifort /nologo /debug:full /Od /fpp /I"C:\Users\lira\Documents\repos\wertheim\aspen" /Qdiag-file /Qdiag-file:"x64\Debug\Aspen IntActiveDebug.diag" /warn:all /module:"x64\Debug\\" /object:"x64\Debug\\" /Fd"x64\Debug\vc150.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\\bin\amd64" /Qm64 "C:\Users\lira\Documents\repos\wertheim\commoncalc\src\gcalc.f90"

 

0 Kudos

Accepted Solutions
Highlighted
Novice
103 Views

Thanks. I found that I needed to set

Fortran>Diagnostics>Emit Diagnostics to File>No

Mine was blank but it was still writing to the file. Anyway, this worked!

View solution in original post

0 Kudos
9 Replies
Highlighted
Black Belt Retired Employee
174 Views

This is usually a symptom of an internal compiler error. Try compiling from the command prompt, using the same command line as in the build log, and see what you get.

I don't buy that you are stuck using an old version just because the third-party vendor hasn't bothered to test with a newer version.

0 Kudos
Highlighted
Black Belt
162 Views

CarlinMi, your report indicates that an error occurred during compilation of gcalc.f90, and that the process was terminated before any linking was attempted. Thus, many of the command line portions may be irrelevant, and it may be revealing to try the following commands directly from an IFort command window, instead of through Visual Studio:

ifort /Od /c gcalc.f90

ifort /Od /c /fpp /I"C:\Users\lira\Documents\repos\wertheim\aspen" gcalc.f90

If the first command succeeds, the second one need not be tried.

You may use any version of the IFort compiler that was released during the years after the release date of your version of Aspen, possibly earlier versions as well.

0 Kudos
Highlighted
Novice
151 Views

Thanks so much.

1) I am able to compile from the command line. I should have said that initially. That is how I currently find errors. I do need to remove some of the command options and add an include to an additional directory:

For example, here with an intentional typo in a variable name (pointer does not line up with eta_mix1):

C:\Users\lira\Documents\repos\wertheim\commoncalc\src>ifort /nologo /debug:full /Od /fpp /I"C:\Users\lira\Documents\repos\wertheim\aspen" /I"C:\Users\lira\Documents\repos\wertheim\util\src" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qm64 "C:\Users\lira\Documents\repos\wertheim\commoncalc\src\gcalc.f90"
C:\Users\lira\Documents\repos\wertheim\commoncalc\src/gcalc.f90(44): error #6404: This name does not have a type, and must have an explicit type. [ETA_MIX1]
eta_mix1 = DOT_PRODUCT(bvol, comp%x) * rho_mix
----------------^
compilation aborted for C:\Users\lira\Documents\repos\wertheim\commoncalc\src\gcalc.f90 (code 1)

  However, when I try to compile from visual studio, I don't get the error diagnostic, only the aborted message:

Compiling with Intel(R) Visual Fortran Compiler 17.0.8.275 [Intel(R) 64]...
gcalc.f90
ifort: command line warning #10287: the previously set diagnostic file output option is being overridden by '/Qdiag-file:x64\Debug\Aspen IntActiveDebug.diag'
compilation aborted for C:\Users\lira\Documents\repos\wertheim\commoncalc\src\gcalc.f90 (code 1)

Build log written to "file://C:\Users\lira\Documents\Visual%20Studio%202017\Aspen%20Fortran%20Solutions\x64\Debug\BuildLog.htm"
Aspen IntActiveDebug - 1 error(s), 1 warning(s)

and when I open the Build log link it also does not have the error information:

Compiling with Intel(R) Visual Fortran Compiler 17.0.8.275 [Intel(R) 64]...
ifort /nologo /debug:full /Od /fpp /I"C:\Users\lira\Documents\repos\wertheim\aspen" /I"C:\Users\lira\Documents\repos\wertheim\util\src" /Qdiag-file /Qdiag-file:"x64\Debug\Aspen IntActiveDebug.diag" /warn:all /module:"x64\Debug\\" /object:"x64\Debug\\" /Fd"x64\Debug\vc150.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\\bin\amd64" /Qm64 "C:\Users\lira\Documents\repos\wertheim\commoncalc\src\gcalc.f90"
ifort: command line warning #10287: the previously set diagnostic file output option is being overridden by '/Qdiag-file:x64\Debug\Aspen IntActiveDebug.diag'
compilation aborted for C:\Users\lira\Documents\repos\wertheim\commoncalc\src\gcalc.f90 (code 1)

Aspen IntActiveDebug - 1 error(s), 1 warning(s)

If I try to put the visual studio command into the IVF command line:

C:\Users\lira\Documents\repos\wertheim\commoncalc\src>ifort /nologo /debug:full /Od /fpp /I"C:\Users\lira\Documents\repos\wertheim\aspen" /I"C:\Users\lira\Documents\repos\wertheim\util\src" /Qdiag-file /Qdiag-file:"x64\Debug\Aspen IntActiveDebug.diag" /warn:all /module:"x64\Debug\\" /object:"x64\Debug\\" /Fd"x64\Debug\vc150.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\\bin\amd64" /Qm64 "C:\Users\lira\Documents\repos\wertheim\commoncalc\src\gcalc.f90"
ifort: command line warning #10287: the previously set diagnostic file output option is being overridden by '/Qdiag-file:x64\Debug\Aspen IntActiveDebug.diag'
error #13008: could not open file 'g' for diagnostic output, reverting to stderr
ifort: error #10142: directory 'x64\Debug\' does not exist

With regard to using the newer compiler, I tried for about 8 weeks off and on with a case at Intel and also the commercial company and neither could help me figure out the issue. I need to create a .dll that runs under their code using a script that they provide and perhaps their script is not compatible with IVF 2019. The .dll would compile, but the code would not run. It finally would run when I switched back to IVF 2017 which is the compiler used for their code.  And in the course of frustration, I also reverted from Visual Studio 2019 to Visual Studio 2017. I think that something is messed up in the paths or the permissions for the Intel integration to VS.

0 Kudos
Highlighted
Novice
149 Views

Thanks much. Sorry I forgot to say that command line compiling works and I currently use that to create successful compiled code that I can use in the VS GUI for debugging.

I am trying to solve the inconvenience of command line compiling to find errors and switching back and forth between the command line and VS GUI.

0 Kudos
Highlighted
Novice
146 Views

After some digging, I see that the diagnostics ARE being written to the VS work directory <solution folder>/x64/Debug/<solution name>.diag

Visual Studio is just failing to display that file upon the compile error. Any suggestions to get VS to read/display that file?

0 Kudos
Highlighted
Novice
140 Views

I notice that visual studio is generating the /Qdiag-file twice. The command line that VS generates contains

/Qdiag-file /Qdiag-file:"x64\Debug\Aspen IntActiveDebug.diag"

 

0 Kudos
Highlighted
Black Belt Retired Employee
130 Views

I have never seen /Qdiag-file in the VS-generated command line. Please check your compiler options, and in particular the Fortran > Command Line property page, to see where this is coming from.

Highlighted
Black Belt
122 Views

Each /Qdiag-file option overrides the previous one.

Why incur the complicated operations of diverting the diagnostics to a file and then bringing up the file in an editor window? Unless you expect lots of warnings or you wish to concatenate warnings from several compilations, you will probably find that the default behavior (of showing warnings in the console output) serves your needs best. It would be best to remove all the /Qdiag-file options.

Highlighted
Novice
104 Views

Thanks. I found that I needed to set

Fortran>Diagnostics>Emit Diagnostics to File>No

Mine was blank but it was still writing to the file. Anyway, this worked!

View solution in original post

0 Kudos