-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CAT12 OSError: No command "matlab" found on host. #518
Comments
My current hypothesis is, that CAT12 doesn't work with the root-user. Will check it out by creating a separate script with a non-root user. |
We checked it, and it also doesn't work when switching to a non-root user. generate_docker() {
docker run -i --rm repronim/neurodocker:0.9.4 generate docker \
--base-image neurodebian:stretch-non-free \
--pkg-manager apt \
--install opts="--quiet" \
gcc \
g++ \
octave \
--matlabmcr version=2017b \
--cat12 version=r1933_R2017b \
--copy $yaml_file /tmp/ \
--miniconda \
version=latest \
yaml_file=/tmp/$yaml_file \
env_name=csp \
--user csp \
--run 'mkdir /home/csp/data && chmod -R a+rwx /home/csp/data' \
--run 'mkdir /home/csp/output && chmod -R a+rwx /home/csp/output' \
--run 'mkdir /home/csp/code && chmod -R a+rwx /home/csp/code' \
--run 'mkdir /home/csp/cache && chmod -R a+rwx /home/csp/cache' \
--run 'mkdir /home/csp/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > home/csp/.jupyter/jupyter_notebook_config.py' \
--run 'echo source activate csp >> /home/csp/.bashrc' \
--workdir /home/csp/code
}
and then: from nipype.interfaces.cat12 import CAT12SANLMDenoising
c = CAT12SANLMDenoising()
c.inputs.in_files = '/home/csp/data/anatomical.nii'
c.run() gives the same error. |
Additional checks: According to the docs from nipype.interfaces import spm
spm_instance = spm.SPMCommand()
spm_instance._matlab_cmd
'/opt/spm12-r7771/run_spm12.sh /opt/matlab-compiler-runtime-2010a/v713 script' which looks good. However, with the "CAT12"-Version, this attribute is empty. |
Dear @JohannesWiesner, It looks like you got the matlab path incorrectly specified. For the www.neurodesk.org project we build CAT12 like this: https://github.com/NeuroDesk/neurocontainers/blob/master/recipes/cat12/build.sh Then using CAT12 from nipype works like this:
|
@stebo85 :
But this should all happen automatically right? Because for SPM12 it is not necessary to specify the paths beforehand? Or have I misunderstood something? Besides it does not seem to work in this case (put a file generate_docker() {
docker run -i --rm repronim/neurodocker:0.9.4 generate docker \
--base-image neurodebian:stretch-non-free \
--pkg-manager apt \
--install opts="--quiet" \
gcc \
g++ \
octave \
--matlabmcr version=2017b \
--cat12 version=r1933_R2017b \
--copy $yaml_file /tmp/ \
--miniconda \
version=latest \
yaml_file=/tmp/$yaml_file \
env_name=csp \
--user csp \
--run 'mkdir /home/csp/data && chmod -R a+rwx /home/csp/data' \
--run 'mkdir /home/csp/output && chmod -R a+rwx /home/csp/output' \
--run 'mkdir /home/csp/code && chmod -R a+rwx /home/csp/code' \
--run 'mkdir /home/csp/cache && chmod -R a+rwx /home/csp/cache' \
--run 'mkdir /home/csp/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > home/csp/.jupyter/jupyter_notebook_config.py' \
--run 'echo source activate csp >> /home/csp/.bashrc' \
--workdir /home/csp/code
} and then: import nipype.interfaces.spm as spm
from nipype.interfaces.cat12 import CAT12SANLMDenoising
matlab_cmd = '/opt/CAT12-r1933_R2/run_spm12.sh /opt/MCR-2017b/v93/ script'
spm.SPMCommand.set_mlab_paths(matlab_cmd=matlab_cmd, use_mcr=True)
c = CAT12SANLMDenoising()
c.inputs.in_files = '/data/anatomical.nii'
c.run() I get |
is |
Dear @JohannesWiesner , I tried reproducing your problem and I built the container exactly like you. I think the problem might be a typo in your matlab_cmd:
This is working for me :) |
thanks @stebo85 ! |
@stebo85 You're right, sorry for the typo! The script works fine now :) However, I still don't get why this manual configuration has to be done? I checked the .yml files for SPM12 and CAT12 and it seems that for SPM12 |
Good idea - I wasn't aware that you can set this in the yaml file. Can you test it for CAT12 and send a pull request? |
Maybe the original idea of this was that CAT12 would always be installed together with SPM12 and therefore it would be unnecessary to specify the same environmental variables twice? Maybe @kaczmarj remembers what lead to this design decision? As the simultaneous installation of SPM12+CAT12 in one container is not possible currently (see #510) it could make more sense to follow a modular approach so that CAT12 and SPM12 can be installed individually (with the long-term goal to make it possible to install them both in one container).
I could try but it's a steep learning curve for me, I don't really understand what's going on when the |
this was a long time ago, but i believe you are correct @JohannesWiesner .
if the environment variable names for spm12 and cat12 overlap, then the environment variables will be overwritten by whatever is installed last. |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
This issue is stale because it has been open for 30 days with no activity. |
When installing CAT12+MATLAB-MCR and then running a little test script, I get the following error:
This is the script to produce the Dockerfile:
And this is the little test script (taken from the nipype docs):
However, when installing SPM12 and also running the corresponding test script everything works fine:
The text was updated successfully, but these errors were encountered: