Hi I'm trying to compile a main program (it contains MPI functions) using cmake. I get an executable file (there aren't problems in compilation ), but it doesn't run correctly.
If I compile my code using a simple Makefile, it works; but I need to compile it using cmake (that's a prerequisite for my work). I have installed MPICH2 and cmake 2.8.4. and I use the next files: CMakeLists.txt: cmake_minimum_required(VERSION 2.7) set(CMAKE_CXX_COMPILER "/home/lola/Packages/mpich2-1.3.2p1/bin/mpicxx") set(CMAKE_C_COMPILER "/home/lola/Packages/mpich2-1.3.2p1/bin/mpicc") project( ITK_MPI ) find_package ( MPI ) if ( MPI_FOUND ) include_directories( ${MPI_INCLUDE_PATH} ) endif( MPI_FOUND ) ------------------------------------------------------------------------------------------------------ CMakeCache.txt: ..... ...... //CXX compiler. CMAKE_CXX_COMPILER:FILEPATH=/home/lola/Packages/mpich2-1.3.2p1/bin/mpicxx //Flags used by the compiler during all build types. CMAKE_CXX_FLAGS:STRING= //Flags used by the compiler during debug builds. CMAKE_CXX_FLAGS_DEBUG:STRING= //Flags used by the compiler during release minsize builds. CMAKE_CXX_FLAGS_MINSIZEREL:STRING= //Flags used by the compiler during release builds (/MD /Ob1 /Oi // /Ot /Oy /Gs will produce slightly less optimized but smaller // files). CMAKE_CXX_FLAGS_RELEASE:STRING= //Flags used by the compiler during Release with Debug Info builds. CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING= //C compiler. CMAKE_C_COMPILER:FILEPATH=/home/lola/Packages/mpich2-1.3.2p1/bin/mpicc .... .... //Value Computed by CMake ITK_MPI_BINARY_DIR:STATIC=/home/lola/Curso/Proyecto/Pruebas_MPI //Value Computed by CMake ITK_MPI_SOURCE_DIR:STATIC=/home/lola/Curso/Proyecto/Pruebas_MPI //Executable for running MPI programs. MPIEXEC:FILEPATH=/home/lola/Packages/mpich2-1.3.2p1/bin/mpiexec //Maximum number of processors available to run MPI applications. MPIEXEC_MAX_NUMPROCS:STRING=2 //Flag used by MPI to specify the number of processes for MPIEXEC; // the next option will be the number of processes. MPIEXEC_NUMPROC_FLAG:STRING=-n2 //These flags will come after all flags given to MPIEXEC. MPIEXEC_POSTFLAGS:STRING= //These flags will be directly before the executable that is being // run by MPIEXEC. MPIEXEC_PREFLAGS:STRING= //MPI compiler. Used only to detect MPI compilation flags. MPI_COMPILER:FILEPATH=/home/lola/Packages/mpich2-1.3.2p1/bin/mpicxx //MPI compilation flags MPI_COMPILE_FLAGS:STRING=' ' //Extra MPI libraries to link against MPI_EXTRA_LIBRARY:STRING=/usr/lib/mpich/lib/libmpich.a;/usr/lib/libpthread.so;/usr/lib/librt.so //MPI include path MPI_INCLUDE_PATH:STRING=/home/lola/Packages/mpich2-1.3.2p1/include //MPI library to link against MPI_LIBRARY:FILEPATH=/usr/lib/mpich/lib/libpmpich++.a;/usr/lib/mpich/lib/libmpich.a;/usr/lib/libpthread.so;/usr/lib/librt.so //MPI linking flags MPI_LINK_FLAGS:STRING= ..... .... ¿What's am I doing wrong?, ¿Is there any other configuration?. I really need to make it work. Thank you Lola
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake