필터 지우기
필터 지우기

mex.h location

조회 수: 14 (최근 30일)
George Reeke
George Reeke 2016년 4월 29일
댓글: George Reeke 2016년 5월 4일
I run Matlab in RedHat Linux 6.7 64-bit.
I write a lot of C mex files that compile with '-I/<location of Matlab>/extern/include' in the compiler options and '#include <mex.h>' in the C code.
Now I am starting to share this with other users with their installations in different places, so the '-I' option has to be different in different labs. I am looking for some way to automate this so a common make file can be shared with all users and hopefully will not need updating when Matlab is updated to a new version. [I understand the code may sometimes need revision, but here I am only talking about the include file changing location.]
Do you have any advice how to do this? Of course I can supply a -D option from the command line when running 'make', but this is undesirable for other users to have to bother with. Or I can install an environment variable in each user's shell startup, but that would require maintenance when there is a new version of Matlab.
Ideally, Matlab would install a link to its include directory somewhere like in /usr/local/include when it installs a link to itself in /usr/local/bin.
If you have no present solution to this problem, may I ask that you transfer this question into a feature request.
Thanks,
George Reeke

답변 (2개)

Walter Roberson
Walter Roberson 2016년 4월 30일
If this is to be called within MATLAB, then
fullfile(matlabroot, 'extern', 'include')
is the directory.
  댓글 수: 1
George Reeke
George Reeke 2016년 5월 2일
Thanks, but I am talking about running the C compiler called from inside the "mex" command-line command, not from inside Matlab.

댓글을 달려면 로그인하십시오.


James Tursa
James Tursa 2016년 5월 4일
Why aren't you using double quotes? E.g.,
#include "mex.h"
  댓글 수: 1
George Reeke
George Reeke 2016년 5월 4일
I am using double quotes. Somehow they got lost in the online submission. GNR

댓글을 달려면 로그인하십시오.

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by