Configure MPI programs in eclipse

Al Salamu 3alykom Wa Ra7matULLAH

if u r familiar with the distributed computing, then u have used,seen or even heard about MPICH well, here are the steps u follow to make and run an MPICH program

1-download and install the MPICH executable form their website

2-include the headers and add the lib files

3-write ur program and build it

4-and after solving the errors that will reveal in ur code :D

go to the mpich bin directory -All programs in the start menu if u r a windows user- and open the mpirun program and browse for the executable u have built, configure the number of processes to run and finally run in well...

the first step is repeated once per installation,the second is repeated per project and the last two are per the number of logical errors found in ur code, which is a good number :D and since programmers are lazy i've figured out the way to run the MPICH programs in the eclipse's console first i'll show the steps of adding the libraries  and the includes - Create a C/C++ project - Select that project and RMB-> Properties , expand the C/C++ build and choose Settings -> GCC C++ compiler - Select "Directories" and add the directory where the MPICH header files are installed

and also adding the libraries to the linker in the GCC C++ Linker

after this step u r ready to write the programs as u like then comes the step for configuring the run to have the programs run in the eclipse's console without opening the mpirun explicitly choose the run configurations and edit it as follows

i think the "Program is not recognized executable" won't affect, just apply it

and in the arguments tab

notice the variables sent "-np 4"

which means "number of processes to be run are 4" u can change it as u like or as needed after those configurations u can run the MPI programs u write through the eclipse's console i hope that helps somebody :)

Thanks for your effort but I think you forget to put the compiler "mpicc" ....Also -np define number of processes not number of processors Good Work... Salam
about the mpicc, u don't have to use it, i use the normal c++ compiler about the -np, u r right :)
It will not work. You have to put "mpicc" in "Gcc C compiler" field.....If you make it with g++ or gcc it will not work.
but i've already passed a couple of semesters without the mpicc, and i was the only one who completed the practical exam correctly in HPC which was mpich program :D just the g++ !!! :D
Ok Try it from command line and tell me what are the results. Try >gcc mpi-app2.c the output will be something like that mpi-app2.c:2:17: error: mpi.h: No such file or directory mpi-app2.c: In function ‘main’: mpi-app2.c:14: error: ‘MPI_MAX_PROCESSOR_NAME’ undeclared (first use in this function) mpi-app2.c:14: error: (Each undeclared identifier is reported only once mpi-app2.c:14: error: for each function it appears in.) mpi-app2.c:15: error: ‘MPI_Status’ undeclared (first use in this function) mpi-app2.c:15: error: expected ‘;’ before ‘status’ mpi-app2.c:18: error: ‘MPI_COMM_WORLD’ undeclared (first use in this function) mpi-app2.c:25: error: ‘MPI_CHAR’ undeclared (first use in this function) mpi-app2.c:30: error: ‘status’ undeclared (first use in this function) If you used mpicc >mpicc mpi-app2 it will be compiled correctly So you have to use mpicc......I dont know how it worked with you... Try it and tell me
well... i've tried it but the three of them produced the same error output u have mentioned "g++, gcc and mpicc" so i ran the command that eclipse invokes to build the file g++ -I/usr/lib/mpich/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp" and the three of them compiled correctly thats because u have to specify the include path while u compile may be it's configured for mpicc on ur machine, but it wasn't here...
Ok that is now make sense.....This command is right but you can make it in an easy way. If you want to run it directly with mpicc just export the include library in the environment variable PATH and it will work without the need for all of this line also export the bin directory...... Good Luck
if I run my MPI program as here (on shell linux): ----------------------------------------- $ mpd& $ mpicc -o myProgram myProgram.c $ mpirun -np 4 myProgram ----------------------------------------- it work correctly! but if I try to run it with eclipse (configured as this guide), it don't work correctly. I have this error on eclipse console: ----------------------------------------- **** Build of configuration Debug for project HelloMPI **** make all Building target: HelloMPI Invoking: GCC C Linker gcc -L/usr/local/mpich2-1.2/lib -o"HelloMPI" ./src/HelloMPI.o -lmpich /usr/local/mpich2-1.2/lib/libmpich.a(commutil.o): In function `MPIR_Get_contextid': commutil.c:(.text+0x8ea): undefined reference to `pthread_getspecific' commutil.c:(.text+0x923): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(commutil.o): In function `MPIR_Get_intercomm_contextid': commutil.c:(.text+0x1304): undefined reference to `pthread_getspecific' commutil.c:(.text+0x1335): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(errutil.o): In function `MPIR_Err_return_comm': errutil.c:(.text+0x23d9): undefined reference to `pthread_getspecific' errutil.c:(.text+0x240a): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(errutil.o): In function `MPIR_Err_return_win': errutil.c:(.text+0x2539): undefined reference to `pthread_getspecific' errutil.c:(.text+0x256a): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(errutil.o): In function `MPIR_Nest_decr_export': errutil.c:(.text+0x25e9): undefined reference to `pthread_getspecific' errutil.c:(.text+0x2616): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(errutil.o): In function `MPIR_Nest_incr_export': errutil.c:(.text+0x2649): undefined reference to `pthread_getspecific' errutil.c:(.text+0x2676): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(init.o): In function `MPI_Init': init.c:(.text+0x169): undefined reference to `pthread_getspecific' init.c:(.text+0x19a): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(initthread.o): In function `MPIR_Init_thread': initthread.c:(.text+0x2f9): undefined reference to `pthread_getspecific' initthread.c:(.text+0x326): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(initthread.o): In function `MPIR_Thread_CS_Finalize': initthread.c:(.text+0x3b6): undefined reference to `pthread_key_delete' initthread.c:(.text+0x3d1): undefined reference to `pthread_getspecific' initthread.c:(.text+0x3f4): undefined reference to `pthread_setspecific' initthread.c:(.text+0x423): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(initthread.o): In function `MPIR_Thread_CS_Init': initthread.c:(.text+0x446): undefined reference to `pthread_key_create' /usr/local/mpich2-1.2/lib/libmpich.a(initthread.o): In function `MPI_Init_thread': initthread.c:(.text+0x5a9): undefined reference to `pthread_getspecific' initthread.c:(.text+0x5da): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(finalize.o): In function `MPI_Finalize': finalize.c:(.text+0x2c): undefined reference to `pthread_getspecific' finalize.c:(.text+0x351): undefined reference to `pthread_getspecific' finalize.c:(.text+0x382): undefined reference to `pthread_setspecific' finalize.c:(.text+0x399): undefined reference to `pthread_getspecific' finalize.c:(.text+0x3ca): undefined reference to `pthread_setspecific' finalize.c:(.text+0x3f6): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(recv.o): In function `MPI_Recv': recv.c:(.text+0x33): undefined reference to `pthread_getspecific' recv.c:(.text+0x279): undefined reference to `pthread_getspecific' recv.c:(.text+0x2aa): undefined reference to `pthread_setspecific' recv.c:(.text+0x2db): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(send.o): In function `MPI_Send': send.c:(.text+0x33): undefined reference to `pthread_getspecific' send.c:(.text+0x269): undefined reference to `pthread_getspecific' send.c:(.text+0x29a): undefined reference to `pthread_setspecific' send.c:(.text+0x59b): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(mpid_type_debug.o): In function `MPIDI_Datatype_printf': mpid_type_debug.c:(.text+0x879): undefined reference to `pthread_getspecific' mpid_type_debug.c:(.text+0x8a6): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(ch3u_handle_recv_req.o): In function `MPIDI_CH3_ReqHandler_AccumRespDerivedDTComplete': ch3u_handle_recv_req.c:(.text+0x1189): undefined reference to `pthread_getspecific' ch3u_handle_recv_req.c:(.text+0x11ba): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(ch3u_handle_recv_req.o): In function `MPIDI_CH3_ReqHandler_PutAccumRespComplete': ch3u_handle_recv_req.c:(.text+0x1829): undefined reference to `pthread_getspecific' ch3u_handle_recv_req.c:(.text+0x185a): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(ch3u_rma_sync.o): In function `MPIDI_CH3_PktHandler_Accumulate': ch3u_rma_sync.c:(.text+0x1431): undefined reference to `pthread_getspecific' ch3u_rma_sync.c:(.text+0x1462): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(ch3u_rma_sync.o): In function `MPIDI_Win_post': ch3u_rma_sync.c:(.text+0x41a9): undefined reference to `pthread_getspecific' ch3u_rma_sync.c:(.text+0x41dc): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(ch3u_rma_sync.o): In function `MPIDI_Win_complete': ch3u_rma_sync.c:(.text+0x66e9): undefined reference to `pthread_getspecific' ch3u_rma_sync.c:(.text+0x671c): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(ch3u_rma_sync.o): In function `MPIDI_Win_fence': ch3u_rma_sync.c:(.text+0x71e9): undefined reference to `pthread_getspecific' ch3u_rma_sync.c:(.text+0x721c): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(mpid_finalize.o): In function `MPID_Finalize': mpid_finalize.c:(.text+0x169): undefined reference to `pthread_getspecific' mpid_finalize.c:(.text+0x19a): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(allreduce.o): In function `MPIR_Allreduce_inter': allreduce.c:(.text+0x241): undefined reference to `pthread_getspecific' allreduce.c:(.text+0x272): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(allreduce.o): In function `MPIR_Allreduce': allreduce.c:(.text+0x669): undefined reference to `pthread_getspecific' allreduce.c:(.text+0x69c): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(allreduce.o): In function `MPI_Allreduce': allreduce.c:(.text+0x114c): undefined reference to `pthread_getspecific' allreduce.c:(.text+0x1381): undefined reference to `pthread_getspecific' allreduce.c:(.text+0x13b2): undefined reference to `pthread_setspecific' allreduce.c:(.text+0x1683): undefined reference to `pthread_setspecific' allreduce.c:(.text+0x1f18): undefined reference to `pthread_getspecific' allreduce.c:(.text+0x1f49): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(barrier.o): In function `MPI_Barrier': barrier.c:(.text+0x3fb): undefined reference to `pthread_getspecific' barrier.c:(.text+0x609): undefined reference to `pthread_getspecific' barrier.c:(.text+0x63a): undefined reference to `pthread_setspecific' barrier.c:(.text+0x6c3): undefined reference to `pthread_setspecific' barrier.c:(.text+0x825): undefined reference to `pthread_getspecific' barrier.c:(.text+0x856): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(op_create.o): In function `MPI_Op_create': op_create.c:(.text+0x2b): undefined reference to `pthread_getspecific' op_create.c:(.text+0xd9): undefined reference to `pthread_getspecific' op_create.c:(.text+0x106): undefined reference to `pthread_setspecific' op_create.c:(.text+0x1e3): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(bcast.o): In function `MPIR_Bcast': bcast.c:(.text+0x1559): undefined reference to `pthread_getspecific' bcast.c:(.text+0x158a): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(bcast.o): In function `MPI_Bcast': bcast.c:(.text+0x1fcc): undefined reference to `pthread_getspecific' bcast.c:(.text+0x21f9): undefined reference to `pthread_getspecific' bcast.c:(.text+0x222a): undefined reference to `pthread_setspecific' bcast.c:(.text+0x24bb): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(reduce.o): In function `MPIR_Reduce': reduce.c:(.text+0x3d1): undefined reference to `pthread_getspecific' reduce.c:(.text+0x40a): undefined reference to `pthread_setspecific' reduce.c:(.text+0x459): undefined reference to `pthread_getspecific' reduce.c:(.text+0x492): undefined reference to `pthread_setspecific' reduce.c:(.text+0x1142): undefined reference to `pthread_getspecific' reduce.c:(.text+0x117b): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(reduce.o): In function `MPIR_Reduce_inter': reduce.c:(.text+0x1861): undefined reference to `pthread_getspecific' reduce.c:(.text+0x1892): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(reduce.o): In function `MPI_Reduce': reduce.c:(.text+0x1be7): undefined reference to `pthread_getspecific' reduce.c:(.text+0x1e61): undefined reference to `pthread_getspecific' reduce.c:(.text+0x1e94): undefined reference to `pthread_setspecific' reduce.c:(.text+0x21d4): undefined reference to `pthread_setspecific' reduce.c:(.text+0x3325): undefined reference to `pthread_getspecific' reduce.c:(.text+0x3358): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(red_scat.o): In function `MPIR_Reduce_scatter': red_scat.c:(.text+0x931): undefined reference to `pthread_getspecific' red_scat.c:(.text+0x96a): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(red_scat.o): In function `MPI_Reduce_scatter': red_scat.c:(.text+0x2a80): undefined reference to `pthread_getspecific' red_scat.c:(.text+0x2cc1): undefined reference to `pthread_getspecific' red_scat.c:(.text+0x2cf4): undefined reference to `pthread_setspecific' red_scat.c:(.text+0x2ddc): undefined reference to `pthread_setspecific' red_scat.c:(.text+0x3623): undefined reference to `pthread_getspecific' red_scat.c:(.text+0x3656): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(helper_fns.o): In function `MPIR_Localcopy': helper_fns.c:(.text+0x429): undefined reference to `pthread_getspecific' helper_fns.c:(.text+0x462): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(helper_fns.o): In function `MPIC_Sendrecv_replace': helper_fns.c:(.text+0x1011): undefined reference to `pthread_getspecific' helper_fns.c:(.text+0x1042): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(opsum.o): In function `MPIR_SUM': opsum.c:(.text+0xb32): undefined reference to `pthread_getspecific' opsum.c:(.text+0xb63): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(opmax.o): In function `MPIR_MAXF': opmax.c:(.text+0xafb): undefined reference to `pthread_getspecific' opmax.c:(.text+0xb2c): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(opmin.o): In function `MPIR_MINF': opmin.c:(.text+0xafb): undefined reference to `pthread_getspecific' opmin.c:(.text+0xb2c): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(opband.o): In function `MPIR_BAND': opband.c:(.text+0x7f9): undefined reference to `pthread_getspecific' opband.c:(.text+0x82a): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(opbor.o): In function `MPIR_BOR': opbor.c:(.text+0x7f9): undefined reference to `pthread_getspecific' opbor.c:(.text+0x82a): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(opbxor.o): In function `MPIR_BXOR': opbxor.c:(.text+0x7f9): undefined reference to `pthread_getspecific' opbxor.c:(.text+0x82a): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(opland.o): In function `MPIR_LAND': opland.c:(.text+0xc40): undefined reference to `pthread_getspecific' opland.c:(.text+0xc71): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(oplor.o): In function `MPIR_LOR': oplor.c:(.text+0xcf8): undefined reference to `pthread_getspecific' oplor.c:(.text+0xd29): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(oplxor.o): In function `MPIR_LXOR': oplxor.c:(.text+0xdfc): undefined reference to `pthread_getspecific' oplxor.c:(.text+0xe2d): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(opprod.o): In function `MPIR_PROD': opprod.c:(.text+0xd50): undefined reference to `pthread_getspecific' opprod.c:(.text+0xd81): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(opminloc.o): In function `MPIR_MINLOC': opminloc.c:(.text+0x339): undefined reference to `pthread_getspecific' opminloc.c:(.text+0x36a): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(opmaxloc.o): In function `MPIR_MAXLOC': opmaxloc.c:(.text+0x339): undefined reference to `pthread_getspecific' opmaxloc.c:(.text+0x36a): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(comm_group.o): In function `MPI_Comm_group': comm_group.c:(.text+0x2e): undefined reference to `pthread_getspecific' comm_group.c:(.text+0x239): undefined reference to `pthread_getspecific' comm_group.c:(.text+0x26a): undefined reference to `pthread_setspecific' comm_group.c:(.text+0x2e3): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(type_indexed.o): In function `MPI_Type_indexed': type_indexed.c:(.text+0x3a): undefined reference to `pthread_getspecific' type_indexed.c:(.text+0x501): undefined reference to `pthread_getspecific' type_indexed.c:(.text+0x534): undefined reference to `pthread_setspecific' type_indexed.c:(.text+0x691): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(type_free.o): In function `MPI_Type_free': type_free.c:(.text+0x2e): undefined reference to `pthread_getspecific' type_free.c:(.text+0x339): undefined reference to `pthread_getspecific' type_free.c:(.text+0x36a): undefined reference to `pthread_setspecific' type_free.c:(.text+0x43b): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(group_free.o): In function `MPI_Group_free': group_free.c:(.text+0x2e): undefined reference to `pthread_getspecific' group_free.c:(.text+0x201): undefined reference to `pthread_getspecific' group_free.c:(.text+0x232): undefined reference to `pthread_setspecific' group_free.c:(.text+0x353): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(group_translate_ranks.o): In function `MPI_Group_translate_ranks': group_translate_ranks.c:(.text+0x37): undefined reference to `pthread_getspecific' group_translate_ranks.c:(.text+0x3a1): undefined reference to `pthread_getspecific' group_translate_ranks.c:(.text+0x3d4): undefined reference to `pthread_setspecific' group_translate_ranks.c:(.text+0x42c): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(ch3u_comm_spawn_multiple.o): In function `MPIDI_Comm_spawn_multiple': ch3u_comm_spawn_multiple.c:(.text+0x397): undefined reference to `pthread_getspecific' ch3u_comm_spawn_multiple.c:(.text+0x3d0): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(scatterv.o): In function `MPI_Scatterv': scatterv.c:(.text+0x3fc): undefined reference to `pthread_getspecific' scatterv.c:(.text+0x649): undefined reference to `pthread_getspecific' scatterv.c:(.text+0x67a): undefined reference to `pthread_setspecific' scatterv.c:(.text+0x91b): undefined reference to `pthread_setspecific' scatterv.c:(.text+0x1524): undefined reference to `pthread_getspecific' scatterv.c:(.text+0x1555): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(type_vector.o): In function `MPI_Type_vector': type_vector.c:(.text+0x2e): undefined reference to `pthread_getspecific' type_vector.c:(.text+0x421): undefined reference to `pthread_getspecific' type_vector.c:(.text+0x452): undefined reference to `pthread_setspecific' type_vector.c:(.text+0x4b3): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(type_struct.o): In function `MPI_Type_struct': type_struct.c:(.text+0x3a): undefined reference to `pthread_getspecific' type_struct.c:(.text+0x4e1): undefined reference to `pthread_getspecific' type_struct.c:(.text+0x514): undefined reference to `pthread_setspecific' type_struct.c:(.text+0x607): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(type_contiguous.o): In function `MPI_Type_contiguous': type_contiguous.c:(.text+0x2f): undefined reference to `pthread_getspecific' type_contiguous.c:(.text+0x2d9): undefined reference to `pthread_getspecific' type_contiguous.c:(.text+0x30a): undefined reference to `pthread_setspecific' type_contiguous.c:(.text+0x423): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(type_hvector.o): In function `MPI_Type_hvector': type_hvector.c:(.text+0x2e): undefined reference to `pthread_getspecific' type_hvector.c:(.text+0x3f9): undefined reference to `pthread_getspecific' type_hvector.c:(.text+0x42a): undefined reference to `pthread_setspecific' type_hvector.c:(.text+0x52b): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(waitall.o): In function `MPI_Waitall': waitall.c:(.text+0x47): undefined reference to `pthread_getspecific' waitall.c:(.text+0x4e1): undefined reference to `pthread_getspecific' waitall.c:(.text+0x514): undefined reference to `pthread_setspecific' waitall.c:(.text+0x5a6): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(mpir_request.o): In function `MPIR_Request_get_error': mpir_request.c:(.text+0x781): undefined reference to `pthread_getspecific' mpir_request.c:(.text+0x7b2): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(mpir_request.o): In function `MPIR_Request_complete': mpir_request.c:(.text+0xa69): undefined reference to `pthread_getspecific' mpir_request.c:(.text+0xa9c): undefined reference to `pthread_setspecific' mpir_request.c:(.text+0xb89): undefined reference to `pthread_getspecific' mpir_request.c:(.text+0xbba): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(info_get.o): In function `MPI_Info_get': info_get.c:(.text+0x2e): undefined reference to `pthread_getspecific' info_get.c:(.text+0x251): undefined reference to `pthread_getspecific' info_get.c:(.text+0x282): undefined reference to `pthread_setspecific' info_get.c:(.text+0x39b): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(info_getn.o): In function `MPI_Info_get_nkeys': info_getn.c:(.text+0x2e): undefined reference to `pthread_getspecific' info_getn.c:(.text+0x231): undefined reference to `pthread_getspecific' info_getn.c:(.text+0x262): undefined reference to `pthread_setspecific' info_getn.c:(.text+0x303): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(info_getnth.o): In function `MPI_Info_get_nthkey': info_getnth.c:(.text+0x2e): undefined reference to `pthread_getspecific' info_getnth.c:(.text+0x231): undefined reference to `pthread_getspecific' info_getnth.c:(.text+0x262): undefined reference to `pthread_setspecific' info_getnth.c:(.text+0x323): undefined reference to `pthread_setspecific' /usr/local/mpich2-1.2/lib/libmpich.a(info_getvallen.o): In function `MPI_Info_get_valuelen': info_getvallen.c:(.text+0x2e): undefined reference to `pthread_getspecific' info_getvallen.c:(.text+0x249): undefined reference to `pthread_getspecific' info_getvallen.c:(.text+0x27a): undefined reference to `pthread_setspecific' info_getvallen.c:(.text+0x38b): undefined reference to `pthread_setspecific' collect2: ld returned 1 exit status make: *** [HelloMPI] Error 1 -----------------------------------------
I had write mpicc in GCC C Compiler Field and in GCC C Linker. Now maybe it work. When I build I have the message; ------------------------------------- **** Build of configuration Debug for project HelloMPI **** make all Building file: ../src/HelloMPI.c Invoking: GCC C Compiler mpicc -I/usr/local/mpich2-1.2/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/HelloMPI.d" -MT"src/HelloMPI.d" -o"src/HelloMPI.o" "../src/HelloMPI.c" Finished building: ../src/HelloMPI.c Building target: HelloMPI Invoking: GCC C Linker mpicc -L/usr/local/mpich2-1.2/lib -o"HelloMPI" ./src/HelloMPI.o -lmpich Finished building target: HelloMPI ------------------------------------- but when I run, I have the message: ------------------------------------- no cmd specified usage: mpiexec [-h or -help or --help] # get this message mpiexec -file filename # (or -f) filename contains XML job description mpiexec [global args] [local args] executable [args] where global args may be -l # line labels by MPI rank -bnr # MPICH1 compatibility mode -machinefile # file mapping procs to machines -s # direct stdin to "all" or 1,2 or 2-4,6 -1 # override default of trying 1st proc locally -ifhn # network interface to use locally -tv # run procs under totalview (must be installed) -tvsu # totalview startup only -gdb # run procs under gdb -m # merge output lines (default with gdb) -a # means assign this alias to the job -ecfn # output_xml_exit_codes_filename -recvtimeout # timeout for recvs to fail (e.g. from mpd daemon) -g # global version of local arg (below) and local args may be -n or -np # number of processes to start -wdir # working directory to start in -umask # umask for remote process -path # place to look for executables -host # host to start on -soft # modifier of -n value -arch # arch type to start on (not implemented) -envall # pass all env vars in current environment -envnone # pass no env vars -envlist # pass current values of these vars -env # pass this value of this env var mpiexec [global args] [local args] executable args : [local args] executable... mpiexec -gdba jobid # gdb-attach to existing jobid mpiexec -configfile filename # filename contains cmd line segs as lines (See User Guide for more details) Examples: mpiexec -l -n 10 cpi 100 mpiexec -genv QPL_LICENSE 4705 -n 3 a.out mpiexec -n 1 -host foo master : -n 4 -host mysmp slave -------------------------------------
if I run my MPI program as here (on shell linux): —————————————– $ mpd& $ mpicc -o myProgram myProgram.c $ mpirun -np 4 myProgram —————————————– it work correctly! but if I try to run it with eclipse (configured as this guide), it don’t work correctly. When I build the project I have the message: —————————————– **** Build of configuration Debug for project HelloMPI **** make all Building file: ../src/HelloMPI.c Invoking: GCC C Compiler mpicc -I/usr/local/mpich2-1.2/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/HelloMPI.d" -MT"src/HelloMPI.d" -o"src/HelloMPI.o" "../src/HelloMPI.c" Finished building: ../src/HelloMPI.c Building target: HelloMPI Invoking: GCC C Linker mpicc -L/usr/local/mpich2-1.2/lib -o"HelloMPI" ./src/HelloMPI.o -lmpich Finished building target: HelloMPI —————————————– but when I run the project, I have the message: —————————————– no cmd specified usage: mpiexec [-h or -help or --help] # get this message mpiexec -file filename # (or -f) filename contains XML job description mpiexec [global args] [local args] executable [args] where global args may be -l # line labels by MPI rank -bnr # MPICH1 compatibility mode -machinefile # file mapping procs to machines -s # direct stdin to "all" or 1,2 or 2-4,6 -1 # override default of trying 1st proc locally -ifhn # network interface to use locally -tv # run procs under totalview (must be installed) -tvsu # totalview startup only -gdb # run procs under gdb -m # merge output lines (default with gdb) -a # means assign this alias to the job -ecfn # output_xml_exit_codes_filename -recvtimeout # timeout for recvs to fail (e.g. from mpd daemon) -g # global version of local arg (below) and local args may be -n or -np # number of processes to start -wdir # working directory to start in -umask # umask for remote process -path # place to look for executables -host # host to start on -soft # modifier of -n value -arch # arch type to start on (not implemented) -envall # pass all env vars in current environment -envnone # pass no env vars -envlist # pass current values of these vars -env # pass this value of this env var mpiexec [global args] [local args] executable args : [local args] executable... mpiexec -gdba jobid # gdb-attach to existing jobid mpiexec -configfile filename # filename contains cmd line segs as lines (See User Guide for more details) Examples: mpiexec -l -n 10 cpi 100 mpiexec -genv QPL_LICENSE 4705 -n 3 a.out mpiexec -n 1 -host foo master : -n 4 -host mysmp slave —————————————– How must I do???
are you using the same command i'm surrounding with the red rectangle in the third pic ? coz it should be "mpiexec" instead of "mpirun" in MPICH2.. if you are using mpiexec, make sure to pass the arguments in the mpiexec format "-n" instead of "-np"
ok... this is my new configuration, but it don't work. http://www.postimage.org/image.php?v=aVeXBWA
ok... this is my new configuration, but it don't work. http://www.postimage.org/image.php?v=aVeYeQS
http://www.postimage.org/image.php?v=aVeYhl0
http://www.postimage.org/image.php?v=aVeYmki
http://www.postimage.org/image.php?v=aVeYoPr
http://www.postimage.org/image.php?v=aVeYtOJ
http://www.postimage.org/image.php?v=aVeYwiS
http://www.postimage.org/image.php?v=aVeYyO0
http://www.postimage.org/image.php?v=aVeYjQ9
ah, in this screen http://www.postimage.org/image.php?v=aVeYtOJ u missed to write the executable name, check my last figure, and add the path to the place where the executable is supposed to be built in
Thanks....:-D
u r welcome :)
ok now it work. thank you. I've added ${workspace_loc:HelloMPI/Debug/HelloMPI} in arguments. I can use also mpirun -np. I've tested and it work.
I start mpd from shell using this command: $ mpd& Do you know some mode to launch mpd from eclipse?
mmmmm i don't remember that i needed to use that command, it was started by default, any way u'll need to start it once per machine boot so if it's not already executed u can just launch it from the shell once it wont make any difference :)
Salam Alaykom , I have been trying to work MPICH2 with eclipse in windows 7 , it works with dev after configuration but give undefined reference to `MPI_Init' here is the configuration : http://postimage.org/image/2i9hyqz2c/ http://postimage.org/image/2i9okwd1g/ Do u have any idea what the problem might be ? :-? thanks in advance,
I think you should remove those libraries you added in this pic http://postimage.org/image/2i9hyqz2c/ and add mpich2 OR mpich lib file, just make sure that it exists on the path you are specifying
First thanks for reply second : at first I added just mpi but the same problem so I added all the libraries in the lib path just to make sure . seems like the structure differs from win or Unix version , I couldn't find mpich2 library but found mpich2.dll in "C:\Windows\SysWOW64" , is it helpful ? :-? regards,
i did every thing as mentioned before but i got this message always i have MPICH 2 installed at /usr/local/mpich-install/include . **** Build of configuration Debug for project Fox **** make all Building file: ../src/Fox.c Invoking: GCC C Compiler mpicc -I/usr/local/mpich2-install/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Fox.d" -MT"src/Fox.d" -o"src/Fox.o" "../src/Fox.c" /bin/sh: mpicc: not found make: *** [src/Fox.o] Error 127 I didn't know why any ideas
mmm, pretty obvious that it couldn't find the compiler program "mpicc" so you can search for the mpicc in your machine and add the full path to the eclipse to compile the code, or edit the env variables to be able to get to that mpicc just test that by running "mpicc" in the terminal and check if it finds that command or not, if it didn't find it then you should do the solution i mentioned..
Try to run the compiling/linking commands without eclipse in a terminal/cmd console and see the output/errors
I have run it in eclipse and got : 21:23:36 **** Rebuild of configuration Debug for project empty_test **** Info: Internal Builder is used for build mpicc "-IC:\\MPICH2\\include" -O0 -g3 -Wall -c -fmessage-length=0 -o empty_test.o "..\\empty_test.c" -------------------------------------------------------------------------- The Open MPI wrapper compiler was unable to find the specified compiler cl.exe in your PATH. Note that this compiler was either specified at configure time or in one of several possible environment variables. -------------------------------------------------------------------------- 21:23:36 Build Finished (took 152ms) I also wonder why it uses / instead of \ in the path options in eclipse. i have corrected that but still this output...
/ was good no need to change it, search for this cl.exe and add its path to the PATH env var...
Well i cant find it anywhere on the hard disk. I only see CLI.exe. The problem is weird... What does openmpi has to do with mpi? I dont want to use the openMPI although i have installed both. It simply wont create binaries and i dont find much information on the net about eclipse and mpi. :(
Thanks for your quick reply! Well i am having problems cause i am kinda confused with all the guides that i have found. I use minGW for compiling and i have installed mpich2 (have included the lib and include folders in the eclipse but when i build a project it simply wont create binary files(it doesnt drop any error). Is this problem due to mingw? Thanks
Hello. Is it possible to write and compile a program in eclipse and then just run it in a cluster or something like this and get the results in eclipse? I am kinda confused, never tried it before. Thanks in advance!
It has been years since i wrote this post or even using mpich, and didn't try it on a cluster even, but as i can remember.. If running the program on a cluster can be done with some command lines you can put those commands in the post build script in eclipse and go If you can run an application on the cluster and get the result in your terminal/console that can be redirected to eclipse by making that command that runs the cluster as the executable name in eclipse instead of mpirun/mpiexec...
thanx