<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi all,</div><div class=""><br class=""></div>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.<div class=""><br class=""></div><div class="">Homebrew is used to install IPOPT and Octave in the macOS container …</div><div class=""><br class=""></div><div class=""><font face="Courier" class="">brew install ipopt</font></div><div class=""><font face="Courier" class="">brew install octave</font></div><div class=""><br class=""></div><div class="">… then grab the corresponding source from the <a href="http://coin-or.org/" class="">coin-or.org</a> site, and build it using the Makefile below, as follows:</div><div class=""><br class=""></div><div class=""><div class=""><font face="Courier" class=""><div class="">IPOPT_VER=3.12.13</div></font></div><div class=""><font face="Courier" class="">curl -SL <a href="https://www.coin-or.org/download/source/Ipopt/Ipopt-$%7BIPOPT_VER%7D.tgz" class="">https://www.coin-or.org/download/source/Ipopt/Ipopt-${IPOPT_VER}.tgz</a> | tar -xzC $TRAVIS_BUILD_DIR/build</font></div><div class=""><font face="Courier" class="">mv $TRAVIS_BUILD_DIR/build/Ipopt-${IPOPT_VER}/Ipopt/contrib/MatlabInterface $TRAVIS_BUILD_DIR/build/ipopt</font></div><div class=""><font face="Courier" class="">mv $TRAVIS_BUILD_DIR/.travis/Makefile $TRAVIS_BUILD_DIR/build/ipopt/src</font></div><div class=""><font face="Courier" class="">make -C $TRAVIS_BUILD_DIR/build/ipopt/src</font></div><div class=""><br class=""></div><div class="">It builds fine, but at runtime, when attempting to call the MEX file from Octave, I get the following error:</div><div class=""><br class=""></div><div class=""><font face="Courier" class=""><span style="font-size: 13.333333015441895px;" class="">*** The MPI_Comm_f2c() function was called before MPI_INIT was invoked.</span><br style="font-size: 13.333333015441895px;" class=""><span style="font-size: 13.333333015441895px;" class="">*** This is disallowed by the MPI standard.</span><br style="font-size: 13.333333015441895px;" class=""><span style="font-size: 13.333333015441895px;" class="">*** Your MPI job will now abort.</span><br style="font-size: 13.333333015441895px;" class=""><span style="font-size: 13.333333015441895px;" class="">[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!</span></font></div><div class=""><br class=""></div><div class="">Any suggestions for how to modify either the homebrew IPOPT install or the MEX build to avoid the use of MPI?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">    Ray</div><div class=""><br class=""></div><div class="">————————————————</div><div class=""><br class=""></div><div class="">Makefile contents:</div></div><div class=""><br class=""></div><div class=""><div class=""><font face="Courier" class=""># Copyright 2017 Richard Lincoln. All rights reserved.</font></div><div class=""><font face="Courier" class=""><br class=""></font></div><div class=""><font face="Courier" class="">OBJS = callbackfunctions.o \</font></div><div class=""><font face="Courier" class="">       ipoptoptions.o \</font></div><div class=""><font face="Courier" class="">       ipopt.o \</font></div><div class=""><font face="Courier" class="">       iterate.o \</font></div><div class=""><font face="Courier" class="">       matlabexception.o \</font></div><div class=""><font face="Courier" class="">       matlabfunctionhandle.o \</font></div><div class=""><font face="Courier" class="">       matlabinfo.o \</font></div><div class=""><font face="Courier" class="">       matlabjournal.o \</font></div><div class=""><font face="Courier" class="">       matlabprogram.o \</font></div><div class=""><font face="Courier" class="">       options.o \</font></div><div class=""><font face="Courier" class="">       sparsematrix.o</font></div><div class=""><font face="Courier" class=""><br class=""></font></div><div class=""><font face="Courier" class="">CXXFLAGS = -fPIC -std=c++11 -O3 -DIPOPT_BUILD -DMATLAB_MEXFILE -DHAVE_CSTDDEF</font></div><div class=""><font face="Courier" class=""><br class=""></font></div><div class=""><font face="Courier" class="">INCL = `pkg-config --cflags ipopt` -I`mkoctfile -p OCTINCLUDEDIR`</font></div><div class=""><font face="Courier" class="">LIBS = `pkg-config --libs ipopt`</font></div><div class=""><font face="Courier" class=""><br class=""></font></div><div class=""><font face="Courier" class="">all: ipopt.mex</font></div><div class=""><font face="Courier" class=""><br class=""></font></div><div class=""><font face="Courier" class="">%.o: %.cpp</font></div><div class=""><font face="Courier" class="">    g++ $(CXXFLAGS) $(INCL) -o $@ -c $^</font></div><div class=""><font face="Courier" class=""><br class=""></font></div><div class=""><font face="Courier" class="">ipopt.mex: $(OBJS)</font></div><div class=""><font face="Courier" class="">    mkoctfile $(LIBS) -v --mex --output $@ $^</font></div><div class=""><font face="Courier" class=""><br class=""></font></div><div class=""><font face="Courier" class="">clean:</font></div><div class=""><font face="Courier" class="">    rm -f $(OBJS) ipopt.mex</font></div><div class=""><font face="Courier" class=""><br class=""></font></div><div class=""><font face="Courier" class="">check:</font></div><div class=""><font face="Courier" class="">    octave-cli --no-gui -p `pwd`/examples --eval "examplehs038;examplehs051;examplehs071;examplelasso"</font></div></div><div class=""><br class=""></div></div></body></html>