[TRNSYS-users] g95 compilation - lessons learnt and questions

David BRADLEY d.bradley at tess-inc.com
Thu Mar 22 10:11:22 PDT 2012


Jean,
Fortran run-time libraries are a bit hard to define categorically; 
essentially, there are some mathematical functions that are not standard 
and that are contained in some additional libraries that must be linked 
into the project. The most commonly known library is the Lapack library, 
a lot of linear algebra functions that can be referenced by a subroutine 
if you link in the Lapack run-time libraries. The reason it is difficult 
to define which libraries you need is that different compilers put their 
non-standard functions in different libraries. As you probably know, if 
you get an "unresolved external" error when you try to compile your 
code, this means that there is routine or a function being referenced in 
your code that is not recognized by the compiler and it needs to be 
provided elsewhere. It sounds as though you have found a lot of them and 
that you have solved the problem by finding alternative functions that 
are native to G95 instead of ones that are referenced in a runtime 
library. My apologies that I cannot offer a "here is how to fix the 
problem" answer; hopefully some of the above information will help guide 
you.
Kind regards,
David


On 3/20/2012 00:32, jeannieboef wrote:
> Dear Group,
> My aim is to tweak the existing Type25 printer, so that I can dictate 
> which connected inputs get printed AND to swich off the printer.
>
> But for now I am concerned with recompiling and running the Type25 
> source code as a new type, Type202 as an external dll.
>
> Having found the guidance on using the g95 compiler, I must say it 
> helped a lot. Additionally, it seems the following fixes where needed 
> for the source code:
>
> JFIX must be substituted (this is an intel function which converts all 
> sorts to Integer*4. I used INT().
>
> DMOD is a version of mod that should actually work, but did not. An 
> extra function DMOD was set up in the TRNSYSFunctions module. This 
> funtion returns the remainder of a division operation.
>
> Tabs in the source code are missleading as they are not the 5 leading 
> spaces required before the line continuation character.
>
> Variable format statements such as
> 1001 FORMAT(A<maxUnitLength>,A1)
> are not supported. I hard coded these, but other solutions are workable.
>
> Questions:
> "Troubleshooting Multiple DLLs" chapter in the programmer guide...
> what does "the Fortran run-time libraries" mean and where do I find 
> the still lacking libraries and dlls to link in.
> The EXE folder contains the release trndll.dll which I have linked as 
> well as loads of other stuff not documented.
>
> Thanking you in advance,
>
> Jean
>
> PS yes I know I shouldn't use g95.
>
> Sent from my iPhone
> _______________________________________________
> TRNSYS-users mailing list
> TRNSYS-users at cae.wisc.edu
> https://mailman.cae.wisc.edu/listinfo/trnsys-users
>

-- 
***************************
David BRADLEY
Principal
Thermal Energy Systems Specialists, LLC
22 North Carroll Street - suite 370
Madison, WI  53703 USA

P:+1.608.274.2577
F:+1.608.278.1475
d.bradley at tess-inc.com

http://www.tess-inc.com
http://www.trnsys.com




More information about the TRNSYS-users mailing list