[Coin-discuss] Running Bcp on Windows

Jörg Herbers herbers at hotmail.com
Wed Oct 22 08:24:28 EDT 2003


Hi Jesper,

BCP compiles on cygwin and with some modifications on Visual C++ .NET 2003. 
Most of the necessary changes are due to persistent problems of VC7 with 
templates:

BCP_lp_branching.cpp:275: const int maxind = std::max<int>(rownum, colnum);
BCP_lp_colrow.cpp:401: 
std::min<size_t>(p.param(BCP_lp_par::MaxCutsAddedPerIteration),
BCP_lp_colrow.cpp:495: 
std::min<size_t>(p.param(BCP_lp_par::MaxVarsAddedPerIteration),
BCP_lp_create_lp.cpp:125: const int num = std::max<int>(varnum, cutnum);
BCP_lp_fathom.cpp:260: std::max<const size_t>(
BCP_lp_generate_cuts.cpp:166: tout = std::max<double>(0.0, tout - 
(BCP_time_since_epoch() - tin));
BCP_lp_generate_vars.cpp:162: tout = std::max<double>(0.0, tout - 
(CoinCpuTime() - tin));
BCP_lp_main.cpp:32: p.node->vars.reserve(std::max<int>(1000, 3 * bvarnum));
BCP_lp_main.cpp:42: p.node->cuts.reserve(std::max<int>(1000, 3 * bcutnum));
BCP_lp_pool.cpp:8: _violation = std::max<double>( 0.0, 
std::max<double>(_row->LowerBound()-lhs,
BCP_message_single.cpp:251: _lp_prob->upper_bound = 
std::min<double>(_tm_prob->ub(), DBL_MAX/2);

BCP_timeout.cpp needs the following extensions:

#if defined(_MSC_VER) && (_MSC_VER > 1300)
#  include <time.h>
#endif

double BCP_time_since_epoch() {
   BCP_DEFAULT_NAMESPACE;
#if defined(_MSC_VER)
   unsigned int ticksnow;
   ticksnow = (unsigned int)clock();
   return (double)((double)ticksnow/CLOCKS_PER_SEC);
#else
  /* ... as before ... */
#endif
}

Furthermore, I use an OS specific header file (BCP_msvc.hpp):

#ifndef _BCP_MSVC
#define _BCP_MSVC

typedef int BCP_IndexType;

#  define setpriority(x,y,z)
#  define BCP_USE_RUSAGE 0
#  include <Windows.h>
#  define gethostname(c, l) { DWORD cnlen = l; GetComputerName(c, &cnlen); }
#  include <process.h>
#  define BCP_PtrDiff       int
#  define BCP_DEFAULT_NAMESPACE

#    define NEED_TEMPLATE_CLASSES
// #    define NEED_TEMPLATE_FUNCTIONS
// #    define NEED_STD_TEMPLATE_FUNCTIONS
// #    define NEED_IMPLICIT_TEMPLATE_CLASSES
// #    define NEED_IMPLICIT_TEMPLATE_FUNCTIONS
#    define BCP_CONSTRUCT     std::_Construct
#    define BCP_DESTROY       std::_Destroy
//#    define BCP_DESTROY_RANGE std::_Destroy_range

template<class T> inline void BCP_DESTROY_RANGE(T *first, T *last)
{
  for (; first != last; ++first)
    BCP_DESTROY(first);
}

#endif

which is included in BCP_os.hpp:

#if defined(_MSC_VER) && (_MSC_VER > 1300)
#  include "BCP_msvc.hpp"
#endif

>From my viewpoint, it would be helpful to integrate these changes in BCP. 
But since the changes are due to compiler flaws, this again leads us to the 
discussion on how many and which compilers BCP should support...

Jörg


>>>jpfasano at us.ibm.com 10/20/2003 6:39:10 PM >>>




Hi Jesper,
I believe BCP will compile using CYGWIN on Windows.

JP Fasano
jpfasano at us.ibm.com
(914)945-1324  (tie line 862-1324)
COIN www.coin-or.org



                      ladanyi at watson.ibm.com
                      Sent by:                       To:       COIN-discuss 
<coin-discuss at oss.software.ibm.com>
                      coin-discuss-admin at www-        cc:
                      124.ibm.com                    Subject:  Re: 
[Coin-discuss] Running Bcp on Windows


                      10/20/2003 11:48 AM
                      Please respond to
                      coin-discuss






Hi Jesper,

Yes, I tried it, and it's a no go. BCP uses templated member functions and
VC++-6.0 can't handle them. It claims that there's a syntax error. I boiled
the problem down to a trivial example, contacted Microsoft and they
admitted
the error in the compiler.

On the bright side, VC++-7 is supposed to be much more standards compliant,
so
you may get Bcp working with it.

Good luck,
--Laci

On Mon, 20 Oct 2003, Jesper Hansen wrote:

>Hi
>
>I'm trying to get Bcp running on Windows with Visual C++ 6.0. However I
get
>a huge number of compilation errors. Have anyone tried this before?
>Experiences would be much appreciated.
>
>For instance I get the following error (which does not seem to be an
error):
>
>e:\COIN\Bcp\include\BCP_vector.hpp(299) : error C2039: 'const_iterator' :
is
>not a member of 'BCP_vec<int>'
>
>Another issue is the os specific header files...
>
>'Jesper
>
>
>---
>Jesper Hansen                   mailto:jesper at carmenconsulting.com Carmen 
>Consulting, Købmagergade 53 3., DK-1150 Kbh K, Denmark
>Telephone: +45 33 17 91 92                 Mobile: +45 61 33 29 69
>http://www.carmenconsulting.com
>
>
>_______________________________________________
>Coin-discuss mailing list
>Coin-discuss at www-124.ibm.com 
>http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-discuss
>

_______________________________________________
Coin-discuss mailing list
Coin-discuss at www-124.ibm.com
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-discuss



_______________________________________________
Coin-discuss mailing list
Coin-discuss at www-124.ibm.com
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-discuss

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963




More information about the Coin-discuss mailing list