| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
| :list-unsubscribe:list-subscribe:list-archive:list-post | |
| :list-help:sender:date:from:to:cc:subject:in-reply-to:message-id | |
| :references:mime-version:content-type; q=dns; s=default; b=fTh6K | |
| m8eDm95yPRIj4WEHOf8d6RBiJMBZkJbhaYwkl2OGs79mXghrw+EqjGr+PYlnSQjZ | |
| ivgkdnzzf2jRa35weak4tZUooEV0xnp6ggooE0DSx5QGm8DtNBJ4UwkCevXtTETg | |
| v+T/CNd6HEm0K7lOFZahA8IjHoSbd1btkciqYw= | |
| DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
| :list-unsubscribe:list-subscribe:list-archive:list-post | |
| :list-help:sender:date:from:to:cc:subject:in-reply-to:message-id | |
| :references:mime-version:content-type; s=default; bh=0IljD3BH4Gx | |
| VjX+NOt9ghS77//c=; b=u9AEUqi8IdA8CrehkozU+kayI1a0njxDdnPT+q0Qf9F | |
| FA81xHoiXLJMAxPvDsF9sOIYiF/6KeewQ5lkHCTyqUSYlxbsR8joNLFGC1C65c6s | |
| MXeZA8vZrKLcmgXFgc45BYf6poJhQl5DgcNVjsoGsMlSc3DGJml/1kuM54U6MTsw | |
| = | |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Authentication-Results: | sourceware.org; auth=none |
| X-Virus-Found: | No |
| X-Spam-SWARE-Status: | No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 |
| X-HELO: | out5-smtp.messagingengine.com |
| Date: | Wed, 24 Jun 2015 10:59:38 -0500 (CDT) |
| From: | Satish Balay <balay AT fastmail DOT fm> |
| To: | cygwin AT cygwin DOT com |
| cc: | Arjen Markus <arjen DOT markus895 AT gmail DOT com> |
| Subject: | Re: using fortran common block from dll created by gfortran |
| In-Reply-To: | <alpine.LFD.2.11.1506232245380.28689@asterix> |
| Message-ID: | <alpine.LFD.2.11.1506241021130.22435@asterix> |
| References: | <alpine DOT LFD DOT 2 DOT 11 DOT 1506232245380 DOT 28689 AT asterix> |
| User-Agent: | Alpine 2.11 (LFD 23 2013-08-11) |
| MIME-Version: | 1.0 |
Thanks for the note.
I had previously tried something similar - using the directives from
http://gcc.gnu.org/onlinedocs/gfortran/GNU-Fortran-Compiler-Directives.html
However - I get errros.
>>>>>>>>>>
balay AT ps4 ~/junk
$ cat cb_func.f
subroutine cb_func()
!GCC$ ATTRIBUTES DLLEXPORT :: cb_func, /cb/
common /cb/ cvar
integer cvar
cvar = 2
end
balay AT ps4 ~/junk
$ gfortran -c cb_func.f
cb_func.f:2.40:
*GCC$ ATTRIBUTES DLLEXPORT :: cb_func, /cb/
1
Error: Invalid character in name at (1)
balay AT ps4 ~/junk
$
<<<<<<<<<<<<<
Wrt 'common blocks' vs 'module' - this usage is part of a c library
supporting fortran interfaces [and works generally on various OSes,
compilers]. We haven't worked with dlls on windows much. However this
issue came up on such an attempt with cgwin/gnu compilers.
PS: I'm not subscribed to the ML - it would be great if I'm included in cc:
Thanks,
Satish
>>>>>>>
Hi,
while this is not directly related to gfortran on Cygwin, this article
might help you appreciate the issues involved:
https://software.intel.com/en-us/node/535307
Are you bound to common blocks? If not, you may get better results
when you put the data in a module.
Regards,
Arjen
On Tue, 23 Jun 2015, Satish Balay wrote:
> Hi Cygwin,
>
> I'm debuging an issue with dlls with cygwin gnu compilers - and have
> narrowed down the issue to the attached test case [script].
>
> Could you guide me to correct usage of 'fortran common block' with dlls?
>
> [In this example - using fortran 'common block' via static library
> works. However the same code using a .dll fails]
>
> Thanks,
> Satish
>
> ---------
>
> balay AT ps4 ~/junk
> $ ./cb_test.sh
> + cat
> + cat
> + rm -f '*.o' '*.dll' '*.a' '*.exe'
> + gfortran -c cb_func.f cb_main.f
> + ar cr libcb_static.a cb_func.o
> + gfortran cb_main.o -L. -lcb_static -o cb_main_static
> + gfortran -shared -o libcb_dynamic.dll cb_func.o
> + gfortran cb_main.o -L. -lcb_dynamic -o cb_main_dynamic
> + ./cb_main_static
> GOOD COMMON BLOCK
> + ./cb_main_dynamic
> BAD COMMON BLOCK
>
>
> balay AT ps4 ~/junk
> $ uname -a
> CYGWIN_NT-6.1 ps4 2.0.4(0.287/5/3) 2015-06-09 12:22 x86_64 Cygwin
>
> balay AT ps4 ~/junk
> $ gfortran --version
> GNU Fortran (GCC) 4.9.2
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |