-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lpsolve build issues. #70
Comments
If you create a separate C++ project, can you manage to compile the following?
If you can't, there might be an incompatibility between the compiler you are using and the one used to create the library that brew is installing. If you can, then we can try to figure out which flags to pass to CMake (since the test it performs in order to verify that lpsolve exists is exactly this one). |
Hi, thanks for the quick response! I also added one line of code to output the version info, just to check that it actually works, which it does. |
I think that might be the culprit. Both my script and my code assume that the headers are reachable with You can alternatively (I think) modify the CMake script tasked to find lpsolve (this one), as well as change in the actual library all |
Sorry, I kind of missed the obvious point of my own last answer! I actually fixed the problem, which was precisely the different structure of my "include" folder in homebrew's installation. Since, as you said, the code above is exactly the test which that cmake script uses, I now moved all my header files into a folder called "lpsolve", just to try if it works - and voila - the script builds perfectly. I am not sure, however, what to make of this. This trick of manually adapting the structure of my installation directory is not a permanent fix, since whenever homebrew updates the installation of lpsolve, I suppose that my changes will be overwritten again. Do you have a proposal how I could elegantly fix this once and for all? |
As I said, if you create a symbolic link that points to the header folder and pass the directory that link resides in as the lp_solve directory, it should work just as well. To clarify:
And then pass |
Nice idea with the symbolic link, i'll definitely do that! |
Hello Svalorzen!
I have a similar issue to #68.
I installed lpsolve on Mac (Sonoma 14.4.1) using homebrew: brew install lp_solve. This worked out fine, but while building using the cmake script I get the following error:
CMake Error at /usr/local/Cellar/cmake/3.30.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find LpSolve (missing: LPSOLVE_LIBRARIES LPSOLVE_INCLUDE_PATH
LPSOLVE_LINKS)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.30.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindLpSolve.cmake:91 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:143 (find_package)
I tried to solve the issue by specifying the variables as options to cmake immediately, after checking my installation of lpsolve using brew info lp_solve:
cmake -DLPSOLVE_INCLUDE_PATH=/usr/local/Cellar/lp_solve/5.5.2.11/include -DLPSOLVE_LIBRARIES=/usr/local/Cellar/lp_solve/5.5.2.11/lib/liblpsolve55.a ..
However, this still yielded a similar problem:
CMake Error at /usr/local/Cellar/cmake/3.30.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find LpSolve (missing: LPSOLVE_LIBRARIES LPSOLVE_LINKS)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.30.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindLpSolve.cmake:91 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:143 (find_package)
I thought that using homebrew to install lpsolve would be the most reasonable approach, but is there maybe some specific problem with this way of installing?
I would be really thankful for some help, as this problem seems quite hard to figure out on my own now, and apparently some people have had similar issues with the lpsolve dependency before me.
Have a nice day! Cheers, Benjamin
The text was updated successfully, but these errors were encountered: