gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1519 Posts in 504 Topics by 735 Members - Latest Member: Rosy December 02, 2020, 07:42:10 AM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  General  |  Compiling without API Win 32 instrinsinc functions
gfx
gfxgfx
 

Author Topic: Compiling without API Win 32 instrinsinc functions  (Read 6390 times)

Denis

  • Newbie
  • *
  • Posts: 6
Compiling without API Win 32 instrinsinc functions
« on: January 07, 2009, 11:04:35 AM »
Hello,

I struggle with Absoft Pro Fortran 10.1 in compiling a code (the slatec library in fact) because this code implement a function called CARG. So the compilation rejects this code because CARG is already a intrinsinc function used for passing argument between C & fortran.
Is there a way do desactivate this feature and compile pure fortran code?

Regards,

Denis

Mike Linacre

  • Full Member
  • ***
  • Posts: 236
Re: Compiling without API Win 32 instrinsinc functions
« Reply #1 on: January 07, 2009, 11:54:58 PM »
Dennis, you probably need code like this wherever CARG is used:
INTERFACE
FUNCTION CARG (A,B,.....)
REAL :: CARG
.....
END FUNCTION CARG
END INTERFACE

Denis

  • Newbie
  • *
  • Posts: 6
Re: Compiling without API Win 32 instrinsinc functions
« Reply #2 on: January 08, 2009, 10:28:13 AM »
The problem is that my code is written in FORTRAN 77 and thus I cannot use the INTERFACE word. I think.

Mike Linacre

  • Full Member
  • ***
  • Posts: 236
Re: Compiling without API Win 32 instrinsinc functions
« Reply #3 on: January 08, 2009, 08:10:53 PM »
F90 is supposed to be backward compatible with F77, Dennis. So you should be able to add "INTERFACE" and then compile with F90.
But this is strange: CARG is not mentioned in the the F77 manual. So if CARG is active in Absoft F77, then INTERFACE probably also is. Why not try it (using F77 syntax)?

Hristov

  • Newbie
  • *
  • Posts: 1
Re: Compiling without API Win 32 instrinsinc functions
« Reply #4 on: August 20, 2010, 09:17:01 PM »
Hello,

I am new to Absoft and I'm in the process of modifying some code that has been working on windows to work on a MAC. I'm trying to figure out how to compile the libraries.

With Slatec, I am having the same problem, and adding these interface lines of code do not seem to help.



The errors I get are

f95 -c -nowdir -O2 -f77_compat -ffixed -m32 -march=host -s -o "./Release/clngam.o" "Desktop/src/clngam.f"

        ARGSUM = ARGSUM + CARG(Z)
                               ^ 
cf90-1561 af90fe: ERROR CLNGAM, File = Desktop/src/clngam.f, Line = 78, Column = 32
  This reference to the CARG intrinsic is illegal. CARG may only be referenced as an actual argument.

...

f95 -c -nowdir -O2 -f77_compat -ffixed -m32 -march=host -s -o "./Release/carg.o" "Desktop/src/carg.f"

      INTERFACE
      ^         
cf90-293 af90fe: ERROR $MAIN, File = Desktop/src/carg.f, Line = 2, Column = 7
  This unnamed main program unit is missing an END statement.

      CARG = 0.0
      ^         
cf90-271 af90fe: ERROR CARG, File = Desktop/src/carg.f, Line = 27, Column = 7
  The assignment statement is not allowed in an interface body.

      IF (REAL(Z).NE.0. .OR. AIMAG(Z).NE.0.) CARG =
      ^                                             
cf90-271 af90fe: ERROR CARG, File = Desktop/src/carg.f, Line = 28, Column = 7
  The IF statement is not allowed in an interface body.

      RETURN
      ^     
cf90-271 af90fe: ERROR CARG, File = Desktop/src/carg.f, Line = 31, Column = 7
  The RETURN statement is not allowed in an interface body.

forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 306
Re: Compiling without API Win 32 instrinsinc functions
« Reply #5 on: August 23, 2010, 09:44:36 AM »
I was able to get the file clngam.f  from the slatec library to compile
successfully with our 11.0 compiler of OS X by adding a single line:

     EXTERNAL CARG

after the declaration LOGICAL FIRST on line 28 and before the
SAVE statement on line 29. In my modified file, these three lines
read:


      LOGICAL FIRST
      EXTERNAL CARG
      SAVE PI, SQ2PIL, BOUND, DXREL, FIRST


Absoft User Forum  |  Support  |  General  |  Compiling without API Win 32 instrinsinc functions
 

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