gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1516 Posts in 502 Topics by 733 Members - Latest Member: tbickel3 October 29, 2020, 12:40:26 AM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  General  |  Documentation for CDEC$ directives?
gfx
gfxgfx
 

Author Topic: Documentation for CDEC$ directives?  (Read 3399 times)

Jean-Claude Arbaut

  • Newbie
  • *
  • Posts: 15
Documentation for CDEC$ directives?
« on: September 12, 2013, 12:58:25 PM »
Hello,

I was trying to import a Fortran DLL compiled with Absoft, in the R statistical software (under Windows 7, and both compiler and R are the 64 bit versions). I had a problem because R seems to always append "_" at the end of symbol names, though  absoft does not (see here for the complete description of the original problem: http://stackoverflow.com/questions/18767463/fortran-symbol-not-in-load-table-unable-to-call-loaded-symbol-in-r).

I didn't find a compiler option to tell Absoft to add these underscores (there is -YEXT_SFX="_", but it does not seem to work for DLL symbols), but I did find a compiler directive, and the code looks like this:

Code: [Select]
      subroutine mycalcf(a,b,c)
CDEC$ attributes alias:'mycalcf_' :: mycalcf
      real*8 a,b,c
      dll_export mycalcf
      c=a+b*b
      end

However, I didn't find the reference for supported CDEC$ directive in Absoft documentation, and I had to rely on manuals from HP and Intel [1].

Is there some documentation from Absoft, showing which directives are supported? Maybe I missed something important on Absoft's site?

As an afterthought, I found the CDIR$ directive in the documentation, and CDIR$ NAME seems to solve the problem as well, but there is still
the question about CDEC$ (are they the same? A note from Intel documentation seems to imply this [2]).

Edit: they seem to be indeed the same (CDIR$ instead of CDEC$ in the above code also works), but then the documentation is not complete
(there is nothing on CDIR$ ATTRIBUTES), so the question remains: is there a more complete documentation?


[1]
http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/fortran/lin/lref_for/source_files/rfattrib.htm
http://h21007.www2.hp.com/portal/download/files/unprot/fortran/docs/lrm/lrm0586.htm

[2]
http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/fortran/lin/bldaps_for/common/bldaps_directives.htm
« Last Edit: September 12, 2013, 01:24:41 PM by Jean-Claude Arbaut »

forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 304
Re: Documentation for CDEC$ directives?
« Reply #1 on: September 12, 2013, 01:37:13 PM »
You can use a compiler directive for this (see page 62 of the V13.0 Windows User Guide), but there is no need. The Absoft compiler appends a trailing underscore by default.

The problem is the line:

          dll_export mycalcf

This will override the default name mangling and remove the default underscore. By default all entry points are always exported, so the easiest solution is to simply remove this line.

Jean-Claude Arbaut

  • Newbie
  • *
  • Posts: 15
Re: Documentation for CDEC$ directives?
« Reply #2 on: September 12, 2013, 02:04:19 PM »
I stand corrected! :-) I mistakenly thought dll_export solved a problem at some point, and I didn't realize it was indeed the problem itself.
Thank you very much for your help!

Just to be sure for other cases: is there a list of all Absoft Fortran's supported directives?

forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 304
Re: Documentation for CDEC$ directives?
« Reply #3 on: September 12, 2013, 02:49:10 PM »
Yes, see the section "Absoft Fortran 90/95 Compiler Directives" of the Absoft Pro Fortran User Guide. For the V13.0 manual, this sections is on pages 61-62.

Jean-Claude Arbaut

  • Newbie
  • *
  • Posts: 15
Re: Documentation for CDEC$ directives?
« Reply #4 on: September 12, 2013, 03:51:37 PM »
Yes, but there are only NAME, FREE, FIXED and STACK in the manual.

I have already shown above the ATTRIBUTES directive, and a little check shows the PACK directive is also supported (I picked both in Intel & HP Fortran manuals [1]).
For example: CDIR$ PACK:2
There is also the INTEGER directive, with a syntax different from the Intel manual:
CDIR$ INTEGER=32

I am therefore absolutely certain the manual is not complete, so, is there somewhere a more complete list of supported directives? Or do I have to assume all that is not in the manual is not "officially supported" and may disappear without notice?

[1]
http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/fortran/lin/lref_for/source_files/pgjcdir.htm
http://h21007.www2.hp.com/portal/download/files/unprot/fortran/docs/lrm/lrm0583.htm
« Last Edit: September 12, 2013, 04:13:14 PM by Jean-Claude Arbaut »

Mike Linacre

  • Full Member
  • ***
  • Posts: 236
Re: Documentation for CDEC$ directives?
« Reply #5 on: September 16, 2013, 04:26:14 AM »
Jean-Claude: your assumption about disappearance is probably correct. Absoft Fortran has gradually changed across the years. Features are added and features are omitted. The fact that a feature is documented in one version does not mean that it will not disappear in a later version or that it will continue to work exactly the same way. However, Absoft staff are helpful in suggesting work-arounds when a change renders earlier code non-functional.

Absoft User Forum  |  Support  |  General  |  Documentation for CDEC$ directives?
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!