Main Content

Build and Run Fortran Engine Applications onLinux

This example shows how to build and run thefengdemo.Fexample on Linux®platforms.

Open MATLAB®.

Make note of the value ofmatlabroot(the folder where MATLAB is installed) command. You will use the value later to set the run-time library path insetenvcommands.

matlabroot

Verify that your current folder is writable and copy the example.

copyfile(fullfile(matlabroot,'extern','examples','eng_mat',fengdemo.F'),'.','f')

Build the application.

mex-v-clientenginefengdemo.F

Set the run-time library path. This command replaces the value, if any, inLD_LIBRARY_PATH. For more information, seeSet Run-Time Library Path on Linux Systems.

setenv LD_LIBRARY_PATHmatlabroot/bin/glnxa64:matlabroot/sys/os/glnxa64

Set the path. Make sure that you include the:path terminator character.

setenv PATHmatlabroot/bin:$PATH

Run the example. Thefengdemoapplication must be on your system path.

./fengdemo

MATLAB starts and displays a figure.

Type1 at the system prompt to continue and exit.

Related Examples

More About