[Coin-discuss] Problem compiling BranchAndCut with PVM

Paul Pacheco paul.pacheco at wavecode.com
Wed Aug 27 16:52:34 EDT 2003


I was trying to compile BranchAndCut example from BCP, and I am getting some compilation errors. I am using Linux Mandrake 9.1 and this is what I have found.

The first problem I had was this:



Compiling BCP_USER.cpp
/home/paul/coin/Bcp/Member/BCP_USER.cpp:10: ISO C++ forbids declaration of `msgenv_init' with no type
/home/paul/coin/Bcp/Member/BCP_USER.cpp:10: prototype for `int USER_initialize::msgenv_init()' does not match any in class `USER_initialize'
/home/paul/coin/Bcp/include/BCP_USER.hpp:59: candidate is: virtual BCP_message_environment* USER_initialize::msgenv_init()
/home/paul/coin/Bcp/Member/BCP_USER.cpp:10: `int USER_initialize::msgenv_init()' and `virtual BCP_message_environment* USER_initialize::msgenv_init()' cannot be overloaded
/home/paul/coin/Bcp/Member/BCP_USER.cpp: In member function `int USER_initialize::msgenv_init()':
/home/paul/coin/Bcp/Member/BCP_USER.cpp:11: invalid conversion from `BCP_pvm_environment*' to `int'
make[1]: *** [/home/paul/coin/Bcp/Linux-g/BCP_USER.o] Error 1
make[1]: Leaving directory `/home/paul/coin/Examples/BranchAndCut'
make: *** [bc] Error 2



I fixed this with the following patch:


Index: BCP_USER.cpp
===================================================================
RCS file: /usr/cvs/coin/COIN/Bcp/Member/BCP_USER.cpp,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 BCP_USER.cpp
--- BCP_USER.cpp        14 Aug 2001 20:59:56 -0000      1.1.1.1
+++ BCP_USER.cpp        27 Aug 2003 20:45:47 -0000
@@ -7,7 +7,7 @@
 #if defined(BCP_COMM_PROTOCOL_PVM)

 #include "BCP_message_pvm.hpp"
-USER_initialize::msgenv_init() {
+BCP_message_environment * USER_initialize::msgenv_init() {
   return new BCP_pvm_environment;
 }




Next, I tried to compile again, and got the following error:


Compiling BCP_message_pvm.cpp
/home/paul/coin/Bcp/Member/BCP_message_pvm.cpp: In member function `virtual void BCP_pvm_environment::receive(const BCP_proc_id*, BCP_message_tag, BCP_buffer&, double)':
/home/paul/coin/Bcp/Member/BCP_message_pvm.cpp:216: `floor' undeclared (first use this function)
/home/paul/coin/Bcp/Member/BCP_message_pvm.cpp:216: (Each undeclared identifier is reported only once for each function it appears in.)
make[1]: *** [/home/paul/coin/Bcp/Linux-g/BCP_message_pvm.o] Error 1
make[1]: Leaving directory `/home/paul/coin/Examples/BranchAndCut'
make: *** [bc] Error 2


I fixed this one with the following patch:

Index: BCP_message_pvm.cpp
===================================================================
RCS file: /usr/cvs/coin/COIN/Bcp/Member/BCP_message_pvm.cpp,v
retrieving revision 1.3
diff -u -3 -p -r1.3 BCP_message_pvm.cpp
--- BCP_message_pvm.cpp 16 Feb 2003 04:13:58 -0000      1.3
+++ BCP_message_pvm.cpp 27 Aug 2003 20:50:28 -0000
@@ -3,6 +3,7 @@

 #include <cstdio>
 #include <pvm3.h>
+#include <math.h>

 #include "BCP_error.hpp"
 #include "BCP_buffer.hpp"


These are very trivial fixes, so I don't think they should be a big deal.



More information about the Coin-discuss mailing list