The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: cmex problem (lp_solve) with solaris 2.5
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
saurabh thapliyal

Posts: 9
Registered: 12/7/04
cmex problem (lp_solve) with solaris 2.5
Posted: Jul 16, 1996 8:43 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


I'm with Dr. Kantor's group at Notre Dame (process control) and we had
written a cmex file (for SunOS4.1.3) for a popular linear program
lp_solve, which was made available publically.

We are now trying to make it work for MATLAB4.2c under solaris 2.5.

The C code compiles and runs fine by itself in solaris, the .mexsol
cmex file is also compiled without any problems, and it even works ok
all of its segments, except one part. i.e. we can input and output
to and from the C file to MATLAB, make a lp, scale it,
add constraints etc., but when we try to solve it, we get a MATLAB bus

I would appreciate it if someone could provide some suggestions, when
bus errors occur, or if someone has had similar experiences with MATLAb
under solaris 2.5 (since the mathworks does not yet support matlab 4.2c
under this solaris version)

thanks very much,



Here's an example of the above problem :

>> f = [-1 2]';
>> A = [2 1;-4 4];
>> b = [5 5];
>> e = -[1 1];
>> xint = [1 2];

this is the LP input part, it works fine :

>> [m,n] = size(a);
>> lp = lpmex('make_lp',m,n);
>> lpmex('set_mat', lp, a);
>> lpmex('set_rh_vec', lp, b);
>> lpmex('set_obj_fn', lp, f);
>> lpmex('set_maxim', lp); % default is solving minimum lp.
>> for i = 1:length(e)

lpmex('set_constr_type', lp, i,e(i)+1);
>> >> for i = 1:length(xint)
lpmex('set_int', lp,xint(i),1);

We can also output the LP back into MATLAB :

>> lpmex('print_handle')

ans =


>> lpmex('print_lp',0)
problem name: unnamed
Var[ 1] Var[ 2]
Maximise -1.00 2.00
Row[ 1] 2.00 1.00 <= 5.00
Row[ 2] -4.00 4.00 <= 5.00
Type Int Int
upbo Inf Inf
lowbo 0.00 0.00

But when we try to solve :

>> lpmex('solve',0)

MATLAB bus error detected !!!

Please report this problem to The MathWorks if you can replicate it.
We need as much information as you can provide! Please include at least
the following:

1. MATLAB version number
2. Platform type, Operating System and Window System versions
3. Sample commands, M-files, or MEX-files that reproduce the error
4. Any other pertinent configuration information

Either E-mail the information to:

or FAX this information to:


Try to save your workspace and quit.
Error in ==> /afs/

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.