How do I fix this error "Could not commit changes: copy failed: fl:filesys​tem:System​Error:" please?

18 vues (au cours des 30 derniers jours)
When I try to compile and generate a simple typical mex(or lib,dll,exe) function on an ubuntu system, I get the following error, when the mex file can be generated and run normally, but I don't know what causes the error,the report didn't come out either ,how can i fix it? your answer would be greatly appreciate.(Run R2022b, ubuntu20.04)
myadd.m
function c = myadd(a,b)%#codegen
c = a+b;
end
command line:
a=1;
b=2;
codegen -config:mex myadd -args {a,b} -report
Could not commit changes: copy failed: fl:filesystem:SystemError:
/tmp/.fa30-a34f-2ae0-0e8e.tmp Invalid cross-device link

Réponse acceptée

cui,xingxing
cui,xingxing le 9 Nov 2022
After searching, I found a solution to the problem, which I have copied from the original problem here.
------------------------------------------
I understand that you are getting an error when saving 'MLX' files in MATLAB R2022a and R2022b.
This is a known issue with MATLAB R2022 releases. Currently, these are the following workarounds other than downgrading the Linux kernel:
1) Change the temp directory of MATLAB to a new folder
The default temp directory of MATLAB on Linux is '/tmp/', to resolve the issue, you can create a new folder in a different file directory and set it as the new temp directory.
Please refer to the following example to change the temp directory of MATLAB in the MATLAB Command Window:
ThemeCopy
>> clear all
>> tempdir % ans = '/tmp/'
>> setenv('TMPDIR', 'FILE DIRECTORY FOR THE NEW FOLDER')
>> clear all
>> tempdir % ans = 'FILE DIRECTORY FOR THE NEW FOLDER'
You should be able to save all MLAPP files/ Simulink models/ Live Scripts as usual after changing to the new temp directory.
If the above workaround does not resolve the issue, try to
2) Use MATLAB Online:
MATLAB Online provides access to the latest version of MATLAB from a standard web browser using MathWorks-hosted computing resources and storage, which allows you to continue working with your previous files and related datasets.
Please refer to the following link to upload the files to MATLAB Online and download files from it: https://www.mathworks.com/help/releases/R2022b/matlab/matlab_env/access-files-in-matlab-online.html
If you would like to know more about what is MATLAB Online, please refer to the link below: https://www.mathworks.com/help/releases/R2022b/matlab/matlab_env/what-is-matlab-online.html

Plus de réponses (0)

Catégories

En savoir plus sur Application Deployment dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by