ILP is a very well know algorithm to discover Petri Nets out of Event Logs. It is implemented as a plug-in for ProM (versions 6.*) while it is also used in other PM techniques (e.g., the Divide and Conquer plug-in use ILP to Discover Petri Nets using Decomposition). To solve the corresponding linear problem it uses the free library Lpsolve.
However if you are using a 64bit Mac like me, if you try to run any ILP related action through ProM you will get a java exception.
In the following, I describe the solution I managed to find to make it work (HT to http://osdir.com/ml/mathematics.lpsolve/2006-02/msg00189.html). The general idea goes like this: 1) Build the lpsolve files from source, so that they are compatible with your system and 2) copy them to the appropriate folders. This is what I did, step-by-step (it’s easier than it looks!):
1. Get the files. Browse the lpsolve files at source forge (http://sourceforge.net/projects/lpsolve/files/lpsolve/5.5.2.0/) and download lp_solve_5.5_source.tar.gz and lp_solve_5.5_java
2. Prepare files. Expand lp_solve_5.5_source.tar.gz into a directory named ‘lp_solve_5.5’ (the lp_solve_5.5_java should be an unzipped folder with that name)
3. Create the necessary files by building the library. Navigate to the lpsolve55 directory in the lp_solve_5.5 folder and just enter the command (through Terminal)
$ sh ccc.osx
You should see two newly built files:
liblpsolve55.a liblpsolve55.dylib
I found them in a directory called bin/osx64, but based on different versions of the library you may find them directly to the lpsolve55 folder.
4. Install the lpsolve library. You need to copy the files to your local lib folder. Assuming that you are in the directory where those two files are, you can do it with the simple command
$ sudo cp liblpsolve55.a liblpsolve55.dylib /usr/local/lib
5. You may want to test it. To solve the demo linear problem just navigate to the demo folder of lp_solve_5.5 directory and type:
$ sh ccc
6. Build the lp_solve JNI extension. First navigate to the lp_solve_5.5_java/lib/mac folder. Because The script “build-osx” in the mac subdirectory is a DOS text file, if you try execute it, you will get “command not found” error. 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. TIP: When I executed this command, to my surprise all the “r” were disappeared from the new file. So mind to check it… Then, just type:
$ sh build-osx1
You may see a lot of warnings, but eventually it will create the extension library liblpsolve55j.jnilib
7. Install the lp_solve JNI extension. The file liblpsolve55j.jnilib should be copied to /Library/Java/
Extensions.
$ cp liblpsolve55j.jnilib ~/Library/Java/Extensions
8. Test the Java extension. You will run the same demo and you should expect the same results. There is also a Java unit test.
$ cd lp_solve_5.5_java/demo
$ java -cp ./demo.jar:../lib/lpsolve55j.jar Demo
$ java -cp ./unittests.jar:../lib/lpsolve55j.jar:../lib/junit.jar
LpSolveTest
9. Fix the ProM. Now, if you completed step 8 successfully, congrats you have lpsolve installed on your 64bit Mac. However, ProM doesn’t know it yet… In particular, ILP invokes the liblpsolve55.* files from the installed packages. So you just need to copy these files into the ProM packages folders. In my case, I navigated to the local lib folder and I used the command
cp liblpsolve55.a liblpsolve55.dylib /Users/pavlos/.ProM64/packages/lpsolve-.5.0.15/
LpSolve_mac/mac/
It sounds complicated, but it is simpler than always looking for a Windows machine to discover your Petri Nets!
Recent Comments