필터 지우기
필터 지우기

Managing Dependencies when Compiling Code in Linux

조회 수: 2 (최근 30일)
Giorgi Chanturia
Giorgi Chanturia 2018년 9월 20일
답변: Giorgi Chanturia 2018년 9월 25일
I am trying to compile a Matlab code in Red Hat. The code consists of 2 .m files, where one of them is the main one (mainfile.m - used to be a script, but had to convert to a function) and the other is a data import function (datafunction.m), which uses SQL to pull data from the database.
To create an executable file I used the following command:
/usr/local/bin/mcc -mv mainfile.m
datafunction.m is also located in the same folder. I assumed that the Compiler would automatically find dependencies between mainfile.m and datafunction.m.
However when I try to run the resulting run_mainfile.sh using a runtime library:
./run_FILENAME /usr/local/MATLAB/MATLAB_Runtime/v93
it fails at the point when it has to execute the datafunction.m.
Any ideas?
Thanks.

채택된 답변

OCDER
OCDER 2018년 9월 20일
편집: OCDER 2018년 9월 20일
Try this:
/usr/local/bin/mcc -m mainfile.m -a /usr/local/dir_to_your_m_files
the -a [folder or file name] option will forcibly add the dependencies.
It is indeed odd the dependency checker failed to add the datafunction.m automatically. You could check with the dependency checkers to see if mainfile.m does list datafunction.m on the list.

추가 답변 (1개)

Giorgi Chanturia
Giorgi Chanturia 2018년 9월 25일
Thanks. This did solve the problem.

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by