IDE for mrtrix3 development


#1

Dear dev-team,

Based on your experience do you recommend any IDE for mrtrix3 source code changes in linux? Ideally something that can list available functions in a class etc. If there is no particular preference could you put some help on how to port the package into eclipse CDT with symbolic support?

Thank you very much!
Nagesh


#2

I’m probably the wrong person to ask… I keep it old school with vim and the command-line (bash, gdb, valgrind, and grep to search through the code…). I admit this may not be everyone’s cup of tea…

Some of the guys have been using Eclipse on Linux and XCode on MacOSX, and seemed more or less happy with that. I’m sure they’ll be happy to share their setup with you.


#3

Thanks for the reply Donald. I am looking forward to the setup info for eclipse on linux from those who have been using it, with gratitude.


#4

Myself and @Dave have given up on Eclipse CDT: it’s become bloated and prohibitively slow, and the code searching / refactoring rarely finds what it should. QtCreator is lightweight and responsive. Though to be honest personally I basically use it as a glorified text editor, with building / debugging / version control done in a separate terminal.


#5

Is QtCreator free? If so could you let me know how to port the code base to QtCreator? And QtCreator does allow building, debugging, stepping etc. correct?

If it is not free could you still let me know how to port to eclipse CDT?


#6

QtCreator is part of Qt, you can install it on Linux via the official packages supplied by your distribution. A quick Google search should tell you what package to install. I think it allows debugging, but I’ve no experience with it. Note that its primary purpose is to facilitate development of Qt (GUI) apps - it just turns out to be a nice fast editor, as @rsmith says.

Also, there’s no need to port the code in any sense - it’s cross-platform already, until you actually compile it… I think you probably mean import? I’m not sure at what level you’re asking the question… Really all you need to do is edit any of the relevant files, save, and type ./build in the terminal… While you can set up your IDE to do this for you, in practice it’s really just as simple to click in the terminal, hit the up arrow to bring up the previous line (which will most likely be ./build already if you’re developing), and hit enter… The advantage is that you can set up the actual command to run straight away if the build was successful - I use something like this all the time:

$ ./build && mycommand blah...

The advantage of a good IDE is better code navigation - it allows you to jump straight to function definitions, etc. Personally I’ve never felt I needed this enough to bother setting it up, but I can see how it would make life easier for someone unfamiliar with the code. In practice though, you might find that the developer documentation is just as easy to browse, despite not being complete - at least you can see what functions are available, and where to find them in the code…


#7

I see what you mean. Yeah I did mean import (sorry for the confusion) and yes the main advantage is for code navigation and perhaps in a few circumstances “stepping through” command execution.

@rsmith and or @Dave oculd you still let me know how to import to Eclipse CDT despite it’s slow performance?

Thank you all three of you very much.


#8

@rsmith and @Dave I was wondering if you had a chance to followup on this request.
Thanks so much.
Nagesh


#9

Hi Nagesh,
As Rob said, we have been using QT Creator for a while. It’s a lot nicer to use than Eclipse, and ticks all the boxes (code navigation, autocomplete, building and displaying errors at the associated line, syntax highlighting and typo detection. It also has good debugging and git control if you prefer a GUI for these tasks. It’s free via the Ubuntu repositories, however I’m not sure how long it will stay that way. If you want the latest version from their website you now have to create an account and declare that you work for a non-commercial entity to download it for free.

Setting up a MRtrix project is easy in QT Creator. Just clone the repository, then create a “New Project”. Then select “Import Existing Project”:

Enter in the MRtrix folder path:

Once created, you can then set it up to build by going to the “Projects” menu, deleting the existing “Make” build step and adding a custom build step like so:

You should now be able to use Ctrl-B to build MRtrix (make sure you run ./configure once first). Note that you won’t see the build script output dynamically (at least on Linux), it tends to dump a chunk at a time (this has something to do with the build script piping output to less).

To get QT creator to parse the Eigen library in linux, I had to create a sym link to the main Eigen library folder in /usr/include:

dave@home:/usr/include$ ln -s eigen3/Eigen/

I’ll create a separate post for Eclipse.
Cheers,
Dave


#10

This shouldn’t happen: build checks whether it’s running in a terminal, and writes directly to stderr if not. And on any decent platform, stderr is unbuffered, so writes should show immediately. No idea why that wouldn’t work with QtCreator - unless it’s actually creating a TTY for the output, in which case ./build would indeed assume it was running within a terminal. Easy enough to check, just comment out the relevant lines and see what happens… If that does turn out to be the problem, maybe we can add a command-line option to build to disable that so it can integrate better in this case?


#11

Thanks so much Dave for replying with details on the QtCreator. I will try this and also look forward to your eclipse post.
Thanks again very much!
Nagesh


#12

You might like YouCompleteMe, the clang completer beats all other C++ IDEs I’ve tried and it’s lightning fast. Teh downside wrt Qt Creator is that it doesn’t “get” Qt stuff like signals.


#13

@maedoc: it does look pretty good! And it’s well documented for Arch Linux too. I might just have to give that a spin when I have a minute…