Open LudoInSpace opened 1 year ago
Sorry for the late reply.
Since the dependency is not only OS-dependent but machine-dependent, and I don't think the program should automatically download an external program either. A fix I would propose is a quick checker on the availability of lp_solve
and show a warning suggesting people to download lp_solve
for their system if they want to use panco
.
Feel free to propose another solution, otherwise, I will remove the existing lp_solve
executable and let the user put in their executable path instead. Then implement a small test to show a warning if the program cannot find any solver. Scheduled to be done in the following days.
I believe this is the way to go.
Is it possible to check if "lp_solve" is already recognized as a command on the computer, and if so, then overwrite saihu/panco/lpSolvePath.p
's LPSOLVEPATH
to equal the result of which lp_solve
? That would be great.
The lp_solve
path is hard-coded into the code base, right?
We use macOS 14, on some systems the bundled lp_solve
works, on some it doesn't (after telling the system to trust and execute this binary). Thus, we'd also appreciate using the a system-wide or the user's already installed binary.
Thank you all for pointing out the issue and I apologize for delaying this issue for quite a long time. PR #7 should solve the issue based on my proposal above.
I removed the built-in executable to get rid of any confusion. The program now tries to resolve the path of lp_solve
in the following manner.
saihu/resources/lpsolve
which lp_solve
and which lpsolve
, and apply the result if any of them succeed../lp_solve
When none of the above steps finds a valid lp_solve
executable, it shows a warning, and a suggestion of how to install lp_solve
is printed at the end of the warning according to the user's OS.
I will still keep this issue open for a while in case there's still a problem with some people's machines because I don't have machines of all platforms to test. If everyone is OK with the current solution, I may close this issue afterwards.
Tested a fresh clone, seems to work on debian on my side. Thanks a lot!
I still have problems with lp_solve. I tried the updated version and to set path.json directly to the binary. I also tried it with the lp_solve from source forge. Saihu only generates the error message that lpsolve or panco may not be properly installed.
Which OS are you on ?
macOS Sonoma 14.2.1
Some quick test you may try:
lp_solve
. That means probably the path you write in paths.json
is incorrect or lp_solve
is not executable.lp_solve
binary. You can use the test.lp
in the panco
folder to see if your machine can execute lp_solve correctly.lpSolvePath.py
does not generate any warning. We will try to debug the exact cause.Sorry for not answering sooner. I have tried both: executing lpSolvePath and testing lp_solve with test.lp. They work both and do not generate any errors.
@kuetebbg In this case, it probably is not the problem directly from lp_solve. If it's ok for you, please provide the network file you tested and briefly state what happened on your machine so I can reproduce the issue.
I use the demo file under src/exampe/demo.json. When I try to run 'python main.py example/demo.json -t panco' I get the error: Analyzing "demo.json" using Panco-TFA,SFA,PLP,ELP...Cannot execute Panco analysis. Could be the problem with lpsolve or panco itself not installed properly Skip. No analysis tool/method is specified This also happens when I try to run python 'main.py example/demo.json -a '. All tools except Panco execute successfully.
Hey, an issue we discussed with Stéphan a while ago:
The repo provides a copy of the lp_solve executable. But when trying to launch on Linux for the first time I had the following error:
Digging a bit (printing the exception that you catch), I see:
And indeed executables don't have the same format depending on OS. On linux/debian, lp_solve is provided by lp-solve apt package, so
sudo apt install lp-solve
Then
which lp_solve
returns on my machine/usr/bin/lp_solve
. So I replaced thesaihu/panco/lpSolvePath.py
file by commenting-out everything and writingLPSOLVEPATH = ["/usr/bin/lp_solve"]
.But of course it's a debian-specific solution. Maybe you can edit panco's file and your installation procedure to solve the installation issue on Linux/Debian while maintaining compatibility with other OSs ?
Ludovic