Build and Run Fortran Engine Applications on macOS
This example shows how to build and run the example
fengdemo.F from the macOS Terminal Window.
Open MATLAB®.
Make note of the value of matlabroot (the folder where MATLAB is installed) command. You will use the value later to set the run-time
library path.
matlabroot
Verify your current folder is writable and copy the example.
copyfile(fullfile(matlabroot,"extern","examples","eng_mat","fengdemo.F"),".","f")
Build the application.
mex -v -client engine fengdemo.F
Set the system path. Make sure that you include the : path
terminator character.
setenv PATH matlabroot/bin:$PATHSet the run-time library path and call the fengdemo application.
The application must be on your system path. This command replaces the value, if any, in
DYLD_LIBRARY_PATH.
DYLD_LIBRARY_PATH=matlabroot/bin/maca64:matlabroot/sys/os/maca64 ./fengdemoMATLAB starts and displays a figure.
Type 1 <Enter> at the system prompt to continue and exit.