Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

Fortran-Matlab interface

$
0
0

Hello,

 

 

I am very new to Fortran. I am building some Fortran codes to run some post-processing of data acquired by an ultrasound system that is controlled by Matlab. I cannot get away with Matlab because it is where the data is coming from. So far my solution is to use Matlab's "fopen" and "fwrite" functions to write the data into a file on the hard drive, and then read in the file using my Fortran codes. I have two questions:

1. I am running Matlab 2014a on a Mac OS (10.10) with Intel Fortran 2016 (compilers and libraries 2016.3.170). Under terminal window, I could run the Unix executable fine. But in Matlab's command window, when I run "./myfunction", it gives me the error below:

           dyld: Library not loaded: @rpath/libmkl_intel_lp64.dylib
           Referenced from: /Volumes/...
           Reason: image not found

I know that under the terminal window, I have to always call "source bin/compilervars.sh intel64". I did this in Matlab's command window. It    would run but would still gives me the error above when I tried executing my function. Any ideas on how to do this?

2. The Matlab "fopen" and "fwrite" solution is not optimal. I was thinking about building my Fortran codes with Matlab's mex function, but mex doesn't seem to support Fortran 2016 on a Mac OS X. Any suggestions on how to efficiently run a Fortran executable that is interacting with Matlab? The main interaction between the two is data input and data output: Matlab raw data -> my Fortran function for processing -> output to Matlab. 

Thank you!

 

Thread Topic: 

Question

Viewing all articles
Browse latest Browse all 2746

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>