LLNL/Caliper

Cannot build with MPI on MacOS

KokoFan16 opened this issue · 2 comments

I used this command to compile Caliper with MPI on MacOS:
$cmake -DWITH_MPI=yes ..

-- Caliper configuration summary:
-- Caliper version : 2.8.0-dev
-- Build type :
-- Compiler : AppleClang 13.0.0.13000029 (/Library/Developer/CommandLineTools/usr/bin/c++)
-- System : Darwin-20.6.0 (x86_64)
-- Install dir : /usr/local
-- Build shared libs : ON
-- Build Caliper tools : ON
-- Build tests : OFF
-- Fortran support : No
-- cpuinfo support : No
-- memusage support : No
-- adiak support : No
-- GOTCHA support : No
-- PAPI support : No
-- Libdw support : No
-- Libpfm support : No
-- Libunwind support : No
-- Sampler support : No
-- SOSFlow support : No
-- MPI support : Yes, using /usr/local/Cellar/mpich/4.0.1/lib/libmpi.dylib;/usr/local/Cellar/mpich/4.0.1/lib/libpmpi.dylib
-- MPIWRAP support : Yes, using PMPI
-- MPIT support : No
-- OMPT support : No
-- Nvtx support : No
-- CUpti support : No
-- Kokkos support : Yes
-- RocTracer support : No
-- RocTX support : No
-- TAU support : No
-- VTune support : No
-- PCP support : No
-- histogram support : No
-- variorum support : No
-- umpire support : No
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Documents/project/Caliper/build

But it failed with the error below:
...
[ 89%] Built target caliper-mpi
[ 90%] Building CXX object src/CMakeFiles/caliper.dir/caliper/machine_mpi.cpp.o
[ 92%] Building CXX object src/CMakeFiles/caliper.dir/caliper/setup_mpi.cpp.o
[ 92%] Linking CXX shared library libcaliper.dylib
Undefined symbols for architecture x86_64:
"_PMPI_Status_f082c", referenced from:
_MPI_Status_f082c in Wrapper.cpp.o
"_PMPI_Status_f082f", referenced from:
_MPI_Status_f082f in Wrapper.cpp.o
"_PMPI_Status_f2f08", referenced from:
_MPI_Status_f2f08 in Wrapper.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/libcaliper.2.8.0-dev.dylib] Error 1
make[1]: *** [src/CMakeFiles/caliper.dir/all] Error 2
make: *** [all] Error 2

Is anyone familiar with this issue?

Hi @KokoFan16 ,

Thanks for the report! I've added a patch that should fix this. Can you try and confirm? You may have to create a new build directory.

Hi @daboehme, it works well now.
Thanks!