Not able to find boost with cmake

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Not able to find boost with cmake

钟元鑫
I'm trying to build PCL which has boost as dependency. However, when I download boost and build it, cmake cannot find it through any way.

I tried two version of boost, one is pre-build boost which was built by other person online and version is 1.61, another is one I downloaded whose version is 1.64. File structures of the two versions are the same:
[XXX]/include/boost-1_64/boost is the include dir and [XXX]/lib is the bin dir

I try to specify the Boost_INCLUDE_DIR to [XXX]/include/boost-1_64/boost, the messages in output window is attached (I turned Boost_DEBUG on).

I'm on Window 10 and VS2017

Thanks,
Jacob Zhong

------------------
顺颂时祺

钟元鑫  Yuanxin Zhong
清华大学汽车工程系  Dept. of Automotive Engineering, Tsinghua Univ.
Ad:Haidian District, Beijing, P.R.China    100084
Tel:+86 17888833119
E-mail:cmpute[hidden email] / zhongyx[hidden email]
 

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Not able to find boost with cmake

Bo Zhou
It's better not to use downloaded pre-built libraries, always build by yourself locally.

Before using Boost with CMake, please check https://cmake.org/cmake/help/v3.0/module/FindBoost.html

If you're trying to use static boost libraries build by MSVC with shared runtime, please make sure the following statements exist in the PCL.

set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)

Then if you properly set the Boost_INCLUDE_DIR, all the libraries should be ready then.

On Fri, Aug 4, 2017 at 1:05 PM, 钟元鑫 <[hidden email]> wrote:
I'm trying to build PCL which has boost as dependency. However, when I download boost and build it, cmake cannot find it through any way.

I tried two version of boost, one is pre-build boost which was built by other person online and version is 1.61, another is one I downloaded whose version is 1.64. File structures of the two versions are the same:
[XXX]/include/boost-1_64/boost is the include dir and [XXX]/lib is the bin dir

I try to specify the Boost_INCLUDE_DIR to [XXX]/include/boost-1_64/boost, the messages in output window is attached (I turned Boost_DEBUG on).

I'm on Window 10 and VS2017

Thanks,
Jacob Zhong

------------------
顺颂时祺

钟元鑫  Yuanxin Zhong
清华大学汽车工程系  Dept. of Automotive Engineering, Tsinghua Univ.
Ad:Haidian District, Beijing, P.R.China    100084
Tel:<a href="tel:+86%20178%208883%203119" value="+8617888833119" target="_blank">+86 17888833119
E-mail:cmpute[hidden email] / zhongyx[hidden email]
 

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Not able to find boost with cmake

钟元鑫
In reply to this post by 钟元鑫
Actually I have built boost from source with the version I downloaded, and I've run the install script given by boost. However, I just cannot let CMake find it.

[ D:/Program Files/CMake/share/cmake-3.9/Modules/FindBoost.cmake:1450 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = D:/Program Files/PCL 1.8.0/3rdParty/Boost/include/boost-1_61/lib; ...(many other directories)
[ D:/Program Files/CMake/share/cmake-3.9/Modules/FindBoost.cmake:1595 ] Searching for THREAD_LIBRARY_RELEASE: libboost_thread-vc141-mt-1_61;libboost_thread-vc141-mt;libboost_thread-vc140-mt-1_61;libboost_thread-vc140-mt;libboost_thread-mt-1_61;libboost_thread-mt;libboost_thread

These are two lines in the output message, and I'm sure there is a file named "libboost_thread-vc141-mt-1_61.lib" in the lib directory listed in the first line where CMake will search for in.

However, the error message told me:

Could not find the following static Boost libraries: boost_thread

I don't know how this happened since it seems that CMake had already found the lib files. The attached log file shows the detail.

(PS: really sorry to reply again, I'm new to mailing list service)

Thanks,
Jacob Zhong

------------------ 原始邮件 ------------------
发件人: "Bo Zhou";<[hidden email]>;
发送时间: 2017年8月4日(星期五) 中午12:19
收件人: "钟元鑫"<[hidden email]>;
抄送: "cmake"<[hidden email]>;
主题: Re: [CMake] Not able to find boost with cmake

It's better not to use downloaded pre-built libraries, always build by yourself locally.

Before using Boost with CMake, please check https://cmake.org/cmake/help/v3.0/module/FindBoost.html

If you're trying to use static boost libraries build by MSVC with shared runtime, please make sure the following statements exist in the PCL.

set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)

Then if you properly set the Boost_INCLUDE_DIR, all the libraries should be ready then.

On Fri, Aug 4, 2017 at 1:05 PM, 钟元鑫 <[hidden email]> wrote:
I'm trying to build PCL which has boost as dependency. However, when I download boost and build it, cmake cannot find it through any way.

I tried two version of boost, one is pre-build boost which was built by other person online and version is 1.61, another is one I downloaded whose version is 1.64. File structures of the two versions are the same:
[XXX]/include/boost-1_64/boost is the include dir and [XXX]/lib is the bin dir

I try to specify the Boost_INCLUDE_DIR to [XXX]/include/boost-1_64/boost, the messages in output window is attached (I turned Boost_DEBUG on).

I'm on Window 10 and VS2017

Thanks,
Jacob Zhong

------------------
顺颂时祺

钟元鑫  Yuanxin Zhong
清华大学汽车工程系  Dept. of Automotive Engineering, Tsinghua Univ.
Ad:Haidian District, Beijing, P.R.China    100084
E-mail:cmpute[hidden email] / zhongyx[hidden email]
 

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake



--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake