[Ipopt] Octave MEX interface on containerized macOS

Ted Ralphs ted at lehigh.edu
Wed Nov 20 10:24:02 EST 2019


I don't know that much about Mumps, but it looks like the Ipopt homebrew
recipe builds Ipopt with the MPI version of Mumps. The formula is here:

https://github.com/Homebrew/homebrew-core/blob/master/Formula/ipopt.rb

It looks to me like the easiest solution is just to build Ipopt yourself
instead of with Homebrew. You are already downloading the Ipopt code
anyway, so this would seem to be straightforward. If you really need to
install from homebrew, I just found another tap that provides an Ipopt
recipe and expicitly allows the option not to use MPI:

https://github.com/dpo/homebrew-openblas
<https://github.com/dpo/homebrew-openblas/tree/master/Formula>

You could either use this one or submit a PR to Homebrew core to ask that
this option be added (not sure how successful this will be).

Cheers,

Ted



On Tue, Nov 19, 2019 at 11:18 PM Ray Zimmerman <rz10 at cornell.edu> wrote:

> Hi all,
>
> I use Octave with IPOPT for continuous integration testing of some of my
> code via Travis CI. I am able to build a working MEX file in their Linux
> container, but so far I’m getting MPI runtime errors in their macOS
> container.
>
> Homebrew is used to install IPOPT and Octave in the macOS container …
>
> brew install ipopt
> brew install octave
>
> … then grab the corresponding source from the coin-or.org site, and build
> it using the Makefile below, as follows:
>
> IPOPT_VER=3.12.13
> curl -SL
> https://www.coin-or.org/download/source/Ipopt/Ipopt-${IPOPT_VER}.tgz |
> tar -xzC $TRAVIS_BUILD_DIR/build
> mv
> $TRAVIS_BUILD_DIR/build/Ipopt-${IPOPT_VER}/Ipopt/contrib/MatlabInterface
> $TRAVIS_BUILD_DIR/build/ipopt
> mv $TRAVIS_BUILD_DIR/.travis/Makefile $TRAVIS_BUILD_DIR/build/ipopt/src
> make -C $TRAVIS_BUILD_DIR/build/ipopt/src
>
> It builds fine, but at runtime, when attempting to call the MEX file from
> Octave, I get the following error:
>
> *** The MPI_Comm_f2c() function was called before MPI_INIT was invoked.
> *** This is disallowed by the MPI standard.
> *** Your MPI job will now abort.
> [Traviss-Mac-6.local:87648] Local abort before MPI_INIT completed
> completed successfully, but am not able to aggregate error messages, and
> not able to guarantee that all other processes were killed!
>
> Any suggestions for how to modify either the homebrew IPOPT install or the
> MEX build to avoid the use of MPI?
>
> Thanks,
>
>     Ray
>
> ————————————————
>
> Makefile contents:
>
> # Copyright 2017 Richard Lincoln. All rights reserved.
>
> OBJS = callbackfunctions.o \
>        ipoptoptions.o \
>        ipopt.o \
>        iterate.o \
>        matlabexception.o \
>        matlabfunctionhandle.o \
>        matlabinfo.o \
>        matlabjournal.o \
>        matlabprogram.o \
>        options.o \
>        sparsematrix.o
>
> CXXFLAGS = -fPIC -std=c++11 -O3 -DIPOPT_BUILD -DMATLAB_MEXFILE
> -DHAVE_CSTDDEF
>
> INCL = `pkg-config --cflags ipopt` -I`mkoctfile -p OCTINCLUDEDIR`
> LIBS = `pkg-config --libs ipopt`
>
> all: ipopt.mex
>
> %.o: %.cpp
>     g++ $(CXXFLAGS) $(INCL) -o $@ -c $^
>
> ipopt.mex: $(OBJS)
>     mkoctfile $(LIBS) -v --mex --output $@ $^
>
> clean:
>     rm -f $(OBJS) ipopt.mex
>
> check:
>     octave-cli --no-gui -p `pwd`/examples --eval
> "examplehs038;examplehs051;examplehs071;examplelasso"
>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> https://list.coin-or.org/mailman/listinfo/ipopt
>


-- 
Dr. Ted Ralphs
Professor, Industrial and Systems Engineering
Lehigh University
(610) 628-1280
ted 'at' lehigh 'dot' edu
coral.ie.lehigh.edu/~ted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20191120/cb03a317/attachment.html>


More information about the Ipopt mailing list