Hi guy i have a question
can i use Qt creator and library of Open-MPI ???![]()
Hi guy i have a question
can i use Qt creator and library of Open-MPI ???![]()
why would u wanna use QT creator for open MPI..does it have any QT connection? if not anything else, its at least a C++ editor i think
i do a program for my thesis
i make it in c++ for the interface i use qt and now the teacher saying me for operation in parallel use MPI ....
well, QT creator should be usable for that purpose, u'll be programming rest in C++, u'd just hv to add ur open mpi libraries in the project settings and all..usual c++ stuff
thank for all![]()
ok ... now i install MPI ...
how to configure qtcreator for compile my file the example is:
Qt Code:
#include "mpi.h" #include <iostream> int main(int argc, char **argv) { int rank, size; MPI::Init(); rank = MPI::COMM_WORLD.Get_rank(); size = MPI::COMM_WORLD.Get_size(); std::cout << "Hello, world! I am " << rank << " of " << size << std::endl; MPI::Finalize(); return 0; }To copy to clipboard, switch view to plain text mode
u should include the corresponding paths of include directories and the lib directories in the project to resolve all linking issues
i write in my project.pro this
Qt Code:
LIBS += -L/usr/lib/openmpi/ INCLUDEPATH += /usr/include/openmpi/ompi/mpi/cxxTo copy to clipboard, switch view to plain text mode
but don't work ... sorry for my low capacity
i read that for compiling mpi program the command is...
but in qt![]()
Last edited by zeeb100; 13th February 2009 at 14:58.
does that mean mpi uses a different compiler??if so, then u'll have to make some changes in the makefile of ur project
can i compile file1.cpp use MPI library and file2.cpp use Qt library and merge file1.o and file2.o in compiling???
and you can help me to configure the section qmake of qCreator to do this... ???
sorry for my english![]()
This page explains what OpenMPI requires : http://www.open-mpi.org/faq/?category=mpi-apps
And qmake docs will show you how to get it working in a qmake project file.
I see two possible (and hopefully simple) ways of getting this to work :
* changing the compiler (recommended by OpenMPI docs) using QMAKE_CC, QMAKE_CXX variables :
Qt Code:
QMAKE_CC = mpicc QMAKE_CXX = mpic++To copy to clipboard, switch view to plain text mode
* adjusting flags using QMAKE_CFLAGS, QMAKE_CXX_FLAGS and QMAKE_LFLAGS variables :
Qt Code:
QMAKE_CC = $$system(mpicc --showme:compile) QMAKE_CXX = $$system(mpic++ --showme:compile) QMAKE_LFLAGS = $$system(mpic++ --showme:link)To copy to clipboard, switch view to plain text mode
Current Qt projects : QCodeEdit, RotiDeCode
thanks for help
There is a typo in my previous post (and I cannot edit it anymore...), shouldn't be hard to figure out how to correct it but just in case :
Qt Code:
QMAKE_CFLAGS = $$system(mpicc --showme:compile) QMAKE_CXXFLAGS = $$system(mpic++ --showme:compile) QMAKE_LFLAGS = $$system(mpic++ --showme:link)To copy to clipboard, switch view to plain text mode
Current Qt projects : QCodeEdit, RotiDeCode
i do it thanks
i have add my open mpi libraries in the project settings ,but i have got the message: mpi.h , no such file or directory, who can help me ?
Also, where did you install mpi? If you look on your include path and can't find mpi.h yourself, you may have installed it somewhere else.
Bookmarks