Invalid MEX-file: snopt 7.5 not working on Mac OS 10.10?

268 views
Skip to first unread message

Delyle Polet

unread,
Feb 25, 2016, 12:05:22 PM2/25/16
to SNOPT
Excuse me in advance for my ignorance.

I have experienced three, seemingly-related issues in installing snopt 7.5 and getting it to work on MATLAB 2015b for Mac.

I followed the instructions in the INSTALL file included in the zip folder. In particular, I ran the following commands from terminal:

>> ./configure --with-matlab=/Applications/MATLAB_R2015b.app
>> make
>> make install
>> make check

All commands appear to execute without error, and the final command issues the result: "0 /tmp/EXITdiffs.txt    is good news (no differences)"

However, when in MATLAB in the snopt7/matlab directory, if I try to issue the command `runNPexamples`, I get the following error (emphasis added)

Invalid MEX-file '/Users/delyle/Documents/MATLAB/snopt7/matlab/snoptmex.mexmaci64':
dlopen(/Users/delyle/Documents/MATLAB/snopt7/matlab/snoptmex.mexmaci64, 6): Symbol not found:
__gfortran_transfer_array_write
  Referenced from: /Users/delyle/Documents/MATLAB/snopt7/matlab/snoptmex.mexmaci64 (which was built for Mac OS X
  10.11)
  Expected in: /Applications/MATLAB_R2015b.app/sys/os/maci64/libgfortran.3.dylib
 in /Users/delyle/Documents/MATLAB/snopt7/matlab/snoptmex.mexmaci64
Error in snscreen (line 18)
  snoptmex( screenon );
Error in runNPexamples (line 6)
snscreen on 

I get a similar error when invoking `runQPexamples`.

Does this mean I need to upgrade my system to 10.11 to use snopt 7.5?

Delyle Polet

unread,
Feb 25, 2016, 12:09:26 PM2/25/16
to SNOPT
I should also mention that when I replace the generated `snoptmex.mexmaci64` with the precompiled equivalent, the command `runNPexamples` executes, but halts on the hs116 example with the following error

Error using hs116
Too many output arguments.
Error in runNPexamples (line 50)
[x,xmul,F,Fmul,info] = hs116;

Philip E. Gill

unread,
Feb 25, 2016, 12:21:45 PM2/25/16
to sn...@googlegroups.com
Hi Delyle,

Unfortunately, Matlab 2015b does not support mex files compiled with
versions of gfortran later than 4.3.

Using the precompiled file snoptmex.mexmaci64 should work though.

I'm not sure what causes the HS116 error. It may be something with Matlab 2015b.
It's hard to keep up with all the minor non-backward-compatible changes that
Mathworks makes to each Matlab release.

If snoptmex.mexmaci64 works with GPOPS II, that should be good enough. Please let us know.

We will take a look at the HS116 issue.

Cheers,
--Philip


On 2/25/16 9:05 AM, Delyle Polet wrote:
> Excuse me in advance for my ignorance.
>
> I have experienced three, seemingly-related issues in installing snopt 7.5 and getting it to work on MATLAB 2015b for Mac.
>
> I followed the instructions in the INSTALL file included in the zip folder. In particular, I ran the following commands from terminal:
>
> >> ./configure --with-matlab=/Applications/MATLAB_R2015b.app
> >> make
> >> make install
> >> make check
>
> All commands appear to execute without error, and the final command issues the result: "0 /tmp/EXITdiffs.txt is good news (no differences)"
>
> However, when in MATLAB in the snopt7/matlab directory, if I try to issue the command `runNPexamples`, I get the following error (emphasis added)
>
> Invalid MEX-file '/Users/delyle/Documents/MATLAB/snopt7/matlab/snoptmex.mexmaci64':
> dlopen(/Users/delyle/Documents/MATLAB/snopt7/matlab/snoptmex.mexmaci64, 6): Symbol not found:
> __gfortran_transfer_array_write
> Referenced from: /Users/delyle/Documents/MATLAB/snopt7/matlab/snoptmex.mexmaci64 (*which was built for Mac OS X*
> * 10.11*)
> Expected in: /Applications/MATLAB_R2015b.app/sys/os/maci64/libgfortran.3.dylib
> in /Users/delyle/Documents/MATLAB/snopt7/matlab/snoptmex.mexmaci64
> Error in snscreen (line 18)
> snoptmex( screenon );
> Error in runNPexamples (line 6)
> snscreen on
>
>
> I get a similar error when invoking `runQPexamples`.
>
> Does this mean I need to upgrade my system to 10.11 to use snopt 7.5?
>
> --
> You received this message because you are subscribed to the Google Groups "SNOPT" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to snopt+un...@googlegroups.com <mailto:snopt+un...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Delyle Polet

unread,
Feb 25, 2016, 12:35:06 PM2/25/16
to SNOPT, pg...@ucsd.edu
Hello Philip,

When I call SNOPT with GPOPS-II, it does not execute and displays an error:

Error using snoptmex
Wrong number of input arguments
Error in gpopsSnoptHandlerRPMD
Error in gpopsSolveRPMD
Error in gpopsMeshShell
Error in gpops2

This error occurs in both R2015a and R2015b.

Note also that the hs116 error occurs in both versions of Matlab as well. With snopt 7.4, I didn't have any issues calling snopt from GPOPS-II, or in running the NP/QP examples. (I did, however, have issues with LU rook, which is why I upgraded to the latest version of snopt).

Delyle

Delyle Polet

unread,
Feb 25, 2016, 12:55:18 PM2/25/16
to SNOPT, pg...@ucsd.edu
UPDATE: I fixed the error calling hs116 by simply adding `[x,F,INFO,xmul,Fmul]` to the hs116 function output. Now runNPexamples and runQPexamples execute without issue, but the compatibility issue with GPOPS-II persists!

Elizabeth Wong

unread,
Feb 25, 2016, 12:59:47 PM2/25/16
to SNOPT, pg...@ucsd.edu
Hi Delyle,

The hs116 issue isn't a big deal, but thank you for bringing it up -- I've fixed it now in our code.

The big issue is the one with Matlab r2015a/b.  Just to clarify...does the runNPexamples script run (minus the hs116 issue)?  

--Elizabeth

Philip E. Gill

unread,
Feb 25, 2016, 1:01:26 PM2/25/16
to sn...@googlegroups.com
Hi Delyle,

This looks like something you will have to take up with Anil Rao, the
developer of GPOPS. We have no control on interfaces to third party
software. I will bcc a copy of this message to him.

Cheers,
--Philip
> > For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.

Delyle Polet

unread,
Feb 25, 2016, 1:12:20 PM2/25/16
to SNOPT, pg...@ucsd.edu
Elizabeth: Yes, runNPexamples and runQPexamples now execute without issue.

Philip: Thanks for bringing it to the attention of Dr. Rao, but it would seem that the compatibility issue is due to some differences between snopt 7.4 and 7.5. GPOPS-II can call snopt-7.4 without any problem, but not snopt 7.5. Is there some workaround I can use while we wait for Dr. Rao to respond?

Thanks,
Delyle

Philip E. Gill

unread,
Feb 25, 2016, 1:29:34 PM2/25/16
to sn...@googlegroups.com
Hi Delyle,

You are unlucky because the bug in the LU factor routines happens very
rarely (it took some effort over several months to reproduce the error here!).

If the seg fault from 7.4 doesn't prevent you from getting results, then
I suggest that in the short term, you should go back to using it.

Stay tuned though. We'll get back to you as soon as we can.

Cheers,
--Philip
> > > For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout> <https://groups.google.com/d/optout <https://groups.google.com/d/optout>>.
> >
> > --
> > You received this message because you are subscribed to the Google Groups "SNOPT" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to snopt+un...@googlegroups.com <javascript:> <mailto:snopt+un...@googlegroups.com <javascript:>>.
Reply all
Reply to author
Forward
0 new messages