[Coin-lpsolver] CLP from Compaq Visual Fortran 6.6

Matthew Saltzman mjs at CLEMSON.EDU
Tue Nov 27 18:53:38 EST 2007


Jose-

I don't know much about Fortran 9x or the DVF compiler, but perhaps you
could explain the digits after the @ signs in the directives?

Also, how did you build the C++ parts of the code (i.e., CLP)?


On Tue, 2007-11-27 at 10:48 -0600, Jose Luis Ceciliano Meza wrote:
> Hi:
>  
> Recently I have tried to create a Fortran interface to use CLP from
> Visual Fortran. I am trying to use some advise from Matthew Saltzman,
> and some experience that I have on using Lindo and CPLEX with the same
> purpose. However, I am having some trouble. I would like to show you
> what I have done and where my problem is in order to get some help
> from you.
>  
> 1. I have created a CLP_interface like this:
>  
> -------------------------------------------------------------------------------------------------------
>       MODULE clp_ifaces
> !
> !  Interfaces to the CLP Version 6.0 functions in alphabetic order for
> use
> !   with Digital Visual Fortran 5.0 (DVF) - note that these interfaces
> will
> !   also work with Microsoft Fortran Powerstation 4.0 if all
> metacommand
> !   prefixes are changed from !DEC$ to !MS$
> !
> !
> !  Written By:  Jose L. Ceciliano                    On:  20 Nov 2007
> !
> !
> !  Allow no implicit declarations
> !
>       implicit none
> !
> !  CLP functions' interfaces
> !
> !     Load the problem
>       INTERFACE
>       function Clp_loadProblem( model,  numcols, numrows, start, & 
>      &                          column, valuem, collb, colub, obj, &
>   &                         rowlb, rowub)
> !DEC$ ATTRIBUTES stdcall, alias:'_Clp_loadProblem at 48' ::
> Clp_loadProblem
> !DEC$ ATTRIBUTES value :: numcols, numrows
> !DEC$ ATTRIBUTES reference :: start, column, valuem, collb
> !DEC$ ATTRIBUTES reference :: colub, obj, rowlb, rowub, model
>       use symtypes
>       integer(IL) :: Clp_loadProblem
>       integer(IL), intent(in) :: numcols, numrows
>       integer(IL), intent(in) :: start(*), column(*)
>       real(RD), intent(in) :: valuem(*), collb(*), colub(*)
>       real(RD), intent(in) :: obj(*), rowlb(*), rowub(*)
>       character(15), intent(in) :: model
>       end function Clp_loadProblem
>       END INTERFACE
>  
> ! 
> !     Read an mps file from the given filename
>       INTERFACE
>       function Clp_readMps( model, filename, keepNames, ignoreErrors)
>       use symtypes
>       integer(IL) :: Clp_readMps
>       integer(IL), intent(in) :: keepNames, ignoreErrors
>       character(15), intent(in) :: model, filename
>       end function Clp_readMps
>       END INTERFACE
> !
> !     Primal column solution
>       INTERFACE
>       function Clp_primalColumnSolution(model)
> !DEC$ ATTRIBUTES stdcall, alias:'_Clp_primalColumnSolution at 8' ::
> Clp_primalColumnSolution
> !DEC$ ATTRIBUTES reference :: model
>       use symtypes
>       integer(IL) :: Clp_primalColumnSolution
>       character(15), intent(in) :: model
>       end function Clp_primalColumnSolution
>       END INTERFACE
> !
> !     Objective value
>       INTERFACE
>       function Clp_objectiveValue(model)
> !DEC$ ATTRIBUTES stdcall, alias:'_Clp_objectiveValue at 8' ::
> Clp_objectiveValue
> !DEC$ ATTRIBUTES reference :: model
>       use symtypes
>       integer(IL) :: Clp_objectiveValue
>       character(15), intent(in) :: model
>       end function Clp_objectiveValue
>       END INTERFACE
> !
> !     Dual algorithm - see ClpSimplexDual.hpp for method
>       INTERFACE
>       function Clp_dual(model, ifValuesPass)
> !DEC$ ATTRIBUTES stdcall, alias:'_Clp_loadProblem at 12' ::
> Clp_loadProblem
> !DEC$ ATTRIBUTES value :: ifValuesPass
> !DEC$ ATTRIBUTES reference :: model
>       use symtypes
>       integer(IL) :: Clp_dual
>       integer(IL) :: ifValuesPass
>       character(15), intent(in) :: model
>       end function Clp_dual
>       END INTERFACE
> !
>       END MODULE clp_ifaces
> ----------------------------------------------------------------------------
> 2. I have created my project defining in settings the following
> information:
>  
> a) In C/C++ preprosessor/additional include directories:     C:
> \coin-win32-msvc6-24Feb06\include
> b) In Link/Object/library modules:  C:\coin-win32-msvc6-24Feb06\lib
> \*.lib
>  
> However, when I try to link my project I get the following errors:
>  
> prueba1.obj : error LNK2001: unresolved external symbol
> _Clp_loadProblem at 48
> prueba1.obj : error LNK2001: unresolved external symbol _CLP_DUAL at 12
> prueba1.obj : error LNK2001: unresolved external symbol
> _Clp_objectiveValue at 8
> prueba1.obj : error LNK2001: unresolved external symbol
> _Clp_primalColumnSolution at 8
> Debug/prueba1.exe : fatal error LNK1120: 4 unresolved externals
> Error executing link.exe.
>  
> prueba1.exe - 5 error(s), 1 warning(s)
> 
>  
> -------------------------------------------------------------------
>  
> I think the problem is with the Clp.lib file since it does not have
> any @number with its functions, instead it has @ ??
>  
> What could it be the error? What I would need to do that I am not
> doing now? Thanks in advance.
>  
> Kind regards,
> Jose
> _______________________________________________
> Coin-lpsolver mailing list
> Coin-lpsolver at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-lpsolver
-- 
                Matthew Saltzman

Clemson University Math Sciences
mjs AT clemson DOT edu
http://www.math.clemson.edu/~mjs




More information about the Clp mailing list