BlueM.Sim compilation: Difference between revisions

From BlueM
Jump to navigation Jump to search
Line 11: Line 11:
<u>Constants Are Now Read-Only</u><br/>  
<u>Constants Are Now Read-Only</u><br/>  
Constants, including literals and named constants (<code>PARAMETER</code>), are now allocated in a memory section that is protected against write access. This means that if a constant is passed as an actual argument to a procedure and the procedure tries to modify the argument, an access violation will result. For example:
Constants, including literals and named constants (<code>PARAMETER</code>), are now allocated in a memory section that is protected against write access. This means that if a constant is passed as an actual argument to a procedure and the procedure tries to modify the argument, an access violation will result. For example:
 
<fortran>
<pre>
      call sub (3)
call sub (3)
      ...
...
      subroutine sub (i)
subroutine sub (i)
      i = i + 1 ! Will cause an access violation
i = i + 1 ! Will cause an access violation
</fortran>
</pre>
 
The Fortran language prohibits changing the definition status of an argument associated with a constant or expression. If your application needs to do so, you can specify the <code>/assume:noprotect_constants</code> option. (In the visual development environment, select project property '''Fortran..Data..Constant Actual Arguments Can Be Changed..Yes'''.) This will instruct the compiler to create and pass a temporary copy of the constant actual argument. The called procedure can change this copy which will be discarded when the procedure exits.
The Fortran language prohibits changing the definition status of an argument associated with a constant or expression. If your application needs to do so, you can specify the <code>/assume:noprotect_constants</code> option. (In the visual development environment, select project property '''Fortran..Data..Constant Actual Arguments Can Be Changed..Yes'''.) This will instruct the compiler to create and pass a temporary copy of the constant actual argument. The called procedure can change this copy which will be discarded when the procedure exits.
</blockquote>
</blockquote>

Revision as of 08:42, 18 October 2006

Allgemeine Einstellungen

Use Bytes as RECL

Compiler-Einstellungen (Flags), die zur erfolgreichen Kompilierung erforderlich sind.

  • Damit Intel Fortran bei unformatierten Dateien die Record-Länge als bytes und nicht als 4-byte Einheiten (longwords) interpretiert, muss folgender Flag gesetzt werden: "Use Bytes as RECL unit for unformatted files: Yes" (siehe Bild)


Intel Fortran 9.1

Aus den Release notes:

Constants Are Now Read-Only
Constants, including literals and named constants (PARAMETER), are now allocated in a memory section that is protected against write access. This means that if a constant is passed as an actual argument to a procedure and the procedure tries to modify the argument, an access violation will result. For example: <fortran> call sub (3) ... subroutine sub (i) i = i + 1  ! Will cause an access violation </fortran> The Fortran language prohibits changing the definition status of an argument associated with a constant or expression. If your application needs to do so, you can specify the /assume:noprotect_constants option. (In the visual development environment, select project property Fortran..Data..Constant Actual Arguments Can Be Changed..Yes.) This will instruct the compiler to create and pass a temporary copy of the constant actual argument. The called procedure can change this copy which will be discarded when the procedure exits.

Das Setzen des oben genannten Flags betrifft allerdings nur benannte Konstanten, Literale (wie die '3' im Beispiel oben) können auch durch das Setzen des Flags nicht verändert werden. Um korrektes Fortran zu gewährleisten, sollte der Flag sowieso nicht gesetzt werden.

Konsolenfenster

Man kann verhindern, dass ein Konsolenfenster nach Abschluss zugeht, in dem man eine Verknüpfung zur EXE macht, und dann in den Eigenschaften der Verknüpfung bei "Ziel" folgendes eingibt:

cmd /K "D:\BlauesModell.exe"

Das /K verursacht, dass es nicht wieder zugeht.

Eclipse

Eclipse screenshot

Die Eclipse Entwicklungsumgebung ist nützlich, um die Dokumentstruktur (sprich: Liste von Funktionen) von Fortran Quelldateien anzusehen. Ausserdem bietet Eclipse noch weitergehende Syntaxfehlererkennung und Anbindung an Subversion. Leider hab ich es noch nicht geschafft, in Eclipse Fortran Code zu debuggen, weil dazu ein Makefile benötigt wird. Theoretisch sollte es aber möglich sein, sogar den Intel Fortran Compiler/Debugger einzubinden.

Installation:

Eclipse Einstellungen:

  • Project Properties: Binary Parser: PE Windows Parser (für Syntaxfehlererkennung)
  • Debug As...: C/C++ Local Application: Debugger: Cygwin gdb Debugger und Pfad zu gdb.exe angeben