필터 지우기
필터 지우기

Issue using compiled code in a singularity container

조회 수: 7 (최근 30일)
dubs
dubs 2022년 7월 28일
답변: Sebastian 2023년 3월 24일
Hi,
I've containerised a few processing steps into Docker images using compiled MATLAB code, which works fine. However, as I will need to run this code in a HPC environment, I need to convert these to Singularity images. Unfortuantely, after the conversion, one of my processing steps crashes with the following error:
Failed to create a directory required to extract the CTF file.
Please make sure that you have the appropriate permissions and re-run the application
Error initiliazing CTF Archive:
Some error has occured in the file: core/mclCtfFileExtractor.cpp, at line 62.
The error message is:
Failed to create a directory required to extract the CTF file.
Please make sure that you have the appropriate permissions and re-run the application
It looks like it tries to unpack some MCR related files into /root. I've tried to chmod 777 that directory, along with a lot of other directories, but this does not fix the error. Additionally, I tried to change where it will be unpacked to (see https://au.mathworks.com/matlabcentral/answers/234664-changing-the-location-of-unpacking-for-deployed-application), but this seemed to have no effect at all.
My build command for the standalone application is
Nopts = {'-p',fullfile(matlabroot,'toolbox','signal'),...
'-p' fullfile(matlabroot, 'toolbox', 'images'),...
'-p', fullfile(matlabroot, 'toolbox', 'stats')};
if ~exist(Nopts{2},'dir')
fprintf("No signal toolbox found!");
Nopts = {};
end
Ropts = {'-R','-singleCompThread'} ;
if ~ismac && spm_check_version('matlab','8.4') >= 0
Ropts = [Ropts, {'-R','-softwareopengl'}];
end
mcc('-m', '-v', '-C', '-R', '-nodisplay',...
'-w', 'enable',...
'-o','custom_code',...
'-d',outdir,...
'-N',Nopts{:},...
Ropts{:},...
'-a', '/opt/spm12',...
'-a', '/opt/custom_code/',...
gateway);
and the docker/singularity container is built on Ubuntu 20.04.
Has anyone encountered such a problem before, or know of any potential solutions? Any help would be greatly appreciated.
Cheers,
Aaron

답변 (1개)

Sebastian
Sebastian 2023년 3월 24일
You can mount a writable overlay image when starting the singularity/apptainer container and matlab will write all its files to that image despite not having write access to the main container image. When creating the overlay image, make all directories that matlab needs to write to (i.e. where the CTF file is).

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by