You are not logged in.

#1 2024-02-19 19:52:13

jocris
Member
Registered: 2024-02-19
Posts: 2

failure to build python-xgboost

(...)
[ 16%] Building CXX object src/CMakeFiles/objxgboost.dir/__/rabit/src/engine_mpi.cc.o
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:9: warning: "NOMINMAX" redefined
    9 | #define NOMINMAX
      |
<command-line>: note: this is the location of the previous definition
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc: In member function ‘virtual void rabit::engine::MPIEngine::Broadcast(void*, size_t, int)’:
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:40:10: error: ‘COMM_WORLD’ is not a member of ‘MPI’
   40 |     MPI::COMM_WORLD.Bcast(sendrecvbuf_, size, MPI::CHAR, root);
      |          ^~~~~~~~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:40:52: error: ‘CHAR’ is not a member of ‘MPI’
   40 |     MPI::COMM_WORLD.Bcast(sendrecvbuf_, size, MPI::CHAR, root);
      |                                                    ^~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc: In member function ‘virtual int rabit::engine::MPIEngine::GetRank() const’:
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:59:17: error: ‘COMM_WORLD’ is not a member of ‘MPI’
   59 |     return MPI::COMM_WORLD.Get_rank();
      |                 ^~~~~~~~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc: In member function ‘virtual int rabit::engine::MPIEngine::GetWorldSize() const’:
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:63:17: error: ‘COMM_WORLD’ is not a member of ‘MPI’
   63 |     return MPI::COMM_WORLD.Get_size();
      |                 ^~~~~~~~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc: In member function ‘virtual std::string rabit::engine::MPIEngine::GetHost() const’:
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:73:10: error: ‘Get_processor_name’ is not a member of ‘MPI’
   73 |     MPI::Get_processor_name(name, len);
      |          ^~~~~~~~~~~~~~~~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc: In function ‘bool rabit::engine::Init(int, char**)’:
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:94:10: error: ‘Init’ is not a member of ‘MPI’; did you mean ‘rabit::engine::Init’?
   94 |     MPI::Init(argc, argv);
      |          ^~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:92:6: note: ‘rabit::engine::Init’ declared here
   92 | bool Init(int argc, char *argv[]) {
      |      ^~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc: In function ‘bool rabit::engine::Finalize()’:
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:104:10: error: ‘Finalize’ is not a member of ‘MPI’; did you mean ‘rabit::engine::Finalize’?
  104 |     MPI::Finalize();
      |          ^~~~~~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:102:6: note: ‘rabit::engine::Finalize’ declared here
  102 | bool Finalize(void) {
      |      ^~~~~~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc: At global scope:
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:117:49: error: return type ‘class MPI::Datatype’ is incomplete
  117 | inline MPI::Datatype GetType(mpi::DataType dtype) {
      |                                                 ^
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc: In function ‘void rabit::engine::GetType(mpi::DataType)’:
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:120:29: error: ‘CHAR’ is not a member of ‘MPI’
  120 |     case kChar: return MPI::CHAR;
      |                             ^~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:121:30: error: ‘BYTE’ is not a member of ‘MPI’
  121 |     case kUChar: return MPI::BYTE;
      |                              ^~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:122:28: error: ‘INT’ is not a member of ‘MPI’
  122 |     case kInt: return MPI::INT;
      |                            ^~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:123:29: error: ‘UNSIGNED’ is not a member of ‘MPI’
  123 |     case kUInt: return MPI::UNSIGNED;
      |                             ^~~~~~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:124:29: error: ‘LONG’ is not a member of ‘MPI’
  124 |     case kLong: return MPI::LONG;
      |                             ^~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:125:30: error: ‘UNSIGNED_LONG’ is not a member of ‘MPI’
  125 |     case kULong: return MPI::UNSIGNED_LONG;
      |                              ^~~~~~~~~~~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:126:30: error: ‘FLOAT’ is not a member of ‘MPI’
  126 |     case kFloat: return MPI::FLOAT;
      |                              ^~~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:127:31: error: ‘DOUBLE’ is not a member of ‘MPI’
  127 |     case kDouble: return MPI::DOUBLE;
      |                               ^~~~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:128:33: error: ‘LONG_LONG’ is not a member of ‘MPI’
  128 |     case kLongLong: return MPI::LONG_LONG;
      |                                 ^~~~~~~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:129:34: error: ‘UNSIGNED_LONG_LONG’ is not a member of ‘MPI’
  129 |     case kULongLong: return MPI::UNSIGNED_LONG_LONG;
      |                                  ^~~~~~~~~~~~~~~~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:132:15: error: ‘CHAR’ is not a member of ‘MPI’
  132 |   return MPI::CHAR;
      |               ^~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc: At global scope:
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:135:13: error: ‘Op’ in namespace ‘MPI’ does not name a type
  135 | inline MPI::Op GetOp(mpi::OpType otype) {
      |             ^~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc: In function ‘void rabit::engine::Allreduce_(void*, size_t, size_t, void (*)(const void*, void*, int, const MPI::Datatype&), mpi::DataType, mpi::OpType, void (*)(void*), void*)’:
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:156:8: error: ‘COMM_WORLD’ is not a member of ‘MPI’
  156 |   MPI::COMM_WORLD.Allreduce(MPI_IN_PLACE, sendrecvbuf,
      |        ^~~~~~~~~~
/home/user1/python-xgboost/src/xgboost-2.0.3/rabit/src/engine_mpi.cc:157:52: error: ‘GetOp’ was not declared in this scope
  157 |                             count, GetType(dtype), GetOp(op));
      |                                                    ^~~~~
make[2]: *** [src/CMakeFiles/objxgboost.dir/build.make:1224: src/CMakeFiles/objxgboost.dir/__/rabit/src/engine_mpi.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:282: src/CMakeFiles/objxgboost.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

Hi,
Need your help to figure why those errors are occurring. I had a look on src code of both openmpi and xgboost but is not obvious to me how these MPI::XXXX are supposed to be resolved.

Last edited by jocris (2024-02-19 20:20:10)

Offline

#2 2024-02-19 20:21:48

loqs
Member
Registered: 2014-03-06
Posts: 17,436

Re: failure to build python-xgboost

See https://github.com/open-mpi/ompi/issues/3173 the openMPI CXX interfaces were removed in 5.0 following their 3.0 deprecation xgboost needs to convert its use to the C interface as was done in for example https://github.com/INCF/MUSIC/commit/16 … 87a1f5a1ad or at least test for the presence/absence of the CXX interface and not enable OpenMPI use accordingly.

Last edited by loqs (2024-02-19 20:24:19)

Offline

#3 2024-02-19 20:38:44

jocris
Member
Registered: 2024-02-19
Posts: 2

Re: failure to build python-xgboost

Thanks loqs, that was very helpful to understand.

Offline

Board footer

Powered by FluxBB