<div dir="ltr"><div><div>Thanks for the help.<br><br>I did that but still the error persists.<br><br><span style="font-family:courier new,monospace">The C compiler identification is GNU<br>-- Check for working C compiler: /export/home/bibrak/MPJExpress_Project/work/programs/installs/bin/gcc<br>

-- Check for working C compiler: /export/home/bibrak/MPJExpress_Project/work/programs/installs/bin/gcc -- works<br>-- Detecting C compiler ABI info<br>-- Detecting C compiler ABI info - done<br>-- Found MPI: /export/home/bibrak/MPJExpress_Project/work/programs/mpich3_installed/lib/libmpichcxx.so<br>

-- Configuring done<br>-- Generating done</span><br><br><br></div>It finds <span style="font-family:courier new,monospace"><b>libmpichcxx.so</b></span> furthermore when I issue the make command it throws the error that <span style="font-family:courier new,monospace">mpi.h</span> not found. <br>

<br></div><div>Here is one of the entry in the depend.make file <br><span style="font-family:courier new,monospace"><br>CMakeFiles/nativempjdev.dir/mpjdev_natmpjdev_Comm.c.o: ../mpjdev_natmpjdev_Comm.c<br>CMakeFiles/nativempjdev.dir/mpjdev_natmpjdev_Comm.c.o: ../mpjdev_natmpjdev_Comm.h<br>

CMakeFiles/nativempjdev.dir/mpjdev_natmpjdev_Comm.c.o: ../mpjdev_natmpjdev_shared.h<br>CMakeFiles/nativempjdev.dir/mpjdev_natmpjdev_Comm.c.o: /usr/java/latest/include/jni.h<br>CMakeFiles/nativempjdev.dir/mpjdev_natmpjdev_Comm.c.o: /usr/java/latest/include/linux/jni_md.h</span><br>

<br></div><div>Some how can't add <b>mpi.h </b><br></div><div><div><br></div><div>Does it mean this is not populated correctly ?<b><span style="font-family:courier new,monospace"> ${MPI_C_INCLUDE_PATH}</span></b><br>
</div>
<div><br><br><br><br></div></div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><span style="color:rgb(0,0,0)">Bibrak Qamar</span><br style="color:rgb(0,0,0)"><span style="color:rgb(0,0,0)"><br></span><font color="#888888"></font></div>

</div>
<br><br><div class="gmail_quote">On Tue, Mar 18, 2014 at 11:22 AM, Bruce Cartland <span dir="ltr"><<a href="mailto:bruce.cartland@pobox.com" target="_blank">bruce.cartland@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Try the project command<br>
    <br>
    * project(yourProjectName C)<br>
    <br>
    It's what I use.<br>
    <br>
    Quick Google found this <br>
    <br>
    * <a href="http://www.cmake.org/cmake/help/cmake2.6docs.html#command:project" target="_blank">http://www.cmake.org/cmake/help/cmake2.6docs.html#command:project</a><div><div class="h5"><br>
    <br>
    <br>
    <div>On 18/03/14 17:09, Bibrak Qamar wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div>Hi,<br>
          <br>
        </div>
        I am using cmake to create Makefile. I am using MPI in my
        project but I only want to use the C (mpicc) not C++ (mpicxx)
        following is the CMakeLists.txt:<br>
        <div>
          <div><br>
          </div>
          <div>I have tested it but on some platforms it seems that it
            only detects the C++ mpi (mpicxx) and uses its libraries.
            This creates errors (mpi.h not found) as the project only
            needs C (mpicc and its libraries).<br>
            <br>
          </div>
          <div>So how to force cmake to only search for C (mpicc) and
            use its libraries (the mpi.h not mpicxx.h).<br>
          </div>
          <div><br>
            <span style="font-family:courier new,monospace"><br>
              <br>
              ADD_LIBRARY(nativempjdev SHARED ${SOURCE_FILES})<br>
              <br>
              find_package(MPI)<br>
              if(MPI_FOUND)<br>
              set(CMAKE_C_COMPILE_FLAGS ${CMAKE_C_COMPILE_FLAGS}
              ${MPI_C_COMPILE_FLAGS})<br>
              set(CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS}
              ${MPI_C_LINK_FLAGS})<br>
              <br>
              include_directories(${MPI_C_INCLUDE_PATH}
              $ENV{JAVA_HOME}/include $ENV{JAVA_HOME}/include/linux)<br>
              endif(MPI_FOUND)<br>
              target_link_libraries(nativempjdev ${MPI_C_LIBRARIES})<br>
              install(TARGETS nativempjdev DESTINATION
              $ENV{MPJ_HOME}/lib)</span><br>
            <br>
            <br>
            <br>
          </div>
          <div>Thanks<br clear="all">
          </div>
          <div>
            <div>
              <div dir="ltr">
                <span>Bibrak Qamar</span><br>
                <span><br>
                </span></div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
    </blockquote>
    <br>
  </div></div></div>

<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div>