Error building new gadgetron version 4.1

55 views
Skip to first unread message

Jabrane Karkouri

unread,
Apr 28, 2020, 10:45:32 AM4/28/20
to Gadgetron
Dear all,

I tried to build gadgetron under Ubuntu 18.04.2 LTS following the guidelines on the gadgetron wiki: https://github.com/gadgetron/gadgetron/wiki/Linux-Installation

First, I had an error because there was some conflict with CUDA, so I typed: cmake -D GADGETRON_INSTALL_MATLAB_PATH=/tmp/a -D USE_CUDA=off -D CMAKE_BUILD_TYPE=Debug ~/gadgetron-jk
in order to disable the use of CUDA.


However, I get an error at the end of the build saying that the file MatlabUtils.h is not found:

[100%] Building CXX object apps/standalone/cpu/gtplus/CMakeFiles/Matlab_gt_write_analyze.dir/Matlab_gt_write_analyze.cpp.o
/home/ctr28/gadgetron-jk/apps/standalone/cpu/gtplus/Matlab_gt_write_analyze.cpp:16:10: fatal error: MatlabUtils.h: No such file or directory
#include "MatlabUtils.h"
^~~~~~~~~~~~~~~
compilation terminated.
apps/standalone/cpu/gtplus/CMakeFiles/Matlab_gt_write_analyze.dir/build.make:62: recipe for target 'apps/standalone/cpu/gtplus/CMakeFiles/Matlab_gt_write_analyze.dir/Matlab_gt_write_analyze.cpp.o' failed
make[2]: *** [apps/standalone/cpu/gtplus/CMakeFiles/Matlab_gt_write_analyze.dir/Matlab_gt_write_analyze.cpp.o] Error 1
CMakeFiles/Makefile2:3620: recipe for target 'apps/standalone/cpu/gtplus/CMakeFiles/Matlab_gt_write_analyze.dir/all' failed
make[1]: *** [apps/standalone/cpu/gtplus/CMakeFiles/Matlab_gt_write_analyze.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

I saw that the toolbox matlab is not present anymore in the new version of gadgetron, is it needed for a correct build?

I am joining as well the CMakeLists.txt file that I modified.


Thank you for your help,
Kind regards,
Jabrane Karkouri

ctr-diff-for-matlab-v1.patch

Valéry Ozenne

unread,
Apr 30, 2020, 5:41:10 AM4/30/20
to Gadgetron
Hello Jabrane,

Matlab is not anmore necessary to compile the Gadgetron but some independent applications (included in the app folder) can be compiled (for creating mexfile ) and need Matlab. The quickest way could be to comment them in the cmake
in gadget/apps/standalone/cpu/gtplus

Could send us the result of your cmake :

cd gadgetron/build/
rm -rf *
cmake ../

The last installation procedure is here but our problem seems related to matlab https://github.com/gadgetron/gadgetron/wiki/Linux-Installation-(Gadgetron-4)

Best
valéry




Jabrane Karkouri

unread,
May 1, 2020, 7:06:07 AM5/1/20
to Gadgetron
Hello Valery,

Thank you for you reply. 
Please find attached 2 cmakelists, one only by doing cmake ../ from the freshly cloned gadgetron tree here https://github.com/gadgetron/gadgetron/.  The other cmake is the ouput of cmake ../ after commenting the Cmakelists.txt in gadget/apps/standalone/cpu/gtplus. 
Whether or not I comment I have an error at building at 20%, which seems to be related to compiler conflicts with CUDA.. By running "cmake -D USE-CUDA=off MyPathToGadgetron", this error does not appear anymore and as you said when I comment the cmake it builds without errors (thank you!).

In an older gadgetron version, I found out that there was a matlab toolbox under gadget/toolboxes. If I copy the whole matlab folder into the new gadgetron tree and run "cmake -D USE-CUDA=off MyPathToGadgetron" without commenting anything in the cmake, it builds without error with make and sudo make install. I'm wondering if those libraries are needed? Gadgetron works fine now but just wondering.


Thank you again,
Kind regards,
Jabrane
cmakeOutputWIthCmakeListsCommented.txt
cmakeOutput.txt

Kristoffer Knudsen

unread,
May 5, 2020, 6:18:41 AM5/5/20
to Gadgetron
Hi Jabrane (and All),

We reworked the entire Matlab (and Python) subsystem for Gadgetron 4.1 to make it much cleaner and easier to work with. To have Matlab support in the current version of Gadgetron, all you need is a 'matlab' command on your PATH, and the 'gadgetron' Add-On installed in Matlab. It should just work out of the box. If it doesn't - well - that's an issue. Here's an intro to the new interface.

The new interface keeps Matlab in it's own process, and the communication has been reworked to use ISMRMRD streams. This means Gadgetron never needs to be compiled with Matlab (which used to cause a ton of headaches - particularly matching system library versions to those shipping with Matlab was painful). In fact, there should be no Matlab-specific code left in Gadgetron. If there's still a snippet or two that requires Matlab headers to compile, I'd consider that an oversight. The purge should have been total.

That said: I'm fairly sure the old-style Matlab toolbox still compiles. I'm also pretty sure you could get the old Matlab gadgets to compile if you wanted to. I took them out of Gadgetron to reduce the amount of pain available to new users. If you feel up for compiling them against your Matlab installation - matching versions and debugging random segfaults - they should work as well as they always did. Consider it an ill-documented option for legacy support.

Things not compiling with CUDA enabled is too common - open an issue (if it has not been fixed already).

Best regards,
Kristoffer
Reply all
Reply to author
Forward
0 new messages