Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake detect MPI #38

Open
jeffhammond opened this issue Jun 28, 2017 · 6 comments
Open

CMake detect MPI #38

jeffhammond opened this issue Jun 28, 2017 · 6 comments
Assignees

Comments

@jeffhammond
Copy link
Owner

@gentryx There must be an easy-button to detect MPI. Can you point me to it?

build-cmake jrhammon$ which mpicc
/opt/mpich/dev/intel/default/bin/mpicc
build-cmake jrhammon$ cmake ..
-- The C compiler identification is AppleClang 8.1.0.8020042
-- The CXX compiler identification is AppleClang 8.1.0.8020042
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found MPI_C: /opt/mpich/dev/intel/default/lib/libmpi.dylib;/opt/mpich/dev/intel/default/lib/libpmpi.dylib  
-- Found MPI_CXX: /opt/mpich/dev/intel/default/lib/libmpicxx.dylib;/opt/mpich/dev/intel/default/lib/libmpi.dylib;/opt/mpich/dev/intel/default/lib/libpmpi.dylib  
-- The following options have been configured:


 * BIGMPI_MAX_INT="1000000",
   default="1000000"
   Determines which element count BigMPI will assume to be safe.

 * BIGMPI_VCOLLS="RMA",
   default="RMA"
   Selects which flavor should be used for the implementation of vector collectives (valid options:  RMA, P2P, NBHD_ALLTOALLW)

 * LIB_LINKAGE_TYPE="SHARED",
   default="SHARED"
   Controls which type of library to build. Suggested: SHARED on Linux (creates a shared object "bigmpi.so"), STATIC should work for builds on Cray and Windows.

 * TEST_COVERAGE_VERBOSITY="1",
   default="1"
   Sets the verbosity of the test coverage reoprt (0 = off, 1 = summary, 2 = verbose listing)

CMake Warning (dev) at CMakeLists.txt:37 (add_custom_target):
  Policy CMP0037 is not set: Target names should not be reserved and should
  match a validity pattern.  Run "cmake --help-policy CMP0037" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  The target name "test" is reserved or not valid for certain CMake features,
  such as generator expressions, and may result in undefined behavior.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:87 (message):
  Test coverage: 21/93 functions.


-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   bigmpi

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/jrhammon/Work/MPI/BigMPI/git/build-cmake
@gentryx
Copy link
Collaborator

gentryx commented Jun 28, 2017

The CMake log indicates that it's correctly detecting your MPI install. Am I missing something? Does it not compile?

@jeffhammond
Copy link
Owner Author

Nope, CMake is being stupid and (1) failing to use the MPI wrapper scripts, (2) detecting the wrong compilers for the MPI implementation.

/opt/mpich/dev/intel/ is MPICH compiled with the Intel compilers, not the system Clang/LLVM. If CMake was properly detecting /opt/mpich/dev/intel/, it would find icc and icpc.

-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Found MPI_C: /opt/mpich/dev/intel/default/lib/libmpi.dylib;/opt/mpich/dev/intel/default/lib/libpmpi.dylib 

@jeffhammond
Copy link
Owner Author

jeffhammond commented Jun 28, 2017

The build fails and it also appears to be invoking configure, for reasons I do not understand.

jrhammon-mac01:build-cmake jrhammon$ make
[  2%] Generating ../../src/bigmpiconf.h
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: glibtoolize --copy --force
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'm4'.
glibtoolize: copying file 'm4/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoconf --force
autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:20: installing 'm4/compile'
configure.ac:10: installing 'm4/missing'
Makefile.am: installing 'm4/depcomp'
autoreconf: Leaving directory `.'
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for mpicc... mpicc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether mpicc accepts -g... yes
checking for mpicc option to accept ISO C89... none needed
checking whether mpicc understands -c and -o together... rm: conftest.dSYM: is a directory
yes
checking for style of include used by make... GNU
checking dependency style of mpicc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking build system type... x86_64-apple-darwin16.6.0
checking host system type... x86_64-apple-darwin16.6.0
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by mpicc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... rm: conftest.dSYM: is a directory
BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert x86_64-apple-darwin16.6.0 file names to x86_64-apple-darwin16.6.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin16.6.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... rm: conftest.dSYM: is a directory
no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from mpicc object... rm: conftest.dSYM: is a directory
ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... mpicc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if mpicc supports -fno-rtti -fno-exceptions... yes
checking for mpicc option to produce PIC... -fno-common -DPIC
checking if mpicc PIC flag -fno-common -DPIC works... yes
checking if mpicc static flag -static works... no
checking if mpicc supports -c -o file.o... yes
checking if mpicc supports -c -o file.o... (cached) yes
checking whether the mpicc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin16.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether make supports nested variables... (cached) yes
checking whether the compiler defines __func__... yes
checking whether the compiler defines __FUNC__... no
checking whether the compiler sets __FUNCTION__... yes
checking for variable argument list macro functionality... yes
checking for an ANSI C-conforming const... yes
checking for C/C++ restrict keyword... __restrict
checking for mpicc option to accept ISO C99... -std=gnu99
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking for stdint.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for uint8_t... yes
checking debugging support... no
checking whether safety checks are enabled... yes
checking whether MPI_Type_create_struct is to be avoided... no
checking for maximum integer override... 0
checking pipelined reductions... yes
checking for doxygen... /usr/local/bin/doxygen
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/bigmpiconf.h
config.status: executing depfiles commands
config.status: executing libtool commands
Scanning dependencies of target bigmpi
[  4%] Building C object src/CMakeFiles/bigmpi.dir/collectives_x.c.o
[  6%] Building C object src/CMakeFiles/bigmpi.dir/fileio_x.c.o
[  8%] Building C object src/CMakeFiles/bigmpi.dir/neighborhood_collectives_x.c.o
[ 10%] Building C object src/CMakeFiles/bigmpi.dir/reductions_x.c.o
[ 12%] Building C object src/CMakeFiles/bigmpi.dir/rma_x.c.o
[ 14%] Building C object src/CMakeFiles/bigmpi.dir/sendrecv_x.c.o
[ 16%] Building C object src/CMakeFiles/bigmpi.dir/type_contiguous_x.c.o
[ 18%] Building C object src/CMakeFiles/bigmpi.dir/type_hindexed_x.c.o
[ 20%] Building C object src/CMakeFiles/bigmpi.dir/utils.c.o
[ 22%] Building C object src/CMakeFiles/bigmpi.dir/vcollectives_x.c.o
[ 24%] Linking C shared library libbigmpi.dylib
Undefined symbols for architecture x86_64:
  "_MPI_Abort", referenced from:
      _BigMPI_Error_impl in utils.c.o
      _BigMPI_Collective in vcollectives_x.c.o
  "_MPI_Accumulate", referenced from:
      _MPIX_Accumulate_x in rma_x.c.o
  "_MPI_Allgather", referenced from:
      _MPIX_Allgather_x in collectives_x.c.o
  "_MPI_Alloc_mem", referenced from:
      _MPIX_Reduce_scatter_block_x in reductions_x.c.o
  "_MPI_Allreduce", referenced from:
      _MPIX_Allreduce_x in reductions_x.c.o
  "_MPI_Alltoall", referenced from:
      _MPIX_Alltoall_x in collectives_x.c.o
  "_MPI_Bcast", referenced from:
      _MPIX_Bcast_x in collectives_x.c.o
  "_MPI_Comm_free", referenced from:
      _BigMPI_Collective in vcollectives_x.c.o
  "_MPI_Comm_rank", referenced from:
      _MPIX_Neighbor_allgatherv_x in neighborhood_collectives_x.c.o
      _MPIX_Neighbor_alltoallv_x in neighborhood_collectives_x.c.o
      _MPIX_Neighbor_alltoallw_x in neighborhood_collectives_x.c.o
      _MPIX_Reduce_x in reductions_x.c.o
      _BigMPI_Error_impl in utils.c.o
      _BigMPI_Create_graph_comm in utils.c.o
      _BigMPI_Collective in vcollectives_x.c.o
      ...
  "_MPI_Comm_size", referenced from:
      _MPIX_Neighbor_allgatherv_x in neighborhood_collectives_x.c.o
      _MPIX_Neighbor_alltoallv_x in neighborhood_collectives_x.c.o
      _MPIX_Neighbor_alltoallw_x in neighborhood_collectives_x.c.o
      _MPIX_Reduce_scatter_block_x in reductions_x.c.o
      _BigMPI_Create_graph_comm in utils.c.o
      _BigMPI_Collective in vcollectives_x.c.o
  "_MPI_Comm_test_inter", referenced from:
      _MPIX_Neighbor_allgatherv_x in neighborhood_collectives_x.c.o
      _MPIX_Neighbor_alltoallv_x in neighborhood_collectives_x.c.o
      _MPIX_Neighbor_alltoallw_x in neighborhood_collectives_x.c.o
      _BigMPI_Collective in vcollectives_x.c.o
  "_MPI_Dist_graph_create_adjacent", referenced from:
      _BigMPI_Create_graph_comm in utils.c.o
  "_MPI_File_iread", referenced from:
      _MPIX_File_iread_x in fileio_x.c.o
  "_MPI_File_iread_all", referenced from:
      _MPIX_File_iread_all_x in fileio_x.c.o
  "_MPI_File_iread_at", referenced from:
      _MPIX_File_iread_at_x in fileio_x.c.o
  "_MPI_File_iread_at_all", referenced from:
      _MPIX_File_iread_at_all_x in fileio_x.c.o
  "_MPI_File_iread_shared", referenced from:
      _MPIX_File_iread_shared_x in fileio_x.c.o
  "_MPI_File_iwrite", referenced from:
      _MPIX_File_iwrite_x in fileio_x.c.o
  "_MPI_File_iwrite_all", referenced from:
      _MPIX_File_iwrite_all_x in fileio_x.c.o
  "_MPI_File_iwrite_at", referenced from:
      _MPIX_File_iwrite_at_x in fileio_x.c.o
  "_MPI_File_iwrite_at_all", referenced from:
      _MPIX_File_iwrite_at_all_x in fileio_x.c.o
  "_MPI_File_iwrite_shared", referenced from:
      _MPIX_File_iwrite_shared_x in fileio_x.c.o
  "_MPI_File_read", referenced from:
      _MPIX_File_read_x in fileio_x.c.o
  "_MPI_File_read_all", referenced from:
      _MPIX_File_read_all_x in fileio_x.c.o
  "_MPI_File_read_all_begin", referenced from:
      _MPIX_File_read_all_begin_x in fileio_x.c.o
  "_MPI_File_read_at", referenced from:
      _MPIX_File_read_at_x in fileio_x.c.o
  "_MPI_File_read_at_all", referenced from:
      _MPIX_File_read_at_all_x in fileio_x.c.o
  "_MPI_File_read_at_all_begin", referenced from:
      _MPIX_File_read_at_all_begin_x in fileio_x.c.o
  "_MPI_File_read_ordered", referenced from:
      _MPIX_File_read_ordered_x in fileio_x.c.o
  "_MPI_File_read_ordered_begin", referenced from:
      _MPIX_File_read_ordered_begin_x in fileio_x.c.o
  "_MPI_File_read_shared", referenced from:
      _MPIX_File_read_shared_x in fileio_x.c.o
  "_MPI_File_write", referenced from:
      _MPIX_File_write_x in fileio_x.c.o
  "_MPI_File_write_all", referenced from:
      _MPIX_File_write_all_x in fileio_x.c.o
  "_MPI_File_write_all_begin", referenced from:
      _MPIX_File_write_all_begin_x in fileio_x.c.o
  "_MPI_File_write_at", referenced from:
      _MPIX_File_write_at_x in fileio_x.c.o
  "_MPI_File_write_at_all", referenced from:
      _MPIX_File_write_at_all_x in fileio_x.c.o
  "_MPI_File_write_at_all_begin", referenced from:
      _MPIX_File_write_at_all_begin_x in fileio_x.c.o
  "_MPI_File_write_ordered", referenced from:
      _MPIX_File_write_ordered_x in fileio_x.c.o
  "_MPI_File_write_ordered_begin", referenced from:
      _MPIX_File_write_ordered_begin_x in fileio_x.c.o
  "_MPI_File_write_shared", referenced from:
      _MPIX_File_write_shared_x in fileio_x.c.o
  "_MPI_Free_mem", referenced from:
      _MPIX_Reduce_scatter_block_x in reductions_x.c.o
  "_MPI_Gather", referenced from:
      _MPIX_Gather_x in collectives_x.c.o
  "_MPI_Get", referenced from:
      _MPIX_Get_x in rma_x.c.o
  "_MPI_Get_accumulate", referenced from:
      _MPIX_Get_accumulate_x in rma_x.c.o
  "_MPI_Iallgather", referenced from:
      _MPIX_Iallgather_x in collectives_x.c.o
  "_MPI_Iallreduce", referenced from:
      _MPIX_Iallreduce_x in reductions_x.c.o
  "_MPI_Ialltoall", referenced from:
      _MPIX_Ialltoall_x in collectives_x.c.o
  "_MPI_Ibcast", referenced from:
      _MPIX_Ibcast_x in collectives_x.c.o
  "_MPI_Igather", referenced from:
      _MPIX_Igather_x in collectives_x.c.o
  "_MPI_Imrecv", referenced from:
      _MPIX_Imrecv_x in sendrecv_x.c.o
  "_MPI_Ineighbor_allgather", referenced from:
      _MPIX_Ineighbor_allgather_x in neighborhood_collectives_x.c.o
  "_MPI_Ineighbor_alltoall", referenced from:
      _MPIX_Ineighbor_alltoall_x in neighborhood_collectives_x.c.o
  "_MPI_Irecv", referenced from:
      _MPIX_Irecv_x in sendrecv_x.c.o
  "_MPI_Ireduce", referenced from:
      _MPIX_Ireduce_x in reductions_x.c.o
  "_MPI_Irsend", referenced from:
      _MPIX_Irsend_x in sendrecv_x.c.o
  "_MPI_Iscatter", referenced from:
      _MPIX_Iscatter_x in collectives_x.c.o
  "_MPI_Isend", referenced from:
      _MPIX_Isend_x in sendrecv_x.c.o
  "_MPI_Issend", referenced from:
      _MPIX_Issend_x in sendrecv_x.c.o
  "_MPI_Mrecv", referenced from:
      _MPIX_Mrecv_x in sendrecv_x.c.o
  "_MPI_Neighbor_allgather", referenced from:
      _MPIX_Neighbor_allgather_x in neighborhood_collectives_x.c.o
  "_MPI_Neighbor_alltoall", referenced from:
      _MPIX_Neighbor_alltoall_x in neighborhood_collectives_x.c.o
  "_MPI_Neighbor_alltoallw", referenced from:
      _MPIX_Neighbor_allgatherv_x in neighborhood_collectives_x.c.o
      _MPIX_Neighbor_alltoallv_x in neighborhood_collectives_x.c.o
      _MPIX_Neighbor_alltoallw_x in neighborhood_collectives_x.c.o
      _BigMPI_Collective in vcollectives_x.c.o
  "_MPI_Op_commutative", referenced from:
      _BigMPI_Op_create in reductions_x.c.o
  "_MPI_Op_create", referenced from:
      _BigMPI_Op_create in reductions_x.c.o
  "_MPI_Op_free", referenced from:
      _MPIX_Ireduce_x in reductions_x.c.o
      _MPIX_Iallreduce_x in reductions_x.c.o
  "_MPI_Put", referenced from:
      _MPIX_Put_x in rma_x.c.o
      _BigMPI_Collective in vcollectives_x.c.o
  "_MPI_Raccumulate", referenced from:
      _MPIX_Raccumulate_x in rma_x.c.o
  "_MPI_Recv", referenced from:
      _MPIX_Recv_x in sendrecv_x.c.o
  "_MPI_Reduce", referenced from:
      _MPIX_Reduce_x in reductions_x.c.o
  "_MPI_Reduce_local", referenced from:
      _BigMPI_MAX_x in reductions_x.c.o
      _BigMPI_MIN_x in reductions_x.c.o
      _BigMPI_SUM_x in reductions_x.c.o
      _BigMPI_PROD_x in reductions_x.c.o
      _BigMPI_LAND_x in reductions_x.c.o
      _BigMPI_BAND_x in reductions_x.c.o
      _BigMPI_LOR_x in reductions_x.c.o
      ...
  "_MPI_Reduce_scatter_block", referenced from:
      _MPIX_Reduce_scatter_block_x in reductions_x.c.o
  "_MPI_Rget", referenced from:
      _MPIX_Rget_x in rma_x.c.o
  "_MPI_Rget_accumulate", referenced from:
      _MPIX_Rget_accumulate_x in rma_x.c.o
  "_MPI_Rput", referenced from:
      _MPIX_Rput_x in rma_x.c.o
  "_MPI_Rsend", referenced from:
      _MPIX_Rsend_x in sendrecv_x.c.o
  "_MPI_Scatter", referenced from:
      _MPIX_Scatter_x in collectives_x.c.o
  "_MPI_Send", referenced from:
      _MPIX_Send_x in sendrecv_x.c.o
  "_MPI_Sendrecv", referenced from:
      _MPIX_Sendrecv_x in sendrecv_x.c.o
  "_MPI_Sendrecv_replace", referenced from:
      _MPIX_Sendrecv_replace_x in sendrecv_x.c.o
  "_MPI_Ssend", referenced from:
      _MPIX_Ssend_x in sendrecv_x.c.o
  "_MPI_Type_commit", referenced from:
      _MPIX_Bcast_x in collectives_x.c.o
      _MPIX_Gather_x in collectives_x.c.o
      _MPIX_Scatter_x in collectives_x.c.o
      _MPIX_Allgather_x in collectives_x.c.o
      _MPIX_Alltoall_x in collectives_x.c.o
      _MPIX_Ibcast_x in collectives_x.c.o
      _MPIX_Igather_x in collectives_x.c.o
      ...
  "_MPI_Type_contiguous", referenced from:
      _BigMPI_Type_contiguous in type_contiguous_x.c.o
  "_MPI_Type_create_struct", referenced from:
      _BigMPI_Type_contiguous in type_contiguous_x.c.o
      _MPIX_Type_create_hvector_x in type_hindexed_x.c.o
  "_MPI_Type_free", referenced from:
      _MPIX_Bcast_x in collectives_x.c.o
      _MPIX_Gather_x in collectives_x.c.o
      _MPIX_Scatter_x in collectives_x.c.o
      _MPIX_Allgather_x in collectives_x.c.o
      _MPIX_Alltoall_x in collectives_x.c.o
      _MPIX_Ibcast_x in collectives_x.c.o
      _MPIX_Igather_x in collectives_x.c.o
      ...
  "_MPI_Type_get_contents", referenced from:
      _BigMPI_Decode_contiguous_x in type_contiguous_x.c.o
  "_MPI_Type_get_envelope", referenced from:
      _BigMPI_Decode_contiguous_x in type_contiguous_x.c.o
  "_MPI_Type_get_extent", referenced from:
      _MPIX_Reduce_scatter_block_x in reductions_x.c.o
      _BigMPI_Type_contiguous in type_contiguous_x.c.o
      _BigMPI_Convert_vectors in utils.c.o
      _BigMPI_Collective in vcollectives_x.c.o
  "_MPI_Type_size", referenced from:
      _BigMPI_MAX_x in reductions_x.c.o
      _BigMPI_MIN_x in reductions_x.c.o
      _BigMPI_SUM_x in reductions_x.c.o
      _BigMPI_PROD_x in reductions_x.c.o
      _BigMPI_LAND_x in reductions_x.c.o
      _BigMPI_BAND_x in reductions_x.c.o
      _BigMPI_LOR_x in reductions_x.c.o
      ...
  "_MPI_Type_vector", referenced from:
      _BigMPI_Type_contiguous in type_contiguous_x.c.o
  "_MPI_UNWEIGHTED", referenced from:
      _BigMPI_Create_graph_comm in utils.c.o
  "_MPI_WEIGHTS_EMPTY", referenced from:
      _BigMPI_Create_graph_comm in utils.c.o
  "_MPI_Waitall", referenced from:
      _BigMPI_Collective in vcollectives_x.c.o
  "_MPI_Win_create", referenced from:
      _BigMPI_Collective in vcollectives_x.c.o
  "_MPI_Win_fence", referenced from:
      _BigMPI_Collective in vcollectives_x.c.o
  "_MPI_Win_free", referenced from:
      _BigMPI_Collective in vcollectives_x.c.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/libbigmpi.dylib] Error 1
make[1]: *** [src/CMakeFiles/bigmpi.dir/all] Error 2
make: *** [all] Error 2

@jeffhammond
Copy link
Owner Author

This is the desired result:

jrhammon-mac01:build-cmake jrhammon$ rm -rf *
jrhammon-mac01:build-cmake jrhammon$ cmake .. -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx
-- The C compiler identification is Intel 18.0.0.20170320
-- The CXX compiler identification is Intel 18.0.0.20170320
-- Check for working C compiler: /opt/mpich/dev/intel/default/bin/mpicc
-- Check for working C compiler: /opt/mpich/dev/intel/default/bin/mpicc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/mpich/dev/intel/default/bin/mpicxx
-- Check for working CXX compiler: /opt/mpich/dev/intel/default/bin/mpicxx -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found MPI_C: /opt/mpich/dev/intel/default/lib/libmpi.dylib;/opt/mpich/dev/intel/default/lib/libpmpi.dylib  
-- Found MPI_CXX: /opt/mpich/dev/intel/default/lib/libmpicxx.dylib;/opt/mpich/dev/intel/default/lib/libmpi.dylib;/opt/mpich/dev/intel/default/lib/libpmpi.dylib  
-- The following options have been configured:


 * BIGMPI_MAX_INT="1000000",
   default="1000000"
   Determines which element count BigMPI will assume to be safe.

 * BIGMPI_VCOLLS="RMA",
   default="RMA"
   Selects which flavor should be used for the implementation of vector collectives (valid options:  RMA, P2P, NBHD_ALLTOALLW)

 * LIB_LINKAGE_TYPE="SHARED",
   default="SHARED"
   Controls which type of library to build. Suggested: SHARED on Linux (creates a shared object "bigmpi.so"), STATIC should work for builds on Cray and Windows.

 * TEST_COVERAGE_VERBOSITY="1",
   default="1"
   Sets the verbosity of the test coverage reoprt (0 = off, 1 = summary, 2 = verbose listing)

CMake Warning (dev) at CMakeLists.txt:37 (add_custom_target):
  Policy CMP0037 is not set: Target names should not be reserved and should
  match a validity pattern.  Run "cmake --help-policy CMP0037" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  The target name "test" is reserved or not valid for certain CMake features,
  such as generator expressions, and may result in undefined behavior.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:87 (message):
  Test coverage: 21/93 functions.


-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   bigmpi

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/jrhammon/Work/MPI/BigMPI/git/build-cmake
jrhammon-mac01:build-cmake jrhammon$ make
Scanning dependencies of target bigmpi
[  2%] Building C object src/CMakeFiles/bigmpi.dir/collectives_x.c.o
[  4%] Building C object src/CMakeFiles/bigmpi.dir/fileio_x.c.o
[  6%] Building C object src/CMakeFiles/bigmpi.dir/neighborhood_collectives_x.c.o
[  8%] Building C object src/CMakeFiles/bigmpi.dir/reductions_x.c.o
[ 10%] Building C object src/CMakeFiles/bigmpi.dir/rma_x.c.o
[ 12%] Building C object src/CMakeFiles/bigmpi.dir/sendrecv_x.c.o
[ 14%] Building C object src/CMakeFiles/bigmpi.dir/type_contiguous_x.c.o
[ 16%] Building C object src/CMakeFiles/bigmpi.dir/type_hindexed_x.c.o
[ 18%] Building C object src/CMakeFiles/bigmpi.dir/utils.c.o
[ 20%] Building C object src/CMakeFiles/bigmpi.dir/vcollectives_x.c.o
[ 22%] Linking C shared library libbigmpi.dylib
[ 24%] Built target bigmpi
Scanning dependencies of target test_ssend_recv_x
[ 26%] Building C object test/CMakeFiles/test_ssend_recv_x.dir/test_ssend_recv_x.c.o
[ 28%] Linking C executable test_ssend_recv_x
[ 28%] Built target test_ssend_recv_x
Scanning dependencies of target test_rsend_recv_x
[ 30%] Building C object test/CMakeFiles/test_rsend_recv_x.dir/test_rsend_recv_x.c.o
[ 32%] Linking C executable test_rsend_recv_x
[ 32%] Built target test_rsend_recv_x
Scanning dependencies of target test_rma_x
[ 34%] Building C object test/CMakeFiles/test_rma_x.dir/test_rma_x.c.o
[ 36%] Linking C executable test_rma_x
[ 36%] Built target test_rma_x
Scanning dependencies of target test_alltoall_x
[ 38%] Building C object test/CMakeFiles/test_alltoall_x.dir/test_alltoall_x.c.o
[ 40%] Linking C executable test_alltoall_x
[ 40%] Built target test_alltoall_x
Scanning dependencies of target test_rma2_x
[ 42%] Building C object test/CMakeFiles/test_rma2_x.dir/test_rma2_x.c.o
[ 44%] Linking C executable test_rma2_x
[ 44%] Built target test_rma2_x
Scanning dependencies of target test_irsend_irecv_x
[ 46%] Building C object test/CMakeFiles/test_irsend_irecv_x.dir/test_irsend_irecv_x.c.o
[ 48%] Linking C executable test_irsend_irecv_x
[ 48%] Built target test_irsend_irecv_x
Scanning dependencies of target test_allgather_x
[ 50%] Building C object test/CMakeFiles/test_allgather_x.dir/test_allgather_x.c.o
[ 52%] Linking C executable test_allgather_x
[ 52%] Built target test_allgather_x
Scanning dependencies of target test_issend_irecv_x
[ 54%] Building C object test/CMakeFiles/test_issend_irecv_x.dir/test_issend_irecv_x.c.o
[ 56%] Linking C executable test_issend_irecv_x
[ 56%] Built target test_issend_irecv_x
Scanning dependencies of target test_isend_irecv_x
[ 58%] Building C object test/CMakeFiles/test_isend_irecv_x.dir/test_isend_irecv_x.c.o
[ 60%] Linking C executable test_isend_irecv_x
[ 60%] Built target test_isend_irecv_x
Scanning dependencies of target test_scatter_x
[ 62%] Building C object test/CMakeFiles/test_scatter_x.dir/test_scatter_x.c.o
[ 64%] Linking C executable test_scatter_x
[ 64%] Built target test_scatter_x
Scanning dependencies of target test_gather_x
[ 66%] Building C object test/CMakeFiles/test_gather_x.dir/test_gather_x.c.o
[ 68%] Linking C executable test_gather_x
[ 68%] Built target test_gather_x
Scanning dependencies of target test_factorize
[ 70%] Building C object test/CMakeFiles/test_factorize.dir/test_factorize.c.o
[ 72%] Linking C executable test_factorize
[ 72%] Built target test_factorize
Scanning dependencies of target test_reduce_x
[ 74%] Building C object test/CMakeFiles/test_reduce_x.dir/test_reduce_x.c.o
[ 76%] Linking C executable test_reduce_x
[ 76%] Built target test_reduce_x
Scanning dependencies of target test_bcast_x
[ 78%] Building C object test/CMakeFiles/test_bcast_x.dir/test_bcast_x.c.o
[ 80%] Linking C executable test_bcast_x
[ 80%] Built target test_bcast_x
Scanning dependencies of target test_assert_x
[ 82%] Building C object test/CMakeFiles/test_assert_x.dir/test_assert_x.c.o
[ 84%] Linking C executable test_assert_x
[ 84%] Built target test_assert_x
Scanning dependencies of target test_send_recv_x
[ 86%] Building C object test/CMakeFiles/test_send_recv_x.dir/test_send_recv_x.c.o
[ 88%] Linking C executable test_send_recv_x
[ 88%] Built target test_send_recv_x
Scanning dependencies of target test_allreduce_x
[ 90%] Building C object test/CMakeFiles/test_allreduce_x.dir/test_allreduce_x.c.o
[ 92%] Linking C executable test_allreduce_x
[ 92%] Built target test_allreduce_x
Scanning dependencies of target test_sendrecv_x
[ 94%] Building C object test/CMakeFiles/test_sendrecv_x.dir/test_sendrecv_x.c.o
[ 96%] Linking C executable test_sendrecv_x
[ 96%] Built target test_sendrecv_x
Scanning dependencies of target test_contig_x
[ 98%] Building C object test/CMakeFiles/test_contig_x.dir/test_contig_x.c.o
[100%] Linking C executable test_contig_x
[100%] Built target test_contig_x

@gentryx
Copy link
Collaborator

gentryx commented Jun 29, 2017

Actually this is working as intended. Yes, you could override the compiler selection from the CMake script based on what find_package(MPI) digs up, but that would mean that you'd override the user's compiler selection.

@jeffhammond
Copy link
Owner Author

jeffhammond commented Jun 29, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants