Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Davis__Zach
Beginner
151 Views

Seeking Help With Compiling Parmetis on Mac

I've run into an issue compiling parmetis (v. 4.0.3) under macOS (10.14.6) using Intel's C++ compiler 2019.4.233.  Parmetis depends on an MPI installation, and I've compiled OpenMPI v4.0.1 using the same Intel compiler with:

 

./configure --prefix=/usr/local/Cellar/open-mpi/4.0.1 --enable-mpi-fortran --enable-mpi-cxx CC=icc FC=ifort CXX=icpc

make && make install

 

OpenMPI seems to build okay without any errors.

 

When building parmetis, I do the following:

make config prefix=/usr/local/Cellar/parmetis/4.0.3 CFLAGS="-fPIC" cc=icc cxx=icpc

make

Everything builds fine until the link step.  Once it attempts to link, then I get an error stating:

/opt/intel/compilers_and_libraries_2019.4.233/mac/bin/intel64/icc -fPIC -DLINUX -D_FILE_OFFSET_BITS=64 -DNDEBUG -DNDEBUG2 -DHAVE_EXECINFO_H -DHAVE_GETLINE -O3 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wall CMakeFiles/parmetis_prog.dir/parmetis.c.o CMakeFiles/parmetis_prog.dir/io.c.o CMakeFiles/parmetis_prog.dir/adaptgraph.c.o  -o parmetis ../libparmetis/libparmetis.a ../libmetis/libmetis.a -lm 
Undefined symbols for architecture x86_64:
  "_MPI_Allgather", referenced from:
      _libparmetis__gkMPI_Allgather in libparmetis.a(gkmpi.c.o)
  "_MPI_Allgatherv", referenced from:
      _libparmetis__gkMPI_Allgatherv in libparmetis.a(gkmpi.c.o)
  "_MPI_Allreduce", referenced from:
      _ParallelReadMesh in io.c.o
      _AdaptGraph in adaptgraph.c.o
      _libparmetis__gkMPI_Allreduce in libparmetis.a(gkmpi.c.o)
  "_MPI_Alltoall", referenced from:
      _libparmetis__gkMPI_Alltoall in libparmetis.a(gkmpi.c.o)
  "_MPI_Alltoallv", referenced from:
      _libparmetis__gkMPI_Alltoallv in libparmetis.a(gkmpi.c.o)
  "_MPI_Barrier", referenced from:
      _libparmetis__gkMPI_Barrier in libparmetis.a(gkmpi.c.o)
  "_MPI_Bcast", referenced from:
      _ParallelReadMesh in io.c.o
      _Mc_AdaptGraph in adaptgraph.c.o
      _libparmetis__gkMPI_Bcast in libparmetis.a(gkmpi.c.o)
  "_MPI_Comm_dup", referenced from:
      _main in parmetis.c.o
      _libparmetis__SetupCtrl in libparmetis.a(ctrl.c.o)
  "_MPI_Comm_free", referenced from:
      _main in parmetis.c.o
      _libparmetis__gkMPI_Comm_free in libparmetis.a(gkmpi.c.o)
  "_MPI_Comm_rank", referenced from:
      _libparmetis__gkMPI_Comm_rank in libparmetis.a(gkmpi.c.o)
  "_MPI_Comm_size", referenced from:
      _libparmetis__gkMPI_Comm_size in libparmetis.a(gkmpi.c.o)
  "_MPI_Comm_split", referenced from:
      _libparmetis__gkMPI_Comm_split in libparmetis.a(gkmpi.c.o)
  "_MPI_Finalize", referenced from:
      _main in parmetis.c.o
      _ParallelReadGraph in io.c.o
      _ParallelReadMesh in io.c.o
      _libparmetis__gkMPI_Finalize in libparmetis.a(gkmpi.c.o)
  "_MPI_Gatherv", referenced from:
      _libparmetis__gkMPI_Gatherv in libparmetis.a(gkmpi.c.o)
  "_MPI_Get_count", referenced from:
      _libparmetis__gkMPI_Get_count in libparmetis.a(gkmpi.c.o)
  "_MPI_Init", referenced from:
      _main in parmetis.c.o
  "_MPI_Irecv", referenced from:
      _libparmetis__gkMPI_Irecv in libparmetis.a(gkmpi.c.o)
  "_MPI_Isend", referenced from:
      _libparmetis__gkMPI_Isend in libparmetis.a(gkmpi.c.o)
  "_MPI_Recv", referenced from:
      _WritePVector in io.c.o
      _WriteOVector in io.c.o
      _ParallelReadMesh in io.c.o
      _libparmetis__gkMPI_Recv in libparmetis.a(gkmpi.c.o)
  "_MPI_Reduce", referenced from:
      _libparmetis__gkMPI_Reduce in libparmetis.a(gkmpi.c.o)
  "_MPI_Scan", referenced from:
      _libparmetis__gkMPI_Scan in libparmetis.a(gkmpi.c.o)
  "_MPI_Scatterv", referenced from:
      _libparmetis__gkMPI_Scatterv in libparmetis.a(gkmpi.c.o)
  "_MPI_Send", referenced from:
      _Mc_SerialReadGraph in io.c.o
      _WritePVector in io.c.o
      _WriteOVector in io.c.o
      _ParallelReadMesh in io.c.o
      _libparmetis__gkMPI_Send in libparmetis.a(gkmpi.c.o)
  "_MPI_Wait", referenced from:
      _libparmetis__gkMPI_Wait in libparmetis.a(gkmpi.c.o)
  "_MPI_Waitall", referenced from:
      _libparmetis__gkMPI_Waitall in libparmetis.a(gkmpi.c.o)
  "_MPI_Wtime", referenced from:
      _ParMETIS_SerialNodeND in libparmetis.a(pspases.c.o)
      _ParMETIS_V3_AdaptiveRepart in libparmetis.a(ametis.c.o)
      _ParMETIS_V3_NodeND in libparmetis.a(ometis.c.o)
      _libparmetis__MultilevelOrder in libparmetis.a(ometis.c.o)
      _ParMETIS_V32_NodeND in libparmetis.a(ometis.c.o)
      _libparmetis__LocalNDOrder in libparmetis.a(ometis.c.o)
      _ParMETIS_V3_PartGeomKway in libparmetis.a(gkmetis.c.o)
      ...
  "_ompi_mpi_2int", referenced from:
      _libparmetis__PartitionSmallGraph in libparmetis.a(weird.c.o)
  "_ompi_mpi_comm_world", referenced from:
      _main in parmetis.c.o
      _libparmetis__Mc_ComputeSerialPartitionParams in libparmetis.a(serial.c.o)
      _libparmetis__Mc_SerialKWayAdaptRefine in libparmetis.a(serial.c.o)
      _libparmetis__Mc_Serial_FM_2WayRefine in libparmetis.a(serial.c.o)
      _libparmetis__Serial_SelectQueue in libparmetis.a(serial.c.o)
      _libparmetis__BalanceMyLink in libparmetis.a(balancemylink.c.o)
      _libparmetis__RedoMyLink in libparmetis.a(redomylink.c.o)
      ...
  "_ompi_mpi_double", referenced from:
      _libparmetis__PrintTimingInfo in libparmetis.a(timer.c.o)
      _libparmetis__PrintTimer in libparmetis.a(timer.c.o)
  "_ompi_mpi_double_int", referenced from:
      _libparmetis__Balance_Partition in libparmetis.a(initbalance.c.o)
      _libparmetis__InitMultisection in libparmetis.a(initmsection.c.o)
      _libparmetis__InitPartition in libparmetis.a(initpart.c.o)
  "_ompi_mpi_float", referenced from:
      _ReadTestCoordinates in io.c.o
      _libparmetis__GlobalSEMaxFloat in libparmetis.a(comm.c.o)
      _libparmetis__GlobalSEMinFloat in libparmetis.a(comm.c.o)
      _libparmetis__GlobalSESumFloat in libparmetis.a(comm.c.o)
      _libparmetis__Balance_Partition in libparmetis.a(initbalance.c.o)
      _libparmetis__PartitionSmallGraph in libparmetis.a(weird.c.o)
      _libparmetis__ComputeParallelBalance in libparmetis.a(stat.c.o)
      ...
  "_ompi_mpi_int", referenced from:
      _ParallelReadGraph in io.c.o
      _ReadTestGraph in io.c.o
      _ReadTestCoordinates in io.c.o
      _Mc_SerialReadGraph in io.c.o
      _WritePVector in io.c.o
      _WriteOVector in io.c.o
      _ParallelReadMesh in io.c.o
      ...
  "_ompi_mpi_op_max", referenced from:
      _ParallelReadMesh in io.c.o
      _AdaptGraph in adaptgraph.c.o
      _AdaptGraph2 in adaptgraph.c.o
      _libparmetis__GlobalSEMax in libparmetis.a(comm.c.o)
      _libparmetis__GlobalSEMaxComm in libparmetis.a(comm.c.o)
      _libparmetis__GlobalSEMaxFloat in libparmetis.a(comm.c.o)
      _libparmetis__Balance_Partition in libparmetis.a(initbalance.c.o)
      ...
  "_ompi_mpi_op_min", referenced from:
      _ParallelReadMesh in io.c.o
      _AdaptGraph in adaptgraph.c.o
      _AdaptGraph2 in adaptgraph.c.o
      _libparmetis__GlobalSEMin in libparmetis.a(comm.c.o)
      _libparmetis__GlobalSEMinComm in libparmetis.a(comm.c.o)
      _libparmetis__GlobalSEMinFloat in libparmetis.a(comm.c.o)
      _libparmetis__Balance_Partition in libparmetis.a(initbalance.c.o)
      ...
  "_ompi_mpi_op_minloc", referenced from:
      _libparmetis__Balance_Partition in libparmetis.a(initbalance.c.o)
      _libparmetis__PartitionSmallGraph in libparmetis.a(weird.c.o)
      _libparmetis__InitMultisection in libparmetis.a(initmsection.c.o)
      _libparmetis__InitPartition in libparmetis.a(initpart.c.o)
  "_ompi_mpi_op_sum", referenced from:
      _AdaptGraph in adaptgraph.c.o
      _AdaptGraph2 in adaptgraph.c.o
      _libparmetis__MultilevelOrder in libparmetis.a(ometis.c.o)
      _libparmetis__LabelSeparators in libparmetis.a(ometis.c.o)
      _libparmetis__GlobalSESum in libparmetis.a(comm.c.o)
      _libparmetis__GlobalSESumComm in libparmetis.a(comm.c.o)
      _libparmetis__GlobalSESumFloat in libparmetis.a(comm.c.o)
      ...
ld: symbol(s) not found for architecture x86_64
make[3]: *** [programs/parmetis] Error 1
make[2]: *** [programs/CMakeFiles/parmetis_prog.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2

which seems to suggest that the linker is thinking that some portion of parmetis that depends on OpenMPI thinks that the relevant OpenMPI libraries were built as 32-bit, and I'm not sure what the workaround should be.  Any suggestions would be appreciated.

 

Thank you!

0 Kudos
1 Reply
Viet_H_Intel
Moderator
151 Views

It seems to me that libmpi* didn't get link in correctly.

Reply