How to build and install the lp_solve Java extension on Mac OS X:
Download and expanded lp_solve_5.5_source.tar.gz into a
directory named 'lp_solve_5.5'.
Download and expand lp_solve_5.5_java.zip into a
directory named 'lp_solve_5.5_java'.
1) Build the lp_solve library.
$ cd lp_solve_5.5/lpsolve55
$ sh ccc.osx
This creates two new files in the lpsolve55 subdirectory:
$ ls liblp*
liblpsolve55.a liblpsolve55.dylib
2) Install the lp_solve library.
If not already in directory lpsolve55, cd to it. Copy liblpsolve55.a
and
liblpsolve55.dylib to /usr/local/lib (you may need to create
/usr/local/lib first: sudo mkdir -p /usr/local/lib):
$ sudo cp liblpsolve55.a liblpsolve55.dylib /usr/local/lib
3) Test the build and installation.
$ cd lp_solve_5.5/demo
The ccc.osx script is broken. The good news is that version 5.5 of
lp_solve fixes the "malloc.h" incompatibility on the Mac that was in
earlier versions. The Unix/Linux script now works on OS X. Be
patient...
it may take several seconds to build 'demo':
$ sh ccc
The example problems in the demo should issue no errors and have
"Excellent numeric accuracy ||*|| = 0":
$ ./demo
4) Build the lp_solve JNI extension.
$ cd lp_solve_5.5_java/lib/mac
The script "build-osx" in the mac subdirectory is a DOS text file:
$ file build-osx
build-osx: ASCII English text, with CRLF line terminators
If you try execute this file, you will get "command not found"
errors. To
convert it into a Unix file, remove the carriage returns:
$ tr -d "\r" < build-osx > build-osx1
Edit build-osx1 to set LPSOLVE_DIR to the location of directory
lp_solve_5.5 on your computer. Change the two occurrences of '5.1' to
'5.5' and the two occurrences of '51' to '55' in the last line of
build-osx1.
$ sh build-osx1
This creates the extension library liblpsolve55j.jnilib.
5) Install the lp_solve JNI extension.
The file liblpsolve55j.jnilib should be copied to /Library/Java/
Extensions
if you want it to be available to all users. We assume this will be a
private installation (create the Java extensions directory if necessary;
e.g., mkdir -p ~/Library/Java/Extensions):
$ cp liblpsolve55j.jnilib ~/Library/Java/Extensions
6) Test the Java extension:
$ cd lp_solve_5.5_java/demo
$ java -cp ./demo.jar:../lib/lpsolve55j.jar Demo
The numerical results of the Java Demo should be identical to those
of the
C demo.
There is a Java unit test. Out of 122 tests, I got 5 errors and 3
failures, all of which could be explained (missing XLI applications,
missing BFP libraries, outdated version numbers in tests, negligible
floating point differrences):
$ java -cp ./unittests.jar:../lib/lpsolve55j.jar:../lib/junit.jar
LpSolveTest
7) For more information about Java programming on Mac OS X:
Java Frequently Asked Questions: Common Development Questions
<
http://developer.apple.com/java/faq/development.html>
Thread at a glance:
Previous Message by Date:
click to view message preview
Progressive dinner
I have one question. Can I use a equation such as Abs(x1-x2) ≥ 6,
where Abs is absolute value.
I think I'm making progress. I restated the problem using only house
and couple variables, since house implies meal (meal 1 = houses
11-19, meal 2 = houses 20-29, meal 3 = houses 1-10). I'm stuck
somewhat on the eliminating people sitting with other couples more
than once.
I've included my work for your info.
John McIntosh
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/lp_solve/
<*> To unsubscribe from this group, send an email to:
lp_solve-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
progdin.lp
Description: Binary data
Next Message by Date:
click to view message preview
Re:Progressive dinner
>I have one question. Can I use a equation such as Abs(x1-x2) >= 6, >where Abs is absolute value.
This question is very adequately handled in the "absolute values" page at
http://lpsolve.sourceforge.net/5.5/
Accédez au courrier électronique de La Poste : www.laposte.net ;
3615 LAPOSTENET (0,34 /mn) ; tél : 08 92 68 13 50 (0,34/mn)
SPONSORED LINKS
Solve debt
Computer programming software
Solve computer problem
YAHOO! GROUPS LINKS
Visit your group "lp_solve" on the web.
To unsubscribe from this group, send an email to: lp_solve-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Previous Message by Thread:
click to view message preview
Re: Mac OS X java.library.path
Obviously, your test program is not running code from the
lpsove55j.jar file. Here, you are trying to load the stub library
directly. This is normally done indirectly by the LpSolve.class. Just
compare the stack traces in both cases.
Perhaps there is a misunderstanding. System.loadLibrary loads a
*native* library, not a jar file!
Juergen
--- In lp_solve@xxxxxxxxxxxxxxx, "Whit Nelson" <flipdoubt@...> wrote:
>
> In an attempt to isolate the issue, I created a test program:
>
> class test
> {
> public static void main(String args[])
> {
> System.loadLibrary("lpsolve55j");
> }
> }
>
> It outputs this:
> Exception in thread "main" java.lang.UnsatisfiedLinkError: no
lpsolve55j in java.library.path
> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1517)
> at java.lang.Runtime.loadLibrary0(Runtime.java:788)
> at java.lang.System.loadLibrary(System.java:834)
> at test.main(test.java:7)
>
> Are you quite certain it is running code from the jar file? Thanks,
>
> -- whit
>
> --- In lp_solve@xxxxxxxxxxxxxxx, "Juergen Ebert" <juergen.ebert@> wrote:
> >
> > The jar file is not the problem. The following line from the stack
> > trace shows that you are already excuting code from lpsolve55j.jar.
> >
> > > > at lpsolve.LpSolve.<clinit>(LpSolve.java:274)
> >
> > In fact, you wouldn't even be able to compile the demo program if the
> > jar file wasn't in the classpath (of the compiler). The problem is the
> > native stub library, which cannot be found by the LpSolve class.
> > Remember, in Java the calling sequence is as follows:
> >
> > your Java code -> Classes from lpsolve55.jar --> Native stub library
> > --> lpsolve library
> >
> > So what is missing is still the native library for your platform. As
> > Peter already pointed out, we have precompiled binaries for Win32 and
> > Linux, but not for Mac. You have to do that yourself. The lib/mac
> > directory in the java wrapper distribution contains a script file that
> > you may use as a starter. But please don't ask me about it, I don't
> > know Mac, it was donated by someone else
> >
> > Juergen
> >
> >
> > --- In lp_solve@xxxxxxxxxxxxxxx, John McIntosh <john@> wrote:
> > >
> > > where did you find lpsolve55j.jar?
> > >
> > > John
> > >
> > > On Feb 15, 2006, at 5:20 PM, Whit Nelson wrote:
> > >
> > > > I have been trying for ages to get this thing working correctly.
> > > > When I run it I get the
> > > > following error:
> > > >
> > > > Exception in thread "main" java.lang.UnsatisfiedLinkError: no
> > > > lpsolve55j in java.library.path
> > > > at
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1517)
> > > > at java.lang.Runtime.loadLibrary0(Runtime.java:788)
> > > > at java.lang.System.loadLibrary(System.java:834)
> > > > at lpsolve.LpSolve.<clinit>(LpSolve.java:274)
> > > > at Demo.execute(Demo.java:38)
> > > > at Demo.main(Demo.java:281)
> > > >
> > > > I have tried putting lpsolve55j.jar everywhere I can think of.
/usr/
> > > > lib, /usr/local/lib, in the
> > > > same folder with Demo.java. Can anyone help me setup my
> > > > java.library.path properly?
> > > > Thanks.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > SPONSORED LINKS
> > > > Solve debt Computer programming software Solve computer problem
> > > >
> > > > YAHOO! GROUPS LINKS
> > > >
> > > > Visit your group "lp_solve" on the web.
> > > >
> > > > To unsubscribe from this group, send an email to:
> > > > lp_solve-unsubscribe@xxxxxxxxxxxxxxx
> > > >
> > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
> > > >
> > > >
> > >
> >
>
Next Message by Thread:
click to view message preview
Re: Mac OS X java.library.path
Well, that settles that. Thank you very much.
-- whit
--- In lp_solve@xxxxxxxxxxxxxxx, John Gleeson <jdgleeson@...> wrote:
>
> How to build and install the lp_solve Java extension on Mac OS X:
>
> Download and expanded lp_solve_5.5_source.tar.gz into a
> directory named 'lp_solve_5.5'.
>
> Download and expand lp_solve_5.5_java.zip into a
> directory named 'lp_solve_5.5_java'.
>
> 1) Build the lp_solve library.
>
> $ cd lp_solve_5.5/lpsolve55
> $ sh ccc.osx
>
> This creates two new files in the lpsolve55 subdirectory:
>
> $ ls liblp*
> liblpsolve55.a liblpsolve55.dylib
>
> 2) Install the lp_solve library.
>
> If not already in directory lpsolve55, cd to it. Copy liblpsolve55.a
> and
> liblpsolve55.dylib to /usr/local/lib (you may need to create
> /usr/local/lib first: sudo mkdir -p /usr/local/lib):
>
> $ sudo cp liblpsolve55.a liblpsolve55.dylib /usr/local/lib
>
> 3) Test the build and installation.
>
> $ cd lp_solve_5.5/demo
>
> The ccc.osx script is broken. The good news is that version 5.5 of
> lp_solve fixes the "malloc.h" incompatibility on the Mac that was in
> earlier versions. The Unix/Linux script now works on OS X. Be
> patient...
> it may take several seconds to build 'demo':
>
> $ sh ccc
>
> The example problems in the demo should issue no errors and have
> "Excellent numeric accuracy ||*|| = 0":
>
> $ ./demo
>
> 4) Build the lp_solve JNI extension.
>
> $ cd lp_solve_5.5_java/lib/mac
>
> The script "build-osx" in the mac subdirectory is a DOS text file:
>
> $ file build-osx
> build-osx: ASCII English text, with CRLF line terminators
>
> If you try execute this file, you will get "command not found"
> errors. To
> convert it into a Unix file, remove the carriage returns:
>
> $ tr -d "\r" < build-osx > build-osx1
>
> Edit build-osx1 to set LPSOLVE_DIR to the location of directory
> lp_solve_5.5 on your computer. Change the two occurrences of '5.1' to
> '5.5' and the two occurrences of '51' to '55' in the last line of
> build-osx1.
>
> $ sh build-osx1
>
> This creates the extension library liblpsolve55j.jnilib.
>
> 5) Install the lp_solve JNI extension.
>
> The file liblpsolve55j.jnilib should be copied to /Library/Java/
> Extensions
> if you want it to be available to all users. We assume this will be a
> private installation (create the Java extensions directory if necessary;
> e.g., mkdir -p ~/Library/Java/Extensions):
>
> $ cp liblpsolve55j.jnilib ~/Library/Java/Extensions
>
> 6) Test the Java extension:
>
> $ cd lp_solve_5.5_java/demo
> $ java -cp ./demo.jar:../lib/lpsolve55j.jar Demo
>
> The numerical results of the Java Demo should be identical to those
> of the
> C demo.
>
> There is a Java unit test. Out of 122 tests, I got 5 errors and 3
> failures, all of which could be explained (missing XLI applications,
> missing BFP libraries, outdated version numbers in tests, negligible
> floating point differrences):
>
> $ java -cp ./unittests.jar:../lib/lpsolve55j.jar:../lib/junit.jar
> LpSolveTest
>
> 7) For more information about Java programming on Mac OS X:
>
> Java Frequently Asked Questions: Common Development Questions
> <http://developer.apple.com/java/faq/development.html>
>