boost-process dependency problem
Closed this issue · 5 comments
Hello Ahmed,
Thank you for your great work of C++ implementation. However I met some problems compiling the code because of this line in the CMakelists.txt in the root folder:
include_directories(${Boost_INCLUDE_DIRS} /home/aybassiouny/libs/boost-process)
I tried the boost-process library downloaded from http://www.highscore.de/boost/process/index.html#process.download
while I got compiling errors regarding the boost library. I am wondering if you could share more information of the boost process library you use.
Thanks,
Lethic
Hi Lethic,
I also faced this problem.
I compiled Boost locally. Download latest Boost release (boost_1_60_0) and Boost process. Then copy process and process.hpp to boost_1_60_0/boost and process to boost_1_60_0/libs. After that compiled boost with the following steps -
- Create two folders (using command like mkdir foldername ) build-dir and install-dir
- Run command ./booststrap
- next run the following
./bjam -j4 link=static threading=multi --builddir=./build-dir install --without-mpi --prefix=./install-dir
Once Boost is compiled go back to the directory where you were compiling OpenFaceCpp. Add the following in install.sh
export BOOST_ROOT=/path/to/boost_1_60_0/install-dir
export BOOST_INCLUDEDIR=/path/to/install-dir/include
also edit the following line
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_AVX_INSTRUCTIONS=ON ..
to
cmake -DBOOST_FILESYSTEM_VERSION=2 -DCMAKE_BUILD_TYPE=Release -DUSE_AVX_INSTRUCTIONS=ON ..
Then try ./install.sh.
Hope this helps.
Mousmita
Hi Mousmita,
Thanks you so much for your help.
I got basically the compiling error I had before as follows. And I also changed the 11th line in the CMakeLists.txt from include_directories(${Boost_INCLUDE_DIRS} /home/aybassiouny/libs/boost-process)
to either include_directories(${Boost_INCLUDE_DIRS} )
or include_directories(${Boost_INCLUDE_DIRS} /home/lethic/projects/boost_1_60_0/libs/process )
both have the same error.
In file included from /home/lethic/projects/boost_1_60_0/install-dir/include/boost/process.hpp:42:0,
from /home/lethic/projects/OpenFaceCpp/src/TorchWrap.h:13,
from /home/lethic/projects/OpenFaceCpp/src/TorchWrap.cpp:1:
/home/lethic/projects/boost_1_60_0/install-dir/include/boost/process/operations.hpp: In function ‘std::string boost::process::find_executable_in_path(const string&, std::string)’:
/home/lethic/projects/boost_1_60_0/install-dir/include/boost/process/operations.hpp:85:36: error: ‘filesystem_error’ is not a member of ‘boost::filesystem’
boost::throw_exception(boost::filesystem::filesystem_error("boost::process::find_executable_in_path: retrieving PATH failed", file, boost::system::errc::make_error_code(boost::system::errc::no_such_file_or_directory)));
^
In file included from /home/lethic/projects/boost_1_60_0/install-dir/include/boost/process.hpp:42:0,
from /home/lethic/projects/OpenFaceCpp/src/TorchWrap.h:13,
from /home/lethic/projects/OpenFaceCpp/src/TorchWrap.cpp:1:
/home/lethic/projects/boost_1_60_0/install-dir/include/boost/process/operations.hpp:130:32: error: ‘filesystem_error’ is not a member of ‘boost::filesystem’
boost::throw_exception(boost::filesystem::filesystem_error("boost::process::find_executable_in_path: file not found", file, boost::system::errc::make_error_code(boost::system::errc::no_such_file_or_directory)));
^
In file included from /home/lethic/projects/boost_1_60_0/install-dir/include/boost/process/posix_child.hpp:25:0,
from /home/lethic/projects/boost_1_60_0/install-dir/include/boost/process.hpp:27,
from /home/lethic/projects/OpenFaceCpp/src/TorchWrap.h:13,
from /home/lethic/projects/OpenFaceCpp/src/TorchWrap.cpp:1:
/home/lethic/projects/boost_1_60_0/install-dir/include/boost/process/detail/posix_ops.hpp: In function ‘pid_t boost::process::detail::posix_start(const Executable&, const Arguments&, const environment&, boost::process::detail::info_map&, boost::process::detail::info_map&, const boost::process::detail::posix_setup&) [with Executable = std::basic_string<char>; Arguments = std::vector<std::basic_string<char> >; pid_t = int; boost::process::environment = std::map<std::basic_string<char>, std::basic_string<char> >; boost::process::detail::info_map = std::map<int, boost::process::detail::stream_info>]’:
/home/lethic/projects/boost_1_60_0/install-dir/include/boost/process/detail/posix_ops.hpp:414:13: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
::write(STDERR_FILENO, e.what(), std::strlen(e.what()));
^
/home/lethic/projects/boost_1_60_0/install-dir/include/boost/process/detail/posix_ops.hpp:415:13: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
::write(STDERR_FILENO, "\n", 1);
^
/home/lethic/projects/boost_1_60_0/install-dir/include/boost/process/detail/posix_ops.hpp:433:9: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
::write(STDERR_FILENO, e.what(), std::strlen(e.what()));
^
/home/lethic/projects/boost_1_60_0/install-dir/include/boost/process/detail/posix_ops.hpp:434:9: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
::write(STDERR_FILENO, "\n", 1);
^
make[2]: *** [CMakeFiles/OpenFaceCpp.dir/src/TorchWrap.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/lethic/projects/boost_1_60_0/install-dir/include/boost/process.hpp:42:0,
from /home/lethic/projects/OpenFaceCpp/src/TorchWrap.h:13,
from /home/lethic/projects/OpenFaceCpp/src/main.cpp:3:
/home/lethic/projects/boost_1_60_0/install-dir/include/boost/process/operations.hpp: In function ‘std::string boost::process::find_executable_in_path(const string&, std::string)’:
/home/lethic/projects/boost_1_60_0/install-dir/include/boost/process/operations.hpp:85:36: error: ‘filesystem_error’ is not a member of ‘boost::filesystem’
boost::throw_exception(boost::filesystem::filesystem_error("boost::process::find_executable_in_path: retrieving PATH failed", file, boost::system::errc::make_error_code(boost::system::errc::no_such_file_or_directory)));
^
In file included from /home/lethic/projects/boost_1_60_0/install-dir/include/boost/process.hpp:42:0,
from /home/lethic/projects/OpenFaceCpp/src/TorchWrap.h:13,
from /home/lethic/projects/OpenFaceCpp/src/main.cpp:3:
/home/lethic/projects/boost_1_60_0/install-dir/include/boost/process/operations.hpp:130:32: error: ‘filesystem_error’ is not a member of ‘boost::filesystem’
boost::throw_exception(boost::filesystem::filesystem_error("boost::process::find_executable_in_path: file not found", file, boost::system::errc::make_error_code(boost::system::errc::no_such_file_or_directory)));
And I got rid of that error by changing the /install-dir/include/boost/process/operations.hpp to remove this:
#include <boost/filesystem/path.hpp>
And instead say this:
#include <boost/filesystem/operations.hpp>
according to
http://stackoverflow.com/questions/8926715/missing-exception-in-boost-process
Now I can see the OpenFaceCpp excutable.
Thanks again!
Thanks @aybassiouny for your work!
Hey @lethic - I guess better late than never, I have added hunter packaging system to the repo it should solve this issue. Sorry for late reply.