Skip to content

Compilation Problems with Matlab 2014a on Mac #64

@GoogleCodeExporter

Description

@GoogleCodeExporter
I have a problem to compile the mex files directly from the source, as it is 
recommended in the downloads section for MacOS users. I used 
RF_MexStandalone-v0.02.zip, Matlab R2014a and MacOS 10.9.4.

To do so I installed the latest version of gcc, 4.9.1 via macports, which is 
said to include gfortran.

When run 'make diabetes' in a terminal in the RF_Reg_C I get an output like this
   echo -e  'Compiling diabetes test case'
   -e Compiling diabetes test case
   g++  src/cokus.cpp src/reg_RF.cpp src/diabetes_C_wrapper.cpp -g -fPIC -pg -O2 -lm  -o diabetes_test
and a subsequent test './diabetes_test' suggests that everything works fine.

When I set the compiler for Matlab R2014a by 'mex -setup', I am told that I use 
a 'MEX configured to use 'Xcode with Clang' for C language compilation.' (which 
is probably what I used the last time I compiled anything via Matlab) and can 
choose a different language by 'mex -setup FORTRAN'. This gives me a positive 
output (at least when Matlab is opened from a terminal that 'knows' the path to 
gcc, see here: 
http://www.mathworks.com/matlabcentral/answers/116922-mex-cannot-find-gfortran-c
ompiler-mac-os), but also a warning:
   MEX configured to use 'gfortran' for FORTRAN language compilation.
   Warning: The MATLAB C and Fortran API has changed to support MATLAB
     variables with more than 2^32-1 elements. In the near future
     you will be required to update your code to utilize the
     new API. You can find more information about this at:
     http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.

Sadly, whenever I run any script now, that contains a command with 'mex ... -o 
...', I get the error
   Error using mex
   Unknown MEX argument '-o'.

Also sadly, the recommended 'compiler_settings.txt' in the 
'MacOS_precompiled-WITHOUT_SOURCE-v0.02.tar'-download are of no help to me, 
since they rely on a 'mexopts.sh'-file, which does not exist anymore for this 
version of Matlab.
http://www.mathworks.com/matlabcentral/answers/124597-how-to-setup-gfortran-on-m
ac-osx-10-9-and-matlab-r2014a
For the same reason, I could not apply anything I found so far in the issues 
section.

Any help would be greatly appreciated!
Best regards,
Rosmarie


Original issue reported on code.google.com by rosmarie...@gmail.com on 25 Aug 2014 at 3:49

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions