mex and f77blas.h with Octave.app for Mac

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

mex and f77blas.h with Octave.app for Mac

rdzman
First, a big thanks to all who have helped make Octave.app on macOS a reality. I’m currently using the latest 4.4.1 beta4 and it is wonderful to have a self-contained package that allows me to easily keep various versions of Octave installed for testing purposes.

I’m attempting to build SeDuMi [1] with the following command (which calls mex internally), executed from the command-line in Octave-4.4.1.app ...

    install_sedumi('-rebuild')

… but it complains of a missing header file f77blas.h, which I see is included at …

    Octave-4.4.1.app/Contents/Resources/usr/Cellar/openblas_0.3.3_0/0.3.3/include/f77blas.h

So, my question is, how can I make it successfully find and use that header file when calling install_sedumi?


Additional Background

I have successfully compiled some MEX files (e.g. SDPT3 [2]) using this installation. For example, the following works just fine to build and install SDPT3 …

cd sdpt3
octave-cli --no-gui --eval "install_sdpt3('-rebuild'); savepath"

… where octave-cli points to the one in Octave-4.4.1.app.

And, for what it’s worth, I was having the same problem building SeDuMi on Ubuntu (on Travis CI) and was able to resolve it by installing libopenblas-dev and changing the include statement from #include “f77blas.h" to #include <openblas/f77blas.h> (based on [3]). The following lines are all it takes to successfully build on Ubuntu now …

cd sedumi
patch blksdp.h < ../f77blas_h.patch
octave-cli --no-gui --eval "install_sedumi('-rebuild'); savepath"

… where f77blas_h.patch changes the include statement as described above.

Thanks,

    Ray



Reply | Threaded
Open this post in threaded view
|

Re: mex and f77blas.h with Octave.app for Mac

siko1056
On Tue, Jan 15, 2019 at 5:58 PM Ray Zimmerman <[hidden email]> wrote:
[...] I’m attempting to build SeDuMi [1] with the following command (which calls mex internally), executed from the command-line in Octave-4.4.1.app ...

    install_sedumi('-rebuild')

… but it complains of a missing header file f77blas.h, which I see is included at …

    Octave-4.4.1.app/Contents/Resources/usr/Cellar/openblas_0.3.3_0/0.3.3/include/f77blas.h

So, my question is, how can I make it successfully find and use that header file when calling install_sedumi?

Can you show the result of the following command in the Octave app:

   mkoctfile -p ALL_CFLAGS

That should reveal the default include directories of "mex" aka "mkoctfile --mex".  Maybe you can add to "install_sedumi" [1] something like

   flags{end+1} = '-I/Octave-4.4.1.app/Contents/Resources/usr/Cellar/openblas_0.3.3_0/0.3.3/include';

that "mkoctfile" and "mex" can find your header.

Best,
Kai