NOTE
Since release 15.2.02, the Trnsys distribution includes a CVF 6.6
workspace to help you rebuild the Trnlib library with all correct compiler
settings. The current release of CVF 6.6 is CVF 6.6B. All updates from CVF
6.5 or above to CVF 6.6B can be downloaded free of charge from the Compaq
Fortran website.
To use this workspace, open the file "\Trnsys15\WorkSpace\CVF66B\CVF66B.dsw"
in the developer studio, through the "File/Open Workspace" command.
You will not have to modify any setting to recompile and debug the TRNLIB.dll file if you use the project included in the distribution. The instructions hereunder are for reference only. They explain how this workspace was created and give all modifications to default settings.
You will also need to modify the project using these instructions if you want to use the open source version of Type 56 (included since release 15.2.07) - See section 4.3. for details
Recompiling TRNSYS for Windows from the Developer
Studio
1. Create new empty workspace called CVF66B in \Trnsys15\WorkSpace
Go to File/New, select the “Workspace” Tab
Select “Empty Workspace”
Place in \Trnsys15\WorkSpace
WorkSpace name: CVF66B
2. DummyLib project (compile all dummy routines into a library)
2.1. Create Project
Go to File/New, select the “Project” Tab
Project type: select “Win32 static library”
Select “Add to current workspace”
Project name: DummyLib
The folder name should read \Trnsys15\WorkSpace\CVF66B\DummyLib
Click OK
Do not include MFC nor Pre-compiled header (leave both boxes unchecked)
Click Finish, then OK
2.2. Project settings
Go to Projects/Settings
In the drop-down list box showing “Win32 Debug”, select “All configurations”.
There are numerous settings here controlled by a series of tabs at the top. Below are the important settings for each of these tabs. Each tab can have several "Categories" controlled by a drop-down list, so there are many settings involved. Only the settings that must be changed from their default values are mentioned.
Tab |
Drop-down list |
Parameter |
Value |
General |
none |
Output files |
\Trnsys15\Dummy |
Debug |
Additional DLL’s |
Try to locate other DLL’s |
Uncheck |
Fortran |
Compatibility |
PowerStation 4.0 compatibility options |
Check “Libraries” and “Other Run-time behaviour” |
|
Floating Point |
Floating point exception handling |
0 |
|
|
Extend precision of Single precision constants |
Checked |
Preprocessor | Include and use paths | \Trnsys15\Include | |
|
Runtime |
Runtime Error checking |
Check all boxes |
Library |
None |
Output file name |
\Trnsys15\Dummy\CVF66BDummy.lib |
Browse info * |
None |
Browse info file name |
\Trnsys15\WorkSpace\CVF66B\DummyLib\DummyLib.bsc |
* You may need to use the small right arrow to make this tab visible
Select “Win32 Debug” configuration
Tab |
Drop-down list |
Parameter |
Value |
General |
none |
Intermediate files |
\Trnsys15\WorkSpace\CVF66B\DummyLib\Debug |
Fortran |
General |
Generate source browse information |
Check |
|
Libraries |
Use run time libraries |
Debug single threaded |
Select “Win32 Release” configuration
Tab |
Drop-down list |
Parameter |
Value |
General |
None |
Intermediate files |
\Trnsys15\WorkSpace\CVF66B\DummyLib\Release |
Fortran |
Libraries |
Use run time libraries |
Single threaded |
2.3. Project files
On the left-hand window, go to “DummyLib files” and then “Source file” folder. Right-click on it and choose “Add files to folder”.
Browse to \Trnsys15\Dummy and select all Fortran files (Dum*.for)
2.4. Build Dummy library
Select the appropriate configuration (Debug or Release) in Build/Set Active Configuration
Go to Build/Rebuild all
3. ExtDLL project (compile files needed to call external DLL)
3.1. Create Project
Go to File/New, select the “Project” Tab
Project type: select “Win32 Dynamic Link Library”
Select “Add to current workspace”
Project name: ExtDLL
The folder name should read \Trnsys15\WorkSpace\CVF66B\ExtDLL
Click OK
Select “Empty DLL”
Click Finish, then OK
3.2. Project settings
Go to Projects/Settings
In the left-hand window, select the “ExtDLL project”
In the drop-down list box showing “Win32 Debug”, select “All configurations”
There are numerous settings here controlled by a series of tabs at the top. Below are the important settings for each of these tabs. Each tab can have several "Categories" controlled by a drop-down list, so there are many settings involved. Only the settings that must be changed from their default values are mentioned.
Tab |
Drop-down list |
Parameter |
Value |
General |
none |
Output files |
\Trnsys15 |
Debug |
Additional DLL’s |
Try to locate other DLL’s |
Uncheck |
Fortran |
Compatibility |
PowerStation 4.0 compatibility options |
Check “Libraries” and “Other Run-time behaviour” |
|
Floating Point |
Floating point exception handling |
0 |
|
|
Extend precision of Single precision constants |
Checked |
Preprocessor | Include and use paths | \Trnsys15\Include | |
|
Runtime |
Runtime Error checking |
Check all boxes |
Link |
General |
Output file name |
\Trnsys15\ExtDLL.dll |
|
Customize |
Program database name |
\Trnsys15\WorkSpace\CVF66B\ExtDLL\ExtDLL.pdb |
Browse info |
None |
Browse info file name |
\Trnsys15\WorkSpace\CVF66B\ExtDLL\ExtDLL.bsc |
Select “Win32 Debug” configuration
Tab |
Drop-down list |
Parameter |
Value |
General |
none |
Intermediate files |
\Trnsys15\WorkSpace\CVF66B\ExtDLL\Debug |
Fortran |
General |
Generate source browse information |
Check |
|
Libraries |
Use run time libraries |
Debug single threaded |
Select “Win32 Release” configuration
Tab |
Drop-down list |
Parameter |
Value |
General |
None |
Intermediate files |
\Trnsys15\WorkSpace\CVF66B\ExtDLL\Release |
Fortran |
Libraries |
Use run time libraries |
Single threaded |
3.3. Project files
On the left-hand window, go to “ExtDLL files” and then “Source file” folder. Right-click on it and choose “Add files to folder”.
Browse to \Trnsys15\UserLib and select ExtDLL.for
3.4. Build ExtDLL
Make sure the right project is active in Project/Set active project
Select the appropriate configuration (Debug or Release) in Build/Set Active Configuration
Go to Build/Rebuild all
4. Trnlib project (Create the Trnsys DLL)
4.1. Create Project
Go to File/New, select the “Project” Tab
Project type: select “Win32 Dynamic Link Library”
Select “Add to current workspace”
Project name: TrnLib
The folder name should read \Trnsys15\WorkSpace\CVF66B\TrnLib
Click OK
Select “Empty DLL”
Click Finish, then OK
4.2. Project settings
Go to Projects/Settings
In the left-hand window, select the “TrnLib” project
In the drop-down list box showing “Win32 Debug”, select “All configurations”
There are numerous settings here controlled by a series of tabs at the top. Below are the important settings for each of these tabs. Each tab can have several "Categories" controlled by a drop-down list, so there are many settings involved. Only the settings that must be changed from their default values are mentioned.
Tab
|
Drop-down list
|
Parameter
|
Value
|
General
|
none
|
Output files
|
\Trnsys15
|
Debug
|
Additional DLL’s
|
Try to locate other DLL’s
|
Uncheck
|
Fortran
|
Compatibility
|
PowerStation 4.0 compatibility options
|
Check “Libraries” and “Other Run-time behaviour”
|
|
Floating Point
|
Floating point exception handling
|
0
|
|
|
Extend precision of Single precision constants
|
Checked
|
Preprocessor | Include and use paths | \Trnsys15\Include | |
|
Runtime
|
Runtime Error checking
|
Check all boxes
|
Link
|
General
|
Output file name
|
\Trnsys15\Trnlib.dll
|
|
Customize
|
Program database name
|
\Trnsys15\WorkSpace\CVF66B\TrnLib\TrnLib.pdb
|
Browse info
|
None
|
Browse info file name
|
\Trnsys15\WorkSpace\CVF66B\TrnLib\TrnLib.bsc
|
Select “Win32 Debug” configuration
Tab
|
Drop-down list
|
Parameter
|
Value
|
General
|
none
|
Intermediate files
|
\Trnsys15\WorkSpace\CVF66B\TrnLib\Debug
|
Debug
|
General
|
Executable for debug session
|
\Trnsys15\Trnsys.exe
|
|
|
Working directory
|
\Trnsys15
|
Fortran
|
General
|
Generate source browse information
|
Check
|
|
Libraries
|
Use run time libraries
|
Debug single threaded
|
Link
|
Input
|
Ignore libraries
|
libc.lib (!)
|
Select “Win32 Release” configuration
Tab
|
Drop-down list
|
Parameter
|
Value
|
General
|
None
|
Intermediate files
|
\Trnsys15\WorkSpace\CVF66B\TrnLib\Release
|
Fortran
|
Libraries
|
Use run time libraries
|
Single Threaded
|
Link
|
Input
|
Ignore libraries
|
libcd.lib (!)
|
(!) Note the difference between debug and release configurations regarding the ignored libraries
4.3. Project files
On the left-hand window, go to “Trnlib files” and then “Source file” folder. Right-click on it and choose “New folder”. Create the “Kernal” folder. Right click on this folder and choose “Add files to folder”. Browse to \Trnsys15\Kernal and select all .for and .f90 files. Click OK to add the files to the project.
Go back to the “Source file” folder. Right-click on it and choose “New folder”. Create the “Types” folder. Right click on this folder and choose “Add files to folder”. Browse to \Trnsys15\Types and select all .for and .f90 files (if any). Click OK to add the files to the project.
Go to the “Header files” folder. Right click on this folder and choose “Add files to folder”. Browse to \Trnsys15\Include and select the following files: Attribs.inc, Param.inc, Userlib.inc. Click OK to add the files to the project.
Go to the “TrnLib Files” root folder and create the “Modules” folder. Select this new folder, right-click and choose “Add files to folder”.
Select \Trnsys15\Kernal\globalcommon.mod and click OK to add the file.
Repeat the procedure for
the following files:
\Trnsys15\Dummy\CVF66BDummy.lib
\Trnsys15\ExtDLL.lib
Type 56 Multizone Building:
You can either use the Open source version (which does not include all Type56 features) OR use the precompiled .OBJ files
To use the precompiled files: Add the following .obj
files as you added the other modules (e.g. CVF66BDummy.lib)
\Trnsys15\Types\Type56\CVF66B\Type56.obj
\Trnsys15\Types\Type56\CVF66B\Type56_mod.obj
To use the open source version, add the following files
to the project (as you did for other Types)
\Trnsys15\Types\Type56\opensource\opensource_type56.for
\Trnsys15\Types\Type56\opensource\opensource_type56_mod.for
4.4. Build Trnsys library
Make sure the right project is active in Project/Set active project
Select the appropriate configuration (Debug or Release) in Build/Set Active Configuration
Go to Build/Rebuild all
Last updated 2003-06-26