opencog / moses

MOSES Machine Learning: Meta-Optimizing Semantic Evolutionary Search. See also AS-MOSES https://github.com/opencog/asmoses but kept to guaranty backward compatibility.
https://wiki.opencog.org/w/Meta-Optimizing_Semantic_Evolutionary_Search
Other
127 stars 83 forks source link

`make` fails #55

Closed StrangeTcy closed 6 years ago

StrangeTcy commented 6 years ago

A freshly cloned moses repo fails to be made. The system used is Ubuntu 16.04 x64, the exact line was sudo make, and the result was as follows:

[ 31%] Built target comboreduct
[ 35%] Built target comboant
[ 35%] Linking CXX executable combo-fmt-converter
../libcomboreduct.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > const&)'
../libcomboreduct.so: undefined reference to `boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)'
../libcomboreduct.so: undefined reference to `boost::re_detail::get_mem_block()'
../libcomboreduct.so: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
../libcomboreduct.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
../libcomboreduct.so: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
../libcomboreduct.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
../libcomboreduct.so: undefined reference to `boost::re_detail::put_mem_block(void*)'
../libcomboreduct.so: undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)'
../libcomboreduct.so: undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)'
collect2: error: ld returned 1 exit status
ngeiswei commented 6 years ago

I would assume that you need to install boost regex lib. I'm surprised that cmake didn't detect that, it should according to https://github.com/opencog/moses/blob/master/CMakeLists.txt#L141

Can you paste cmake's output before installing boost regex?

ngeiswei commented 6 years ago

BTW, we typically do not compile with root privilege, only install with it. But I don't think it is the cause of your problem, if it is, then it's a bug.

StrangeTcy commented 6 years ago

To the best of my knowledge, I have all boost libs installed (that is, I have installed the libboost-all-dev package from Ubuntu repositories). Still, I should check for the regex lib specifically.

StrangeTcy commented 6 years ago

Anyway, just running cmake outputs this:

-- Build type: Release
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   date_time
--   filesystem
--   program_options
--   regex
--   serialization
--   system
--   thread
--   chrono
--   atomic
-- Boost version 105800 found.
-- Found Boost::program_options
-- Found Boost::math
-- Found CxxTest.
-- Found CogUtil version 2.0.2 at /usr/local/lib/libcogutil.so
-- CogUtil found.
-- MPI was found.
-- Valgrind Prefix: 
-- VALGRIND was found.
-- VALGRIND devel headers found.
-- Python libs found.
-- Cython ( 0.23.4 >= 0.19.0) found.
-- Python destination dir found: /usr/lib/python2.7/dist-packages
fatal: No names found, cannot describe anything.
CMake Warning (dev) at CMakeLists.txt:338 (ADD_CUSTOM_TARGET):
  Policy CMP0037 is not set: Target names should not be reserved and should
  match a validity pattern.  Run "cmake --help-policy CMP0037" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  The target name "test" is reserved or not valid for certain CMake features,
  such as generator expressions, and may result in undefined behavior.
This warning is for project developers.  Use -Wno-dev to suppress it.

The following components will be built:
-----------------------------------------------
   ComboReduct        - Library for reduction of combo program trees.
   Doxygen            - Code documentation.
   Feature selection  - MOSES based feature selection tool.
   MOSES              - Meta-Optimizing Semantic Evolutionary Search.
   Python bindings    - Python (cython) bindings.
   Unit tests         - Unit tests.

The following components WILL NOT be built:
-----------------------------------------------
   Python tests       - Python bindings nose tests.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/me/opencog/moses/build

So it'd seem that cmake does find all the boost libraries necessary, and then, for some reason, make fails to use it.

ngeiswei commented 6 years ago

Actually, I'm having the same problem with Ubuntu 17.10. Will look into that tomorrow.

StrangeTcy commented 6 years ago

Yep, that seems to have solved it. Thanks!