error compiling mexfiles matlab 2014a

426 views
Skip to first unread message

Elizabeth Wong

unread,
Jun 28, 2014, 3:48:29 AM6/28/14
to sn...@googlegroups.com
-------------------------
When trying to compile the Matlab mex-files for SNOPT, I get the following error:

Verbose mode is on.
Unknown MEX argument '-o'.
make: *** [snoptmex] Error 255
-------------------------

There were some changes to mex in Matlab 2014a.  We're looking into modifying the configure/make files for SNOPT so that they work for 2014a and pre-2014a versions of Matlab.  The good news is that the precompiled mex-files included in the SNOPT package are compatible with Matlab 2014a.

--Elizabeth

andre...@gmail.com

unread,
Sep 15, 2014, 2:50:56 AM9/15/14
to sn...@googlegroups.com
Hi,

I'm having this issue. I did some modifications to the mex interface and now I want to rebuild it in matlab2014a. What are the modifications to the makefiles?

Thanks!

Andres

Elizabeth Wong

unread,
Sep 16, 2014, 6:17:18 PM9/16/14
to sn...@googlegroups.com, andre...@gmail.com
Hi Andres,

Try replacing the existing Submakefile in the $SNOPT/mex directory with this one: http://ccom.ucsd.edu/~optimizers/downloads/mex-Submakefile
Then a 'make mex' should work.  Let me know if you have any more problems.

--Elizabeth

andre...@gmail.com

unread,
Sep 17, 2014, 4:38:00 AM9/17/14
to sn...@googlegroups.com, andre...@gmail.com
Hi Elizabeth,

I get the following error:

bin/bash ./libtool --mode=install --quiet /usr/bin/install -c ./lib/libsnmex.la /home/codas/snopt/lib
/bin/bash ./libtool --mode=finish --quiet /home/codas/snopt/lib
/home/codas/MATLAB/R2014a/bin/mex -v /snmex.F90 \
/iomex.f90 /snoptmex.F90 \
FFLAGS='$FFLAGS ' LD='gfortran' \
LDFLAGS='$LDFLAGS ' \
/home/codas/snopt/lib/libsnmex.a -output snoptmex -outdir
Verbose mode is on.
/snmex.F90 not found; check that you are in the correct current folder, and check the spelling of '/snmex.F90'.

But I must say that I'm having problems not only to install the mex files, but to install the c and cpp libraries too.

I'm on a ubuntu 14.04 with gcc version 4.8.2 and gfortran 4.8.2. In the README.WhatsNew I see that the version of snopt I have is 7.2-12.
I got help from other snopt user and I manage to compile the c libraries with the following commands:

codas@apis:~/snopt7$ ./configure --prefix=/home/codas/snopt7
make FFLAGS="-O -fPIC -fdefault-integer-8" CFLAGS="-O -fPIC" CXXFLAGS="-O -fPIC"

Observe that I'm running the configure on the same directory as the snopt7 src, and the prefix is pointing there too. That is the only combination I managed to get to work. First I tried to compile from a 'build' subdirectory and with a different prefix and it didn't work.
Further, the additional flags in the make command need to be set.

From the error message for the mex file it seems a prefix is not being set too.

So, I believe I have inconsistent makefiles. I'm not sure how to proceed. Do you have any update for this?

Thanks in advance

Andres

Elizabeth Wong

unread,
Sep 17, 2014, 11:17:31 AM9/17/14
to sn...@googlegroups.com, andre...@gmail.com
That's very strange.  I'm not really sure what's happening.  Can you send your config.log to me?

--Elizabeth
Reply all
Reply to author
Forward
0 new messages