Specifying a different mexsh

조회 수: 2 (최근 30일)
Nicolas
Nicolas 2013년 10월 3일
댓글: Royi Avital 2013년 10월 20일
Hi,
I'm new to mex-files. I'm trying to compile a file written in C in folder A, with a header in some folder B, using a custom mexopts_custom.sh file that was handed to me. How can I specify that I want to use mexopts_custom.sh when I run the mex command?
>>mex myFile.c
Also, trying on an sample mex-file
>>mex timestwo.c
produces the following error:
xcodebuild: error: SDK "macosx10.7" cannot be located.
xcrun: error: unable to find utility "clang", not a developer tool or in PATH
mex: compile of ' "timestwo.c"' failed.
I am using OS X 10.8.5, MATLAB 2013b (8.2.0.701) and Xcode 5.0 with
If anyone could shed some light on this, I'd really appreciate it.
Cordially,
  댓글 수: 1
Royi Avital
Royi Avital 2013년 10월 20일
Is build 8.2.0.701 the is the release version of MATLAB 8.2 (R2013b)?

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

채택된 답변

Harsheel
Harsheel 2013년 10월 3일
You can provide your custom options file via the -f flag:
>>mex myFile.c -f mexopts_custom.sh
% assuming the options file is in the same folder as myFile.c else provide the full path to
% the options file.
Source: MexOptions
As a side note, since you're using Xcode 5.0, replace all instances of "10.7" in the option file with "10.8". However if your custom options file works just fine, then you can ignore this statement.
  댓글 수: 2
Nicolas
Nicolas 2013년 10월 3일
Thanks for the quick reply Harsheel, really appreciate it. One more thing, a header I'm including is in a different folder, what switch should be used?
I tried
mex myfile.c -f mexopts_custom.sh -LheaderPath/header.h
to no avail: it produces an error saying file 'header.h' was not found.
Thanks a bunch,
Harsheel
Harsheel 2013년 10월 3일
you're welcome Nicolas. Please refer to the following link for your question:

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

추가 답변 (1개)

Ken Atwell
Ken Atwell 2013년 10월 4일
Xcode 5 removed the 10.7 SDK that MEX is looking for. See:
  댓글 수: 1
Nicolas
Nicolas 2013년 10월 4일
Thanks Ken! This is one of the reasons I wanted to use a custom mexopts shell script.

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

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by