Skip to content
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

Problem building Lpsolve #32

Closed
hifzajaved opened this issue Nov 15, 2018 · 32 comments
Closed

Problem building Lpsolve #32

hifzajaved opened this issue Nov 15, 2018 · 32 comments

Comments

@hifzajaved
Copy link

Hello,
I recently downloaded this library to use on Windows 10. I have run into trouble building the library though. Firstly, the lpsolve link takes to you to the main website, but doesn't clarify which version of lpsolve to download (https://sourceforge.net/projects/lpsolve/files/lpsolve/5.5.2.5/). I also think this instruction could be made clearer:

(a shared library must be available to compile the Python wrapper)."

Which shared library must I download for this? Are there additional instructions to execute this step?

I am currently getting this error when attempting to build the toolbox:
-- Could not link against lpsolve55!
CMake Error at C:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find LpSolve (missing: LPSOLVE_LIBRARIES LPSOLVE_LINKS)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindLpSolve.cmake:88 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:149 (find_package)

Can you tell me which directories LPSOLVE_LIBRARIES and LPSOLVE_LINKS should be pointing to?

Thank you.

@Svalorzen
Copy link
Owner

Svalorzen commented Nov 15, 2018

Those errors happen because the CMake script in the library is not smart enough to find the folder where you installed lpsolve. Unfortunately, this is a somewhat hard thing to fix, as there's no official script, and in theory you could install the library wherever you like. The current script works decently on Linux, but unfortunately I wouldn't know what to change to make it work seamlessly on Windows.

On my Windows test system, I have put the lpsolve files (headers and libs) in the C:\Program Files\lpsolve folder, and this seems to be enough to enable the script to find them directly without the need to manually specify the directory.

If that does not work or you want to keep lpsolve somewhere else, you'll need to manually set those variables. Ideally, if everything you need is in the same folder, both variables should point to that folder. On Windows, you should have the lpsolve headers and the .dll/.lib libraries in that folder.

Let me know if this helps.

@hifzajaved
Copy link
Author

hifzajaved commented Nov 15, 2018

Thank you for you response. My lpsolve folder is actually placed in the same location. I feel maybe the error

-- Could not link against lpsolve55!

has something to do with the shared library that is needed for successful compilation. Can you provide some detail on which library this is and how to use it?
Thanks again.

@Svalorzen
Copy link
Owner

Ah, it seems you are right. The message

Could NOT find LpSolve (missing: LPSOLVE_LIBRARIES LPSOLVE_LINKS)

Means that CMake can't find the libraries, and thus can't link lpsolve. The libraries are simply the Windows static/dynamic libraries that you download from the link you provided.

Please check that you have liblpsolve55.lib, liblpsolve55d.lib, lpsolve55.lib and lpsolve55.dll. If the libraries end with .a or .so it means you may have downloaded the linux versions. You get them from the lp_solve_5.5.2.5_dev_win64.zip file from Sourceforge, which is the Windows one.

@hifzajaved
Copy link
Author

Yes, I do have the correct files for Windows.
Does that mean that you only had to unzip and place the lp_solve_5.5.2.5_dev_win64.zip folder inside the C:\Program Files directory for it to work? Is there no need to separately install the lpsolve library as instructed here along with the driver?
Could the error I'm getting have anything to do with the Python version I have installed?

@Svalorzen
Copy link
Owner

Yes, unzipping should work. Make sure that the folder is named C:\Program Files\lpsolve exactly. There's no real need to install anything else. Python also does not directly interact with lpsolve in this library so it really should not matter.

Another thing you could try to do is to manually edit the FindLPSolve.cmake file yourself, and put some message() statements around to see where CMake is looking and at which step the script fails.

@hifzajaved
Copy link
Author

Thank you. I'll try out your suggestion now.

@Svalorzen
Copy link
Owner

Please let me know if you manage to solve this (or if you need more help), and what steps you took. Unfortunately CMake on Windows can be quite fiddly at times, and there's not so much I can do about it...

@hifzajaved
Copy link
Author

Inside the FindLpSolve.cmake file within the AI-Toolbox, I see that the paths are set for a Linux system:

SET(LPSOLVE_LIB_TRIALPATH
${LPSOLVE_INCLUDE_DIR}
${LPSOLVE_INSTALL_BASE_PATH}/lib
/usr/lib/
/usr/local/lib
/opt/lib
)

Is there any chance you could share your cmake file for the Windows test system?

@Svalorzen
Copy link
Owner

It's the same as what I have. Try to maybe add to the CMake call -DLPSOLVE_INCLUDE_PATH="C:\Program Files\lpsolve"

@Svalorzen
Copy link
Owner

Svalorzen commented Nov 17, 2018

So I've been checking a bit, and there might be multiple problems. I've pushed a new commit, please try again with it.

If it still does not work, you may need to look at the CMakeFiles\CMakeError.log file. It should report why CMake is failing to check for lpsolve.

An issue I just noticed is that by default Visual Studio selects the 32 bit compiler. You may notice this since at the beginning of the CMake output you'd get something like

-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x86/cl.exe

Note the x86/cl.exe at the end of the line. This means that the selected compiler is for 32 bits, and the lpsolve libs you have downloaded may be for 64 bits. You can either download the 32 bit libraries, or you can select the 64 bit version of the compiler by passing -G "Visual Studio 15 2017 Win64" (or your equivalent Visual Studio version, a list is here).

@hifzajaved
Copy link
Author

I looked into this some more and found out that the lpsolve library is in face being located correctly. However, inside the FindLpSolve.cmake file, the code looks for additional libraries:

FIND_LIBRARY(LPSOLVE_LIB_DL "dl")
FIND_LIBRARY(LPSOLVE_LIB_COLAMD "colamd")

and this is where it fails to link against lpsolve55.
The same error occurs when I try to follow the installation instructions on MacOS.
Any suggestions?

@Svalorzen
Copy link
Owner

Ah, that part I copied from where I originally got the script. The code only goes there if it couldn't link lpsolve alone though, and that should simply just work.

Would you mind posting the complete CMake output you get?

@Svalorzen
Copy link
Owner

(and possibly the exact command you are calling it with)

@hifzajaved
Copy link
Author

I used the command cmake ..
I added a bunch of Message statements to the code for debugging purposes which you will see here. On windows, this is my CMake output:

Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299.
-- IPO / LTO not supported: <CMake doesn't support IPO for current CXX compiler>
Build type: Debug
Logging is DISABLED
#Building MDP
#Building Python bindings
--Boost version: 1.68.0
-- LPSOLVE_INCLUDE_TRIAL_PATH C:/Program Files
-- LPSOLVE_INCLUDE_PATH C:/Program Files/lpsolve
-- LPSOLVE_INCLUDE_DIR C:/Program Files/lpsolve
-- LPSOLVE_INSTALL_BASE_PATH C:/Program Files
-- LPSOLVE_LIBRARIES C:/Program Files/lpsolve/lpsolve55.lib
-- LPSOLVE_LINKS_ALONE
-- CHECK IF INSIDE IF STATEMENT
-- LPSOLVE_LIB_DLLPSOLVE_LIB_DL-NOTFOUND
-- LPSOLVE_LIB_COLAMDLPSOLVE_LIB_COLAMD-NOTFOUND
-- Could not link against lpsolve55!
CMake Error at C:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find LpSolve (missing: LPSOLVE_LIBRARIES LPSOLVE_LINKS)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindLpSolve.cmake:106 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:149 (find_package)
-- Configuring incomplete, errors occurred!--

And on MacOS:

-- IPO / LTO enabled
Build type: Release
Logging is DISABLED
#Building MDP
#Building Factored MDP
#Building POMDP
#Building Python bindings
#Building Tests
#Building Examples
--Boost version: 1.68.0
-- LPSOLVE_INCLUDE_TRIAL_PATH /usr/local/Cellar/lp_solve/5.5.2.0/include
-- LPSOLVE_INCLUDE_PATH /usr/local/Cellar/lp_solve/5.5.2.0/include
-- LPSOLVE_INCLUDE_PATH /usr/local/Cellar/lp_solve/5.5.2.0/include
-- LPSOLVE_INCLUDE_DIR /usr/local/Cellar/lp_solve/5.5.2.0/include
-- LPSOLVE_INSTALL_BASE_PATH /usr/local/Cellar/lp_solve/5.5.2.0
-- TMP_LPSOLVE_LIBRARIES /usr/local/lib/liblpsolve55.dylib
-- LPSOLVE_LIBRARIES /usr/local/lib/liblpsolve55.dylib
-- LPSOLVE_LINKS_ALONE
-- CHECK IF INSIDE IF STATEMENT
-- LPSOLVE_LIB_DL /usr/lib/libdl.dylib
-- LPSOLVE_LIB_COLAMD LPSOLVE_LIB_COLAMD-NOTFOUND
-- Could not link against lpsolve55!
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find LpSolve (missing: LPSOLVE_LIBRARIES LPSOLVE_LINKS)
Call Stack (most recent call first):
/Applications/CMake.app/Contents/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindLpSolve.cmake:119 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:181 (find_package)
-- Configuring incomplete, errors occurred!

@Svalorzen
Copy link
Owner

It looks like something is missing.. at the beginning there should be some lines about detecting the CXX compilers. Are you sure they are not there?

@hifzajaved
Copy link
Author

Yes, pretty sure. That's the exact generated output.

@Svalorzen
Copy link
Owner

What compiler/toolset are you trying to use in Windows? For example, this is my output in Windows 7 using Visual Studio 2017:

$ cmake .. -DPYTHON_VERSION=3 -DBOOST_LIBRARYDIR=C:/local/boost_1_68_0/lib64-msvc-14.1 -A x64
-- Building for: Visual Studio 15 2017
-- Selecting Windows SDK version 10.0.16299.0 to target Windows 6.1.7601.
-- The CXX compiler identification is MSVC 19.15.26726.0
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- IPO / LTO enabled

Build type: Release
Logging is DISABLED
# Building MDP
# Building Factored MDP
# Building POMDP
# Building Python bindings
# Building Tests
# Building Examples

-- Boost version: 1.68.0
-- Found Eigen3: C:/Program Files/eigen (Required is at least version "3.2.92")
-- Performing Test LPSOLVE_LINKS_ALONE
-- Performing Test LPSOLVE_LINKS_ALONE - Success
-- Found LpSolve: C:/Program Files/lpsolve/lpsolve55.lib
-- Could NOT find PythonInterp: Found unsuitable version "2.7.15", but required is at least "3" (found C:/Python27/python.exe)
-- Found PythonLibs: C:/Python27/libs/python27.lib (found suitable exact version "2.7.15")
-- Boost version: 1.68.0
-- Found the following Boost libraries:
--   python27
-- Boost version: 1.68.0
-- Found the following Boost libraries:
--   unit_test_framework
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/svalorzen/Documents/AI-Toolbox/tmpzz

Try to use the -A x64 flag when calling CMake as well maybe.

@hifzajaved
Copy link
Author

I'm not sure how to check which compiler is being used. When I run cmake .. x64 (not sure if this is the correct usage), I get this:

CMake Error: Error: generator platform: x64
Does not match the platform used previously:
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

@Svalorzen
Copy link
Owner

You need to call it like this: cmake .. -A x64

Do you have Visual Studio 2017 installed? If not, please download the community edition from here: https://visualstudio.microsoft.com/downloads/

@hifzajaved
Copy link
Author

hifzajaved commented Dec 3, 2018

Sorry, yes I used cmake .. -A x64
And I do have visual studio 2017 already. What I get is the output in my previous comment.

@Svalorzen
Copy link
Owner

Svalorzen commented Dec 3, 2018

Please delete the whole build folder, re-create it and call CMake again. In general when playing with CMake settings it's always better to start from a clean slate every time.

The error there it's basically CMake complaining that your new settings conflict with the old ones.

@hifzajaved
Copy link
Author

Thanks for explaining. This is my output now:

-- Building for: Visual Studio 15 2017
-- The CXX compiler identification is MSVC 19.15.26732.1
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- IPO / LTO not supported: <CMake doesn't support IPO for current CXX compiler>
Build type: Release
Logging is DISABLED
#Building MDP
#Building Factored MDP
#Building POMDP
#Building Python bindings
#Building Tests
#Building Examples
-- Boost version: 1.68.0
-- Found Eigen3: C:/Program Files/eigen3 (Required is at least version "3.2.92")
-- Performing Test LPSOLVE_LINKS_ALONE
-- Performing Test LPSOLVE_LINKS_ALONE - Failed
-- Performing Test LPSOLVE_LINKS_WITH_EXTRA_LIBS
-- Performing Test LPSOLVE_LINKS_WITH_EXTRA_LIBS - Failed
-- Could not link against lpsolve55!
CMake Error at C:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find LpSolve (missing: LPSOLVE_LIBRARIES LPSOLVE_LINKS)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindLpSolve.cmake:89 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:149 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/Users/artmed/Documents/AI-Toolbox-master/AI-Toolbox-master/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/artmed/Documents/AI-Toolbox-master/AI-Toolbox-master/build/CMakeFiles/CMakeError.log".

@Svalorzen
Copy link
Owner

-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe

This line you have tells me that you are trying to compile for 32 bits. I'm not sure whether you passed the -A x64 flag again. If so, for some reason it is getting ignored. If not, please restart and pass this option.

If you can't manage to select the 64 bit compiler, another thing you can try to do then would be to download the 32 bit version of the lpsolve libraries, replace the 64 bit version you have now, and try again with those.

@hifzajaved
Copy link
Author

I attempted again with cmake .. -A x64 and I get this output now. Lpsolve seems to link correctly now but there's a problem with boost:

-- Building for: Visual Studio 15 2017
-- The CXX compiler identification is MSVC 19.15.26732.1
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- IPO / LTO not supported: <CMake doesn't support IPO for current CXX compiler>
Build type: Release
Logging is DISABLED
#Building MDP
#Building Factored MDP
#Building POMDP
#Building Python bindings
#Building Tests
#Building Examples
-- Boost version: 1.68.0
-- Found Eigen3: C:/Program Files/eigen3 (Required is at least version "3.2.92")
-- LPSOLVE_INCLUDE_TRIAL_PATH C:/Program Files
-- LPSOLVE_LIB_TRIALPATH C:/Program Files/lib
-- Performing Test LPSOLVE_LINKS_ALONE
-- Performing Test LPSOLVE_LINKS_ALONE - Success
-- Found LpSolve: C:/Program Files/lpsolve/lpsolve55.lib
-- Found PythonInterp: C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/python.exe (found version "3.6.6")
-- Found PythonLibs: C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/libs/python36.lib (found suitable version "3.6.6", minimum required is "3")
CMake Warning at C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:839 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:165 (find_package)
CMake Error at C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:2044 (message):
Unable to find the requested Boost libraries.
Boost version: 1.68.0
Boost include path: C:/Program Files/boost
Could not find the following Boost libraries:
boost_python3
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
CMakeLists.txt:165 (find_package)
CMake Warning at C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:839 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:177 (find_package)
CMake Error at C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:2044 (message):
Unable to find the requested Boost libraries.
Boost version: 1.68.0
Boost include path: C:/Program Files/boost
Could not find the following Boost libraries:
boost_unit_test_framework
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
CMakeLists.txt:177 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/Users/artmed/Documents/AI-Toolbox-master/AI-Toolbox-master/build/CMakeFiles/CMakeOutput.log".

@Svalorzen
Copy link
Owner

Svalorzen commented Dec 3, 2018

Use -DBOOST_ROOT=/the/folder/where/you/installed/boost, and, if needed add also -DBOOST_LIBRARYDIR=/the/folder/that/contains/boost/libraries/for/your/selected/compiler.

I installed Boost in C:\local\boost_1_68_0 (so that would be BOOST_ROOT) and with that CMake seems to find it correctly without needing to specify it explicitly. If you installed it somewhere else you have to pass the directory where you put it.

On my machine I do have to set -DBOOST_LIBRARYDIR=C:/local/boost_1_68_0/lib64-msvc-14.1 to give you an example of what this variable could look like.

@hifzajaved
Copy link
Author

Everything seems to work ok now other than the boost_python3 library. I don't see why it cannot be located. I installed boost again and placed it in the C:/local/boost_1_68_0 directory and set DBOOST_ROOT and DBOOST_LIBRARYDIR as well.

$cmake .. -DBOOST_ROOT=C:/local/boost_1_68_0 -DBOOST_LIBRARYDIR=C:/local/boost_1_68_0/lib64-msvc-14.1 -A x64
-- Building for: Visual Studio 15 2017
-- The CXX compiler identification is MSVC 19.15.26732.1
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- IPO / LTO not supported: <CMake doesn't support IPO for current CXX compiler>
Build type: Release
Logging is DISABLED
#Building MDP
#Building Factored MDP
#Building POMDP
#Building Python bindings
#Building Tests
#Building Examples
-- Boost version: 1.68.0
-- Found Eigen3: C:/Program Files/eigen3 (Required is at least version "3.2.92")
-- LPSOLVE_INCLUDE_TRIAL_PATH C:/Program Files
-- LPSOLVE_LIB_TRIALPATH C:/Program Files/lib
-- Performing Test LPSOLVE_LINKS_ALONE
-- Performing Test LPSOLVE_LINKS_ALONE - Success
-- Found LpSolve: C:/Program Files/lpsolve/lpsolve55.lib
-- Found PythonInterp: C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/python.exe (found version "3.6.6")
-- Found PythonLibs: C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/libs/python36.lib (found suitable version "3.6.6", minimum required is "3")
CMake Warning at C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:839 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:165 (find_package)
CMake Error at C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:2044 (message):
Unable to find the requested Boost libraries.
Boost version: 1.68.0
Boost include path: C:/local/boost_1_68_0
Could not find the following Boost libraries:
boost_python3
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
CMakeLists.txt:165 (find_package)
CMake Warning at C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:839 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:177 (find_package)
-- Boost version: 1.68.0
-- Found the following Boost libraries:
-- unit_test_framework
-- Configuring incomplete, errors occurred!
See also "C:/Users/artmed/Documents/AI-Toolbox-master/AI-Toolbox-master/build/CMakeFiles/CMakeOutput.log".

@Svalorzen
Copy link
Owner

Svalorzen commented Dec 3, 2018

Alright, here you might have to edit the main CMakeLists.txt by hand.

On this line is the line where I load the Boost Python library. It seems that on Windows the behavior of the CMake script is slightly different.

If you read the warning just above the line, it explains that you might have to rename the python3 there with python3X, where X is the sub-version of Python that your boost supports (in my case is python37). You can find this number out by just looking that the Boost library folder, and looking at the name of the libboost-python file, and just copy the numbers there into the CMakeLists.txt.

Unfortunately, if I just modified the file in the repo, it would break Linux. I could make separate paths for separate platforms, but unfortunately I haven't been able to find out whether this would still work in all cases, so I haven't fixed this yet.

@hifzajaved
Copy link
Author

Voila! That seemed to do the trick. I can finally get started with creating my model now. Thanks a lot for your help!

@Svalorzen
Copy link
Owner

No problem! I'll close this issue then :)

@ga72kud
Copy link

ga72kud commented Dec 2, 2021

I use Ubuntu and have a similar problem with the LPSOLVE

CMake Error at /opt/cmake-3.22.0-linux-x86_64/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find LpSolve (missing: LPSOLVE_LIBRARIES LPSOLVE_INCLUDE_PATH
LPSOLVE_LINKS)
Call Stack (most recent call first):
/opt/cmake-3.22.0-linux-x86_64/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindLpSolve.cmake:91 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:134 (find_package)

@Svalorzen
Copy link
Owner

How did you install lpsolve?

@StHamish
Copy link

StHamish commented Jul 4, 2022

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 Svalorzen mentioned this issue Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants