Svalorzen / AI-Toolbox

A C++ framework for MDPs and POMDPs with Python bindings
GNU General Public License v3.0
647 stars 98 forks source link

about LP_Solve #61

Closed StHamish closed 2 years ago

StHamish commented 2 years ago

Hi , I am using VSCode in windows , after cmake configure, it shows :

[main] Configuring folder: AITools-RL [proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\msys64\mingw64\bin\gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\msys64\mingw64\bin\g++.exe -Sc:/cppVSCode/AITools-RL -Bc:/cppVSCode/AITools-RL/build -G Ninja [cmake] Not searching for unused variables given on the command line. [cmake] -- The CXX compiler identification is GNU 12.1.0 [cmake] -- Detecting CXX compiler ABI info [cmake] -- Detecting CXX compiler ABI info - done [cmake] -- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe - skipped [cmake] -- Detecting CXX compile features [cmake] -- Detecting CXX compile features - done [cmake] -- Found Boost: C:/msys64/mingw64/include (found suitable version "1.79.0", minimum required is "1.67") [cmake] -- Found Eigen3: C:/msys64/mingw64/include/eigen3 (Required is at least version "3.2.92") [cmake] CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message): [cmake] Could NOT find LpSolve (missing: LPSOLVE_INCLUDE_PATH LPSOLVE_LINKS) [cmake] Call Stack (most recent call first): [cmake] C:/Program Files/CMake/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) [cmake] cmake/Modules/FindLpSolve.cmake:91 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) [cmake] CMakeLists.txt:139 (find_package) [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred! [cmake] See also "C:/cppVSCode/AITools-RL/build/CMakeFiles/CMakeOutput.log".

Can you help me with that ? Thanks

Svalorzen commented 2 years ago

Does issue #32 help?

StHamish commented 2 years ago

Thanks for your reply. I have tried other complier, like x64 one instead of gcc. It still shows same error :

[cmake] -- Detecting CXX compiler ABI info [cmake] -- Detecting CXX compiler ABI info - done [cmake] -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe - skipped [cmake] -- Detecting CXX compile features [cmake] -- Detecting CXX compile features - done [cmake] -- Found Boost: C:/msys64/mingw64/include (found suitable version "1.79.0", minimum required is "1.67")
[cmake] -- Found Eigen3: C:/msys64/mingw64/include/eigen3 (Required is at least version "3.2.92") [cmake] CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message): [cmake] Could NOT find LpSolve (missing: LPSOLVE_LIBRARIES LPSOLVE_INCLUDE_PATH [cmake] LPSOLVE_LINKS) [cmake] Call Stack (most recent call first): [cmake] C:/Program Files/CMake/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) [cmake] cmake/Modules/FindLpSolve.cmake:91 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) [cmake] CMakeLists.txt:139 (find_package) [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred! [cmake] See also "C:/cppVSCode/AITools-RL/build/CMakeFiles/CMakeOutput.log". [visual-studio] Patch Windows SDK bin path from C:\Program Files (x86)\Windows Kits\10\bin\x64 to C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64 for C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat

I have also put lp_solve in the cmake under program files. Should I make some change to the [FindLpSolve.cmake] ?

Svalorzen commented 2 years ago

What do you mean "in the cmake"? Issue #32 mentions it's supposed to be in C:\Program Files\lpsolve.

StHamish commented 2 years ago

OK , thanks ! I put it in the program file in C. I think there is some improvement. It shows:

[proc] Executing command: C:\msys64\mingw64\bin\gcc.exe -v [main] Configuring folder: AITools-RL [proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\msys64\mingw64\bin\gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\msys64\mingw64\bin\g++.exe -Sc:/cppVSCode/AITools-RL -Bc:/cppVSCode/AITools-RL/build -G Ninja [cmake] Not searching for unused variables given on the command line. [cmake] -- The CXX compiler identification is GNU 12.1.0 [cmake] -- Detecting CXX compiler ABI info [cmake] -- Detecting CXX compiler ABI info - done [cmake] -- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe - skipped [cmake] -- Detecting CXX compile features [cmake] -- Detecting CXX compile features - done [cmake] -- Found Boost: C:/msys64/mingw64/include (found suitable version "1.79.0", minimum required is "1.67")
[cmake] -- Found Eigen3: C:/msys64/mingw64/include/eigen3 (Required is at least version "3.2.92") [cmake] -- Performing Test LPSOLVE_LINKS_ALONE [cmake] -- Performing Test LPSOLVE_LINKS_ALONE - Failed [cmake] -- Performing Test LPSOLVE_LINKS_WITH_EXTRA_LIBS [cmake] -- Performing Test LPSOLVE_LINKS_WITH_EXTRA_LIBS - Failed [cmake] -- Could not link against lpsolve55! [cmake] CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message): [cmake] Could NOT find LpSolve (missing: LPSOLVE_LIBRARIES LPSOLVE_LINKS) [cmake] Call Stack (most recent call first): [cmake] C:/Program Files/CMake/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) [cmake] cmake/Modules/FindLpSolve.cmake:91 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) [cmake] CMakeLists.txt:139 (find_package) [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred! [cmake] See also "C:/cppVSCode/AITools-RL/build/CMakeFiles/CMakeOutput.log". [cmake] See also "C:/cppVSCode/AITools-RL/build/CMakeFiles/CMakeError.log".

Why it shows : Performing Test LPSOLVE_LINKS_ALONE failed and Could not link against lpsolve55! ?

Svalorzen commented 2 years ago

I think it means that it found the header files, but that the libraries were not correct. What do you have exactly in the lpsolve folder?

StHamish commented 2 years ago

image

This is what I got

Svalorzen commented 2 years ago

These look correct. Are they the 32 bit or 64 bit libraries? If you don't know, what is the name of the zip file you downloaded them in?

StHamish commented 2 years ago

lp_solve_5.5.2.5_dev_win64

I think it is 64

StHamish commented 2 years ago

should I download the 32 ?

Svalorzen commented 2 years ago

I don't think so, it looks like you are using a 64 bit compiler. There is one thing though, I see you are using mingw. There is a chance that the libraries you downloaded are only compatible with visual studio. If that is the case you won't be able to use them using gcc. In that case you can probably try to compile the project with visual studio directly.

StHamish commented 2 years ago

Thanks! You are right. I think that is problem of mingw in VScode , which is not compatible with the lpsolve lib. May I ask if there is any lpsolve lib that can be compatible with mingw in VScode?

Svalorzen commented 2 years ago

You'd probably have to compile lpsolve yourself from source (which shouldn't probably be too difficult). VSCode though is a shorthand for "Visual Studio Code", and it is just an editor made by Microsoft. I find it hard to believe that it would not be compatible with the Visual Studio compiler suite.

Ultimately though this problem is not really dependent on this library, but on your development environment. I'd love to help you more but it's been many years since I developed on Windows, so I'm not really familiar with it anymore. Maybe you could try StackOverflow, they are much more likely to have good answers to your questions.

StHamish commented 2 years ago

Thanks for the advice !