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

test_kvtree_write_gather.c:3:10: mpi.h: No such file or directory #27

Closed
tonyhutter opened this issue Jun 25, 2019 · 0 comments · Fixed by #28
Closed

test_kvtree_write_gather.c:3:10: mpi.h: No such file or directory #27

tonyhutter opened this issue Jun 25, 2019 · 0 comments · Fixed by #28
Assignees
Labels

Comments

@tonyhutter
Copy link
Contributor

Building master without MPI gives:

[ 47%] Building C object test/CMakeFiles/kvtree_write_gather_test.dir/test_kvtree_write_gather.c.o
/home/hutter/new-kvtree/test/test_kvtree_write_gather.c:3:10: fatal error: mpi.h: No such file or directory
    3 | #include "mpi.h"
      |          ^~~~~~~
compilation terminated.

This fixes it for me:

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 7b76209..5bd817d 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -23,23 +23,24 @@ ADD_TEST(roundtrip_tests test_kvtree)
 # print test script
 FIND_PROGRAM(PRINT_TEST ${CMAKE_CURRENT_SOURCE_DIR}/print_test)
 ADD_TEST(NAME print_test COMMAND ${PRINT_TEST} ${PROJECT_BINARY_DIR}/src/kvtree_print_file ${CMAKE_CURRENT_SOURCE_DIR}/files)
-#ADD_TEST(NAME kvtree_bcast COMMAND "mpirun -np 2 ./kvtree_bcast_test)
+
+IF(MPI_FOUND)
 ADD_EXECUTABLE(kvtree_bcast_test test_kvtree_bcast.c)
 TARGET_LINK_LIBRARIES(kvtree_bcast_test ${KVTREE_EXTERNAL_LIBS} kvtree)
-#ADD_TEST(NAME kvtree_bcast_test COMMAND ${MPIEXEC} -n 3 ./kvtree_bcast_test)
 ADD_TEST(NAME kvtree_bcast_test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 3 ./kvtree_bcast_test)
+
 ADD_EXECUTABLE(kvtree_send_recv_test test_kvtree_send_recv.c)
 TARGET_LINK_LIBRARIES(kvtree_send_recv_test ${KVTREE_EXTERNAL_LIBS} kvtree)
-#ADD_TEST(NAME kvtree_send_recv_test COMMAND ${MPIEXEC} -n 3 ./kvtree_send_recv_test)
 ADD_TEST(NAME kvtree_send_recv_test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 3 ./kvtree_send_recv_test)
+
 ADD_EXECUTABLE(kvtree_exchange_test test_kvtree_exchange.c)
 TARGET_LINK_LIBRARIES(kvtree_exchange_test ${KVTREE_EXTERNAL_LIBS} kvtree)
-#ADD_TEST(NAME kvtree_exchange_test COMMAND ${MPIEXEC} -n 3 ./kvtree_exchange_test)
 ADD_TEST(NAME kvtree_exchange_test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 3 ./kvtree_exchange_test)
+
 ADD_EXECUTABLE(kvtree_write_gather_test test_kvtree_write_gather.c)
 TARGET_LINK_LIBRARIES(kvtree_write_gather_test ${KVTREE_EXTERNAL_LIBS} kvtree)
-#ADD_TEST(NAME kvtree_write_gather_test COMMAND ${MPIEXEC} -n 3 ./kvtree_write_gather_test
 ADD_TEST(NAME kvtree_write_gather_test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 3 ./kvtree_write_gather_test)
+ENDIF(MPI_FOUND)

I havn't tested it yet with MPI to see if that still works.

@tonyhutter tonyhutter added the bug label Jun 25, 2019
@tonyhutter tonyhutter self-assigned this Jun 25, 2019
tonyhutter added a commit to tonyhutter/KVTree that referenced this issue Jun 25, 2019
- Add headers to fix:
test_kvtree_write_gather.c: warning: implicit declaration of function ‘kvtree_write_gather’
test_kvtree_exchange.c: warning: implicit declaration of function ‘kvtree_exchange_sendq

- Only build MPI tests when MPI is present.  Fixes:
test_kvtree_write_gather.c mpi.h: No such file or directory

- Use brackets instead of quotes when including system headers

Fixes: ECP-VeloC#27

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant