forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ClearWin+ gFortran modules

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Ryan



Joined: 25 Feb 2016
Posts: 26

PostPosted: Mon Oct 02, 2017 12:49 pm    Post subject: ClearWin+ gFortran modules Reply with quote

I have seen reference to modules to enable gFortran to access winio but can't find working versions of them.

I have downloaded the v13 DLLs for ClearWin+ and they are not there.

I have also tried to recreate the modules using an old version of clrwin$.f95 in the gfortran directory, but I am unable to link against the v13 DLLs because I think the naming convention has changed (the DLL has double underscore prefixes and it does not seem possible to use an underscore prefix in Fortran).

I've looked at calling the winio API directly but because of the variadic parameters, it does not seem possible (unless anything has changed since Paul posted this https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56149 ).

Is this still possible? I'd like to be able to access this under 32 and 64 bit from gFortran. I'm a bit stuck otherwise.

Regards

Ryan
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4920
Location: Salford, UK

PostPosted: Mon Oct 02, 2017 3:06 pm    Post subject: Reply with quote

On my machine the source files are in C:\Program Files (x86)\Silverfrost\FTN95\source64. This folder is from the FTN95 installer.

If you need clearwin64f.dll or the equivalent 32 bit DLL then you you would also need a gFortran command line to generate it from clearwin64f.f95.
Back to top
View user's profile Send private message
Ryan



Joined: 25 Feb 2016
Posts: 26

PostPosted: Mon Oct 02, 2017 5:32 pm    Post subject: Reply with quote

Apologies Paul, I thought they were out of date but it was because gFortran was adding an additional underscore that could not then be found in the lib.

I can now get 64 bit gFortran calls working with winio, but 32 bit fails as I am having to call the old ClearWin32.lib / DLL. I'll update the other post regarding that.

Thanks again Paul

My working out for anyone else interested;

I attempted to use the clrwin.f95 source from the source64 directory, it did not seem to sync with the v13 64 bit build however. This was from the Silverfrost 8.10 version installation we purchased earlier this year so it should have been current.

The problem seemed to occur with the following line in clrwin.f95;

Code:
integer,external::winio$


This is I believe a workaround for two things, a) the @ has been replaced by $ because @ is not valid in some compilers and b) the Fortran specification does not allow for a variable number of parameters, hence it is just declared 'external' instead of having an interface defined.

Using the dumpbin tool I could see that the LIB for ClearWin64 exports a function named 'winio$' but my attempts to call it from the sample ClearWin+ code all ended up with linker errors saying that 'clrwin$_' could not be found.

It turned out to be gFortran adding an underscore to anything defined as 'external'. This can be turned off with the -fno-underscoring compiler flag.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group