Commit 977db529 authored by Davis King's avatar Davis King

Improved error messages for people who have incorrectly installed boost in windows.

parent d5097f72
...@@ -100,33 +100,44 @@ endif() ...@@ -100,33 +100,44 @@ endif()
if (NOT Boost_FOUND) if (NOT Boost_FOUND)
message(STATUS " *****************************************************************************************************") message(STATUS " *****************************************************************************************************")
if (WIN32) if (WIN32)
message(STATUS "We couldn't find the right version of boost python. If you installed boost and you are still " if (NOT DEFINED ENV{BOOST_ROOT} OR NOT DEFINED ENV{BOOST_LIBRARYDIR})
"getting this error then you might have installed a version of boost that was compiled with a different " message(STATUS "The BOOST_ROOT and/or BOOST_LIBRARYDIR environment variables are not set. You need to set these ")
"version of visual studio than the one you are using. So you have to make sure that the version of " message(STATUS "variables so we know where boost is installed. So set these variables to something like this:")
"visual studio is the same version that was used to compile the copy of boost you are using.") message(STATUS " BOOST_ROOT=C:\\local\\boost_1_57_0 " )
message(STATUS " Set the BOOST_ROOT and BOOST_LIBRARYDIR environment variables before running cmake. ") message(STATUS " BOOST_LIBRARYDIR=C:\\local\\boost_1_57_0\\stage\\lib")
message(STATUS " E.g. Something like this: ") message(STATUS "The best way to set enviornment variables in Windows is to go to the start menu's search box,")
message(STATUS " set BOOST_ROOT=C:\\local\\boost_1_57_0 " ) message(STATUS "type environment, and open the Environment Variables dialog. That lets you add more variables.")
message(STATUS " set BOOST_LIBRARYDIR=C:\\local\\boost_1_57_0\\stage\\lib") message(STATUS "Add these variables to either user or system variables, it doesn't matter.")
message(STATUS "") message(STATUS "You might have to log out and log back in before the environment changes take effect.")
message(STATUS " You will also likely need to compile boost yourself rather than using one of the precompiled ") else()
message(STATUS " windows binaries. Do this by going to the folder tools\\build\\ within boost and running ") message(STATUS "We couldn't find the right version of boost python. If you installed boost and you are still "
message(STATUS " bootstrap.bat. Then run the command: ") "getting this error then you might have installed a version of boost that was compiled with a different "
message(STATUS " b2 install") "version of visual studio than the one you are using. So you have to make sure that the version of "
message(STATUS " And then add the output bin folder to your PATH. Usually this is the C:\\boost-build-engine\\bin") "visual studio is the same version that was used to compile the copy of boost you are using.")
message(STATUS " folder. Finally, go to the boost root and run a command like this:") message(STATUS "")
message(STATUS " b2 -a --with-python address-model=64 toolset=msvc runtime-link=static") message(STATUS " You will likely need to compile boost yourself rather than using one of the precompiled ")
message(STATUS " When it completes, set BOOST_LIBRARYDIR equal to wherever b2 put the compiled libraries.") message(STATUS " windows binaries. Do this by going to the folder tools\\build\\ within boost and running ")
message(STATUS " Note that you will need to set the address-model based on if you want a 32 or 64bit python library.") message(STATUS " bootstrap.bat. Then run the command: ")
message(STATUS "") message(STATUS " b2 install")
message(STATUS " Next, if you aren't using python setup.py then you will be invoking cmake to compile dlib. ") message(STATUS " And then add the output bin folder to your PATH. Usually this is the C:\\boost-build-engine\\bin")
message(STATUS " In this case you may have to use cmake's -G option to set the 64 vs. 32bit mode of visual studio. ") message(STATUS " folder. Finally, go to the boost root and run a command like this:")
message(STATUS " Also, if you want a Python3 library you will need to add -DPYTHON3=1. You do this with a statement like: ") message(STATUS " b2 -a --with-python address-model=64 toolset=msvc runtime-link=static")
message(STATUS " cmake -G \"Visual Studio 14 2015 Win64\" -DPYTHON3=1 ..\\..\\tools\\python") message(STATUS " Note that you will need to set the address-model based on if you want a 32 or 64bit python library.")
message(STATUS " Rather than:") message(STATUS " When it completes, set the BOOST_LIBRARYDIR environment variable equal to wherever b2 put the ")
message(STATUS " cmake ..\\..\\tools\\python") message(STATUS " compiled libraries. You will also need to set BOOST_ROOT to the root folder of the boost install.")
message(STATUS " Which will build a 32bit Python2 module by default on most systems.") message(STATUS " E.g. Something like this: ")
message(STATUS "") message(STATUS " set BOOST_ROOT=C:\\local\\boost_1_57_0 " )
message(STATUS " set BOOST_LIBRARYDIR=C:\\local\\boost_1_57_0\\stage\\lib")
message(STATUS "")
message(STATUS " Next, if you aren't using python setup.py then you will be invoking cmake to compile dlib. ")
message(STATUS " In this case you may have to use cmake's -G option to set the 64 vs. 32bit mode of visual studio. ")
message(STATUS " Also, if you want a Python3 library you will need to add -DPYTHON3=1. You do this with a statement like: ")
message(STATUS " cmake -G \"Visual Studio 14 2015 Win64\" -DPYTHON3=1 ..\\..\\tools\\python")
message(STATUS " Rather than:")
message(STATUS " cmake ..\\..\\tools\\python")
message(STATUS " Which will build a 32bit Python2 module by default on most systems.")
message(STATUS "")
endif()
else() else()
message(STATUS " To compile Boost.Python yourself download boost from boost.org and then go into the boost root folder") message(STATUS " To compile Boost.Python yourself download boost from boost.org and then go into the boost root folder")
message(STATUS " and run these commands: ") message(STATUS " and run these commands: ")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment