BlueM.Sim compilation: Difference between revisions

From BlueM
Jump to navigation Jump to search
mNo edit summary
(mention Intel Fortran Compiler Extension for Visual Studio)
 
(30 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Bild:RECLinBytes.jpg|thumb|Use Bytes as RECL]]
{{BlueM.Sim nav}}
==Allgemeine Einstellungen==
<div style="float:right; margin:0 0 10px 10px;">__TOC__</div>
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)
==Compilation==
BlueM.Sim is written in FORTRAN. Additional components such as [[BlueM.DLLAdapter]] and [[BlueM.Wave]] are written in C# and VB.NET, while [[BlueM.LaPipe]] is written in C++.


==Intel Fortran 9.1==
Recommended software setup for compiling BlueM.Sim:
Aus den Release notes:
* [https://visualstudio.microsoft.com/ Microsoft Visual Studio 2019 or 2022] (Community Edition is sufficient)
<blockquote>
** Select at least the "Desktop Development with C++" component
<u>Constants Are Now Read-Only</u><br/>
* Intel Fortran Compiler:
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:
** [https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html Intel oneAPI Base Toolkit], select at a minimum "Intel Distribution for GDB". This provides the Fortran debugger support for Visual Studio.
** [https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit-download.html Intel oneAPI HPC Toolkit], select at a minimum "Intel Fortran Compiler".
:Or, use the new Intel Fortran Compiler Extension for Visual Studio: https://marketplace.visualstudio.com/items?itemName=intel-corporation.fortranonline


<pre>
Further reading:
call sub (3)
* [https://www.intel.com/content/www/us/en/developer/articles/guide/installing-microsoft-visual-studio-2019-for-use-with-intel-compilers.html Installing Microsoft Visual Studio* for Use with Intel® Compilers]
...
* [https://www.intel.com/content/www/us/en/developer/articles/training/intel-fortran-compiler-in-ms-visual-studio.html How to Select oneAPI Intel® Fortran Compiler and Compiler Version in Microsoft* Visual Studio]
subroutine sub (i)
i = i + 1 ! Will cause an access violation
</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.
==Compiler settings==
</blockquote>
[[Bild:RECLinBytes.jpg|thumb|Use Bytes as RECL]]
Required compiler settings (''Flags''):
* <code>/assume:byterecl</code>
: This causes Intel Fortran to interpret the record length of unformatted files (e.g. time series in [[BIN-Format]]) in bytes instead of in 4 byte units (longwords). This flag is set by setting ''Use Bytes as RECL unit for unformatted files:'' to '''Yes''' (see image).  
The compiler settings are stored in the project file <code>BlueM.Sim.vfproj</code> and normally do not have to be adjusted.


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.
==Build configurations==
The following build configurations for BlueM.Sim are defined in the project file:
* '''Debug''': Debug version, no optimizations
* '''Release''': Release version with optimizations


[[Category:BlauesModell]]
[[Kategorie:BlueM.Sim Development]]

Latest revision as of 05:46, 2 March 2024

BlueM_icon.png BlueM.Sim | Downloads | Application | Theory | Development

Compilation

BlueM.Sim is written in FORTRAN. Additional components such as BlueM.DLLAdapter and BlueM.Wave are written in C# and VB.NET, while BlueM.LaPipe is written in C++.

Recommended software setup for compiling BlueM.Sim:

Or, use the new Intel Fortran Compiler Extension for Visual Studio: https://marketplace.visualstudio.com/items?itemName=intel-corporation.fortranonline

Further reading:

Compiler settings

Use Bytes as RECL

Required compiler settings (Flags):

  • /assume:byterecl
This causes Intel Fortran to interpret the record length of unformatted files (e.g. time series in BIN-Format) in bytes instead of in 4 byte units (longwords). This flag is set by setting Use Bytes as RECL unit for unformatted files: to Yes (see image).

The compiler settings are stored in the project file BlueM.Sim.vfproj and normally do not have to be adjusted.

Build configurations

The following build configurations for BlueM.Sim are defined in the project file:

  • Debug: Debug version, no optimizations
  • Release: Release version with optimizations