Netbeans MPI c++ how to start? - c++

Hello everyone I just staring developing c++ under netbeans/ubuntu(x64) and now I am staring with MPI. How can I compile, test,run mpi applications under. Thanks a lot.

Till now, I've found only this IDE for MPI on Linux: Geany (a tutorial is here.)
But I keep searching...
If anyone find better IDE, please share under this question...

There is an Eclipse plug-in for parallel programming, including MPI: http://www.eclipse.org/ptp/

To build, change the C++ compiler in NetBeans's C/C++ options to be /path/to/mpicc.
As for running, MPI applications are usually invoked with mpirun. This is done either via the command line (on your PC) or via a batch description file (on a cluster with OpenPBS, LoadLeveler, or similar scheduler). I've never tried to run MPI via an IDE, though NetBeans does have an option for the debugger command, so you might be able to try that and see what happens.

Related

Why are my C++ and Fortran programs not running on Plato IDE downloaded from Silverfrost?

I am using Plato IDE from Silverfrost FTN95 to run programs on Fortran as well as C++. But for the last 2-3 months, I was busy and could not use them. So, yesterday when I opened the IDE and viewed some earlier written programs, I saw that the programs were not running properly.
The compiler was working and each time, the compilation was completed with no errors.
The executable was also built successfully but it just showed the following:
Also, on clicking "Run to Cursor" on any line of the program, it mentioned the following error.
What is wrong? And how do I make things work right? Do I need to uninstall and reinstall?
I could not realise what was wrong, in any way possible. So I uninstalled it and then performed re-installation. Things are working so fine now.

VSCode c++ configuring for vc toolchain

I'm trying to start a work in vscode , latest C++ plugin version supports ms debugger, so as I'm mostly working under windows it was a signal to try this.
c++ tools plugin from MS and cmake tools were installed.
my test project was however not built . the problem is clear , but I need an advice from experienced vscode users how to solve this right.
cmake doesn't see vc compiler.
(after using QtCreator) I expected that vscode could detect vc installation... however that's not so. ok, I have a two ways:
fill environment variables INCLUDE/LIB/PATH with a headers, libs and binaries
just run vcvarsall.bat x64
Second way is a simple and reliable. so final question is:
how to run .bat at the begining of vscode start?
(I don't mean write another bat/cmd, prepare the environment and run vscode inside the same script after that)
Although the question is fairly old, I'll try to give a useful answer, in case others stumble across, just like I did.
I believe what you are trying to achieve is not possible. Code inherits the environment it was started with. If you did not launch it from a developer command prompt, you will not be able build and debug. (Building might be possible if every task first starts the vcvarsall.bat, but that slows things down by a lot. Debugging I think will still not work.)
If you are willing to, you can check out vector-of-bools CMake Tools extension which does build automation as well as automatic MSVC detection. It builds using CMake (thus you need to write your build scripts using CMake), but it will take care of building just by pressing F7, like what most VS users are familiar with.

"Program File does not exist" while trying to debug with Eclipse/OpenOCD

I recently got a nrf51 bluetooth module and I am trying to debug it with Eclipse Mars. I installed the required toolchain as well as OpenOCD (I am using STLink v2 to debug the board).
While running openOCD and arm-none-eabi-gdb in console, everything works fine. The OpenOCD server starts up and I am able to connect with the gdb tool.
However, when trying to start a debug session with Eclipse, it throws the error "Exception occurred during launch. Reason: Program file does not exist". The build process finishes normally. It's the first time I used Eclipse for C/C++ development and the first time after years I used Eclipse at all so I don't even have an idea what could be wrong.
I tried messing around with the project settings without luck. Can anyone give me a hint?
I should mention, I used an already existing Makefile since I tried compiling one of the nordic SDK examples. I Changed it so the resulting files are ready for debugging.
In past I've used Segger's Jlink programmer and the JlinkExe (A pre-built binary) for Linux platform to program Nordic Bluetooth module such as NRF51 and it worked seamlessly. There are some very good documentation on using GNU toolchain with NRF51 series SOC and in case you get your hands on Segger's Jlink, I would recommend you to use that for programming. Meanwhile, this thread in the Nordic's developer zone seem to be very much similar to your problem. Maybe you'll be find some clues there.

Debugging on Linux for Windows Developer

Primarily I've done basic (novice level) software development on a Windows machine, but I've always had MS Visual Studio to help me step through the process of debugging.
Now, however, it looks like I will be on Linux, so in order to get ready for the jump I want to make sure I have a tool/tools lined up to help me step through the code and debug.
Unfortunately when I've verbally asked folks how they go about debugging on Linux, I typically get the following answer, "Oh, I just put a bunch of print statements." OMG! No way you say, but yes that is their answer.
Since it is on Linux, and will be working with C++ code on the CentOS 32-bit OS, I am hoping here is a preferred OpenSource solution. So, I guess I asking for the preferred OpenSource IDE for C++ code on CentOS Linux.
Thanks for any insight and suggestions.
Good question, of course, but its been
done before:
https://stackoverflow.com/questions/408418/what-editor-ide-do-you-use-for-c-programming-on-linux-and-why-closed
https://stackoverflow.com/questions/86676/is-there-a-good-and-free-ide-for-c-c-in-linux
https://stackoverflow.com/questions/149321/what-ide-would-be-good-for-linux-kernel-driver-development
Lightweight IDE for Linux
Simple GUI IDE?
(from: https://stackoverflow.com/questions/579219/best-unix-linux-c-debuger-ide-closed)
A few years ago I made the move from VS to an emacs/make type environment and I have never looked back.
The idea is to use a makefile to handle the project management side of an IDE and I use emacs+gdb for editing and debugging. It will take you a while to get used to emacs but if you stick at it it's well worth the effort. Once you've started emacs, press "Ctrl+H" followed by "t" and this will bring you to the tutorial page.
After you've mastered the basics, you can debug a program in a similar way to any IDE/debugger interface. I must admit that even after all this time, I still use a set of VS key mappings that I setup when I first moved to emacs!
(global-set-key [f7] 'compile) ;; Run the compile command
(global-set-key [f4] 'next-error) ;; The next compile error
(global-set-key [S-f4] 'previous-error) ;; The previous compile error
(global-set-key [f5] 'gdb) ;; Start the debugger
The following sets the "VS" key mappings to the different GDB commands which you might use:
(add-hook 'gud-mode-hook
'(lambda ()
(define-key (current-local-map)
[f10]
'gud-next)
(define-key (current-local-map)
[f11]
'gud-step)
(define-key (current-local-map)
[\S-f11]
'gud-finish)
(define-key (current-local-map)
[f5]
'gud-cont)
))
With the above keymappings, I press 'f5' which prompts me to run gdb (and to this command I add the binary I wish to debug). Once gdb is loaded, you press 'f5' to continue, 'f10' to step-over, 'f11' to step-into and 'shirt+f11' to step-out.
Finally, every time you start 'gdb', it will read a file called '.gdbinit' in your home directory. A different StackOverflow question had this answer which brought stl-views to my attention. stl-views is a set of helper functions for gdb that show you the contents of the different types of STL containers. The instructions for how to use it can be found at the top of the link.
I would suggest using Eclipse
Eclipse is a mature IDE with plenty of support available.
There is also Code::Blocks if you want to try something different
Eclipse
NetBeans
KDevelop
There is always GDB. XCode for OSX uses GDB internally for debugging.
Valgrind, its your friend and may save you from having to suffer though GDB.
Mostly, for an IDE similar (?) to VS - use Eclipse.
See moving Microsoft VS projects to Eclipse C/C++ Development Toolkit - a brief step-by-step procedure for migrating Microsoft Visual Studio C/C++ (MSVC) projects to Eclipse. It compares and contrasts the benefits of MSVC and Eclipse CDT.
Anjuta is a really great IDE for GNOME. For debugging it uses GDB internally.
If you just want a good debugger, check out DDD.
I use a combination of gdb and cscope when debugging on linux.

How to do remote debugging with Eclipse CDT without gdbserver?

We're using the Eclipse CDT 5 C++ IDE on Windows to develop a C++ application on a remote AIX host.
Eclipse CDT has the ability to perform remote debugging using gdbserver. Unfortunately, gdbserver is not supported on AIX.
Is anyone familiar with a way to debug remotely using Eclipse CDT without gdbserver? Perhaps using an SSH shell connection to gdb?
finally I got gdb run remotly anyhow now. At the Bug-symbol on the taskbar I took Debug Configurations - GDB Hardware Debugging.
In Main C/C++ Applications I set the full path on the Samba share of the executable (X:\abin\vlmi9506). I also set a linked folder on X:\abin in the project. Then I modified my batch-script in GDB Setup. It's not directly calling gdb in the plink-session but a unix-shell-script, which opens gdb. By this I have the possibility to set some unix environment-variables for the program before doing debug. The call in my batch:
plink.exe prevoax1 -l suttera -pw XXXXX -i /proj/user/dev/suttera/vl/9506/test/vlmi9506ddd.run 20155 dev o m
In the unix script I started gdb with the command line params from eclipse, that I found in my former tryals. The call in the shell command looks like this:
gdb -nw -i mi -cd=$LVarPathExec $LVarPathExec/vlmi9506
Then IBM just gives gdb 6.0 for AIX. I found version 6.8 in the net at http://www.perzl.org/aix/index.php?n=Main.Gdb. Our Admin installed it.
I can now step through the program and watch variables. I even can write gdb-commands directly in the console-view. yabadabadooooooo
Hope that helps to others as well. Can not tell, what was really the winner-action.
But each answer gives more new questions. Now I got 3 of them.
When I start the debug config I have to click restart in the toolbar to come really in the main procedure. Is it possible to come directly in main without restarting?
On AIX our programs are first preprocessed for embedded sql. The preprocessed c-source is put in another directory. When I duble-click the line to set a breakpoint, I get the warning "unresolved breakpoint" and in the gdb-console I see, that the break is set to the preprocessed source which is wrong. Is it possible to set the breakpoints on the right source?
We are using CICS on AIX. With the xldb-Debugger and the CDCN-command of CICS we manage that debugging is started, when we come in our programs. Is it possible to get that remotely (in plink) with gdb-eclipse as well?
I wouldn't normally take a shot in the dark on a question I can't really test the answer to, but since this one has sat around for a day, I'll give it a shot. It seems from looking at:
http://wiki.eclipse.org/TM_and_RSE_FAQ#How_can_I_do_Remote_Debugging_with_CDT.3F
...that even if the CDT has changed since that wiki page was made, you should still be able to change the debug command to:
ssh remotehost gdb
instead of using TM which uses gdbserver. This will probably be slightly slower than the TM remote debugging since that actually uses a local gdb, but on the other hand this way you won't have to NFS or SMB mount your source code to make it available to the local debugger (and if you're on a LAN it probably won't matter anyhow).
There's also a reference TCF implementation for linux, which you may or may not have any luck recompiling for AIX, but it allows for remote debugging if gdbserver is otherwise not available:
http://wiki.eclipse.org/DSDP/TM/TCF_FAQ
tried also to remotly debug an aix-appl with windows eclipse-cdt-gdb.
Got blocked at the end with unix/windows path-problems. Maybe my result can help u a little further - maybe you already got it work. I'm interested in your comment. asked on eclipse news portal- following the answer of martin oberhuber (thanks again) tried dsp dd (also blocked with path problem) and set an request in eclipse bugzilla.
here the link to news:
http://www.eclipse.org/newsportal/article.php?id=406&group=eclipse.dsdp.tm
Here my bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=252758
At the moment we still debug localy with xldb but I am trying ddd-gdb at the moment. At least locally gdb is running.