[Ipopt-tickets] Re: [Ipopt] #52: Need to call extern Fortran function with stdcall

Ipopt coin-trac at coin-or.org
Thu Dec 13 11:27:38 EST 2007


#52: Need to call extern Fortran function with stdcall
--------------------------------+-------------------------------------------
  Reporter:  einglez            |       Owner:  ipopt-team
      Type:  task               |      Status:  new       
  Priority:  normal             |   Component:  Ipopt     
   Version:  3.3 (C++ Version)  |    Severity:  normal    
Resolution:                     |    Keywords:            
--------------------------------+-------------------------------------------
Comment (by einglez):

 The reason I believe it is necessary to change the calling convention is
 due to the local where IPOPT calls the eval_F, eval_G functions.

 I have created a Intel Fortran DLL, which is being called from am main
 Delphi program.

 When I call directly the function I have no problem (e.g.)

 CALL EV_JAC_G(TASK, N, X, NEW_X, M, NZ, ACON, AVAR, A,IDAT, DAT, IERR)

 But when IPOPT calls it some array are not properly passed. I believe it
 happen because of the calling convention.

 My DLL :
 subroutine ipoptsolver(IERR,N,M,NELE_JAC,NELE_HESS,X_L,
 X_U,X,G,G_L,G_U,F,EV_F,EV_G, EV_GRAD_F, EV_JAC_G, EV_HESS1)

 !dec$attributes dllexport, stdcall :: ipoptsolver
 !dec$attributes reference :: EV_F, EV_G, EV_GRAD_F, EV_JAC_G, EV_HESS
 !dec$attributes reference :: IERR,N,M,NELE_JAC,NELE_HESS
 !dec$attributes reference :: X_L, X_U, X, G, F,G_L,G_U

-- 
Ticket URL: <https://projects.coin-or.org/Ipopt/ticket/52#comment:1>
Ipopt <http://projects.coin-or.org/Ipopt>
Interior-point optimizer for nonlinear programs.



More information about the Ipopt-tickets mailing list