Git Product home page Git Product logo

opencog / moses Goto Github PK

View Code? Open in Web Editor NEW
126.0 43.0 85.0 136.21 MB

MOSES Machine Learning: Meta-Optimizing Semantic Evolutionary Search. See also AS-MOSES https://github.com/opencog/asmoses but kept to guaranty backward compatibility.

Home Page: https://wiki.opencog.org/w/Meta-Optimizing_Semantic_Evolutionary_Search

License: Other

CMake 3.09% Shell 0.45% Python 0.86% Haskell 0.12% C++ 91.20% C 0.05% Roff 3.86% Cython 0.37%
machine-learning genetic-algorithm genetic-programming genetic-optimization-algorithm

moses's Introduction

MOSES -- Meta-Optimizing Semantic Evolutionary Search

CircleCI

MOSES is a machine-learning tool; it is an "evolutionary program learner". It is capable of learning short programs that capture patterns in input datasets. These programs can be output in either the combo programming language, or in python. For a given data input, the programs will roughly recreate the dataset on which they were trained.

MOSES has been used in several commercial applications, including the analysis of medical patient and physician clinical data, and in several different financial systems. It is also used by OpenCog to learn automated behaviors, movements and actions in response to perceptual stimulus of artificial-life virtual agents (i.e. pet-dog game avatars). Future plans including using it to learn behavioral programs that control real-world robots, via the OpenPsi implementation of Psi-theory and ROS nodes running on the OpenCog AtomSpace.

The term "evolutionary" means that MOSES uses genetic programming techniques to "evolve" new programs. Each program can be thought of as a tree (similar to a "decision tree", but allowing intermediate nodes to be any programming-language construct). Evolution proceeds by selecting one exemplar tree from a collection of reasonably fit individuals, and then making random alterations to the program tree, in an attempt to find an even fitter (more accurate) program.

It is derived from the ideas forumlated in Moshe Looks' thesis, "Competent Program Evolution", 2006 (Washington University, Missouri) http://metacog.org/main.pdf. Moshe is also one of the primary authors of this code.

LICENSE

MOSES is under double license, Apache 2.0 and GNU AGPL 3.

DOCUMENTATION

Documentation can be found in the /docs directory, which includes a "QuickStart.pdf" that reviews the algorithms and data structures used within MOSES. A detailed man-page can be found in /moses/moses/man/moses.1. There is also a considerable amount of information in the OpenCog wiki: http://wiki.opencog.org/w/Meta-Optimizing_Semantic_Evolutionary_Search

Prerequisites

To build and run MOSES, the packages listed below are required. With a few exceptions, most Linux distributions will provide these packages.

boost

C++ utilities package http://www.boost.org/ | libboost-dev

cmake

Build management tool; v2.8 or higher recommended. http://www.cmake.org/ | cmake

cxxtest

Test framework http://cxxtest.sourceforge.net/ | https://launchpad.net/~opencog-dev/+archive/ppa | cxxtest

cogutil

Common OpenCog C++ utilities http://github.com/opencog/cogutil It uses exactly the same build procedure as this package. Be sure to sudo make install at the end.

Optional Prerequisites

The following packages are optional. If they are not installed, some optional parts of MOSES will not be built. The CMake command, during the build, will be more precise as to which parts will not be built.

MPI

Message Passing Interface Required for compute-cluster version of MOSES Use either MPICHV2 or OpenMPI | http://www.open-mpi.org/ | libopenmpi-dev

Building MOSES

Peform the following steps at the shell prompt:

    cd to project root dir
    mkdir build
    cd build
    cmake -DCMAKE_BUILD_TYPE=Release ..
    make

Libraries will be built into subdirectories within build, mirroring the structure of the source directory root. The flag -DCMAKE_BUILD_TYPE=Release results in binaries that are optimized for for performance; ommitting this flag will result in faster builds, but slower executables.

Unit tests

To build and run the unit tests, from the ./build directory enter (after building moses as above):

    make test

INSTALLATION

Just say sudo make install after finishing the build.

EXAMPLES DIRECTORY

MOSES can be used in one of two ways: either directly from the command line, or by embedding its low-level API into C++ programs. For almost all users, the command-line interface is strongly recommended.

For those who absolutely must used the low-level C++ programming API, there is the /examples directory. To build the examples, say:

    make examples
  • example-ant: Santa Fe Trail ant example
  • example-data: Simple data sets on which moses can be run.
  • example-progs: Other example programs.

moses's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moses's Issues

build fails

Linking CXX executable combo-fmt-converter
../libcomboreduct.so: undefined reference to `opencog::combo::operator>>(std::istream&, opencog::tree<boost::variant<double, opencog::combo::enum_t, opencog::combo::id::builtin, opencog::combo::id::wild_card, opencog::combo::argument, opencog::combo::id::action, opencog::combo::builtin_action_base const*, opencog::combo::perception_base const*, std::cxx11::basic_string<char, std::char_traits, std::allocator >, opencog::combo::indefinite_object_base const, opencog::combo::message, opencog::combo::procedure_call_base const, opencog::combo::action_symbol_base const_, opencog::combo::ann_type>, std::allocator<opencog::tree_node_<boost::variant<double, opencog::combo::enum_t, opencog::combo::id::builtin, opencog::combo::id::wild_card, opencog::combo::argument, opencog::combo::id::action, opencog::combo::builtin_action_base const_, opencog::combo::perception_base const_, std::cxx11::basic_string<char, std::char_traits, std::allocator >, opencog::combo::indefinite_object_base const, opencog::combo::message, opencog::combo::procedure_call_base const, opencog::combo::action_symbol_base const_, opencog::combo::ann_type> > > >&)'
collect2: error: ld returned 1 exit status
moses/comboreduct/main/CMakeFiles/combo-fmt-converter.dir/build.make:92: recipe for target 'moses/comboreduct/main/combo-fmt-converter' failed
make[2]: *** [moses/comboreduct/main/combo-fmt-converter] Error 1
CMakeFiles/Makefile2:519: recipe for target 'moses/comboreduct/main/CMakeFiles/combo-fmt-converter.dir/all' failed
make[1]: *** [moses/comboreduct/main/CMakeFiles/combo-fmt-converter.dir/all] Error 2
Makefile:136: recipe for target 'all' failed
make: *** [all] Error 2

Maybe use std::bitset instead of packed_t?

The packed_t is used to pack bits together. However, it seems that perhaps std::bitset might do this better, and also offer more features, functions, etc. It might simplify the code!? and might? run faster?

Builtin: 12 unknown in Python output

Using MOSES on certain data with Python output gave me programs with the aforementioned error in them.
Comparing those programs with their rough Combo equivalents, it seems to me that "greater-than-zero" operator is not implemented for Python. Inspecting iostream_combo.cc further supports that claim, as there are only a handful of ops supported for Python and <0 is indeed not one of them.

I wonder how complex would it be to add it - is that a matter of simply modifying ostream_builtin or are more reaching changes needed?

As a side note, I also noticed you use Python operators like and directly, infix-wise. If Python's operator module was used, you could invoke them prefix-wise. Maybe it would make it easier to generate Python programs from Combo.

make examples fails for target trap-uni

I guess this is an instance of bit rot.

mini-me@virtucon ~/h/c/m/build (master)> make examples
Consolidate compiler generated dependencies of target trap-uni
[93%] Building CXX object examples/example-progs/CMakeFiles/trap-uni.dir/trap-uni.cc.o
/home/mini-me/home/cellar/moses/examples/example-progs/trap-uni.cc:97:44: error: ‘_1’ was not declared in this scope
   97 |                     bind(&trap::vee, this, _1)),
make[6]: *** [examples/example-progs/CMakeFiles/trap-uni.dir/build.make:76: examples/example-progs/CMakeFiles/trap-uni.dir/trap-uni.cc.o] Error 1
make[5]: *** [CMakeFiles/Makefile2:3159: examples/example-progs/CMakeFiles/trap-uni.dir/all] Error 2
make[4]: *** [Makefile:156: all] Error 2
make[3]: *** [CMakeFiles/examples.dir/build.make:71: CMakeFiles/examples] Error 2
make[2]: *** [CMakeFiles/Makefile2:982: CMakeFiles/examples.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:989: CMakeFiles/examples.dir/rule] Error 2
make: *** [Makefile:228: examples] Error 2
mini-me@virtucon ~/h/c/m/build (master) [2]>

make test fails

$ make test
...
Linking CXX executable annUTest
../../../moses/comboreduct/libcomboreduct.so: undefined reference to `opencog::combo::operator>>(std::istream&, opencog::tree<boost::variant<double, opencog::combo::enum_t, opencog::combo::id::builtin, opencog::combo::id::wild_card, opencog::combo::argument, opencog::combo::id::action, opencog::combo::builtin_action_base const*, opencog::combo::perception_base const*, std::string, opencog::combo::indefinite_object_base const*, opencog::combo::message, opencog::combo::procedure_call_base const*, opencog::combo::action_symbol_base const*, opencog::combo::ann_type, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>, std::allocator<opencog::tree_node_<boost::variant<double, opencog::combo::enum_t, opencog::combo::id::builtin, opencog::combo::id::wild_card, opencog::combo::argument, opencog::combo::id::action, opencog::combo::builtin_action_base const*, opencog::combo::perception_base const*, std::string, opencog::combo::indefinite_object_base const*, opencog::combo::message, opencog::combo::procedure_call_base const*, opencog::combo::action_symbol_base const*, opencog::combo::ann_type, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> > > >&)'
collect2: error: ld returned 1 exit status
tests/comboreduct/combo/CMakeFiles/annUTest.dir/build.make:94: recipe for target 'tests/comboreduct/combo/annUTest' failed
make[3]: *** [tests/comboreduct/combo/annUTest] Error 1
CMakeFiles/Makefile2:1785: recipe for target 'tests/comboreduct/combo/CMakeFiles/annUTest.dir/all' failed
make[2]: *** [tests/comboreduct/combo/CMakeFiles/annUTest.dir/all] Error 2
CMakeFiles/Makefile2:130: recipe for target 'CMakeFiles/test.dir/rule' failed
make[1]: *** [CMakeFiles/test.dir/rule] Error 2
Makefile:197: recipe for target 'test' failed
make: *** [test] Error 2

Build error on Debian sid

The build of moses fails on Debian sid with several errors like:

In file included from /home/mhatta/work/OpenCog/moses/opencog-moses-3.6.10~git20180629.f8932cb/moses/comboreduct/table/table_io.cc:44:                                                                     
/home/mhatta/work/OpenCog/moses/opencog-moses-3.6.10~git20180629.f8932cb/moses/comboreduct/table/table
.h: In member function ‘unsigned int opencog::combo::ITable::sample_count(opencog::combo::arity_t)’: 
/home/mhatta/work/OpenCog/moses/opencog-moses-3.6.10~git20180629.f8932cb/moses/comboreduct/table/table.h:852:58: error: ‘EXPONENTIAL’ was not declared in this scope                                       
         else return COEF_SAMPLE_COUNT*log(contin_arity + EXPONENTIAL);                              
                                                          ^~~~~~~~~~~
/home/mhatta/work/OpenCog/moses/opencog-moses-3.6.10~git20180629.f8932cb/moses/comboreduct/table/table.h:852:58: note: suggested alternative: ‘EXPR_NEST_MAX’                                              
         else return COEF_SAMPLE_COUNT*log(contin_arity + EXPONENTIAL);                              
                                                          ^~~~~~~~~~~                                
                                                          EXPR_NEST_MAX                  

I'm not sure where EXPONENTIAL comes from.

Create a subclass of field_set without continuous representation as variable-length sequences of bits.

By recommendation of Nil, I'm opening a issue initially discussed on the Slack moses channel.
Summary of the situation:
I'm adding particle swarm to the optimization part of moses, and representing continuous knobs as variable-length sequences of bits is causing loss of information and ps doesn't need this discrete representation.
As discussed in the channel, I was thinking of change this representation just inside particle swarm, but there's the problem of returning the deme to the metapopulation that would lose information in the same way.
So Ben said that this design "doesn't really need to persist".

I was thinking that I could "create a modified version of field_set overriding the contin parts to use 1 packet_t as float and use this modified version only with particle swarm".
I still don't know how it can affect other parts like the metapopulation, or if it can be done easily.
Because of that i'm opening this issue looking for opinions.

Have in mind that will use a little more ram for each instance with contin parts, but with a better precision and less processing.

Boost Fails

I am running my command to compile Moses ToolKit on Ubuntu 20.04 using the following command and get the below issue

./bjam --with-cmph=/home/namrata/smt/cmph-2.0 -j4

Error :
XMLRPC-C: USING VERSION 1.33.14 FROM /usr/local
BUILDING MOSES SERVER!
Performing configuration checks

- Shared Boost             : no
- Static Boost             : yes

BUILDING MOSES2 SERVER!
Building Moses2
...patience...
...patience...
...found 7284 targets...
...updating 72 targets...
gcc.link moses-cmd/bin/gcc-4.8/release/link-static/threading-multi/moses
/usr/bin/ld: moses/bin/gcc-4.8/release/link-static/threading-multi/libmoses.a(InMemoryPerSentenceOnDemandLM.o): in function Moses::InMemoryPerSentenceOnDemandLM::InitializeForInput(boost::shared_ptr<Moses::TranslationTask> const&)': InMemoryPerSentenceOnDemandLM.cpp:(.text+0x39f): warning: the use of tmpnam' is dangerous, better use mkstemp' /usr/bin/ld: moses/bin/gcc-4.8/release/link-static/threading-multi/libmoses.a(Parameter.o): in function Moses::Parameter::Parameter()':
Parameter.cpp:(.text+0x137e): undefined reference to boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)' /usr/bin/ld: Parameter.cpp:(.text+0x17e7): undefined reference to boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
/usr/bin/ld: Parameter.cpp:(.text+0x1a01): undefined reference to boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)' /usr/bin/ld: Parameter.cpp:(.text+0x1ff7): undefined reference to boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
/usr/bin/ld: Parameter.cpp:(.text+0x266c): undefined reference to boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)' /usr/bin/ld: moses/bin/gcc-4.8/release/link-static/threading-multi/libmoses.a(Parameter.o):Parameter.cpp:(.text+0x2982): more undefined references to boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)' follow
collect2: error: ld returned 1 exit status

"g++" -L"/home/namrata/smt/cmph-2.0/lib" -L"/home/namrata/smt/cmph-2.0/lib64" -L"/usr/local/lib" -Wl,-R -Wl,"/home/namrata/smt/cmph-2.0/lib" -Wl,-R -Wl,"/home/namrata/smt/cmph-2.0/lib64" -Wl,-R -Wl,"/usr/local/lib" -Wl,-rpath-link -Wl,"/home/namrata/smt/cmph-2.0/lib" -Wl,-rpath-link -Wl,"/home/namrata/smt/cmph-2.0/lib64" -Wl,-rpath-link -Wl,"/usr/local/lib" -o "moses-cmd/bin/gcc-4.8/release/link-static/threading-multi/moses" -Wl,--start-group "moses-cmd/bin/gcc-4.8/release/link-static/threading-multi/Main.o" "moses/bin/gcc-4.8/release/link-static/threading-multi/libmoses.a" "probingpt/bin/gcc-4.8/release/link-static/threading-multi/libprobingpt.a"  -Wl,-Bstatic -lboost_filesystem -lboost_iostreams -lz -lboost_filesystem -lboost_iostreams -lcmph -llzma -lbz2 -lxmlrpc_xmltok -lxmlrpc_xmlparse -lxmlrpc_util -lxmlrpc_server_abyss++ -lxmlrpc_server_abyss -lxmlrpc_server++ -lxmlrpc_server -lxmlrpc_abyss -lxmlrpc++ -lxmlrpc -ltcmalloc_minimal -lboost_thread -lboost_system -lboost_serialization -lboost_program_options -lz -Wl,-Bdynamic -lSegFault -lrt -Wl,--end-group -pthread 

...failed gcc.link moses-cmd/bin/gcc-4.8/release/link-static/threading-multi/moses...
gcc.link moses-cmd/bin/gcc-4.8/release/link-static/threading-multi/lmbrgrid
/usr/bin/ld: moses/bin/gcc-4.8/release/link-static/threading-multi/libmoses.a(InMemoryPerSentenceOnDemandLM.o): in function Moses::InMemoryPerSentenceOnDemandLM::InitializeForInput(boost::shared_ptr<Moses::TranslationTask> const&)': InMemoryPerSentenceOnDemandLM.cpp:(.text+0x39f): warning: the use of tmpnam' is dangerous, better use mkstemp' /usr/bin/ld: moses/bin/gcc-4.8/release/link-static/threading-multi/libmoses.a(Parameter.o): in function Moses::Parameter::Parameter()':
Parameter.cpp:(.text+0x137e): undefined reference to boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)' /usr/bin/ld: Parameter.cpp:(.text+0x17e7): undefined reference to boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
/usr/bin/ld: Parameter.cpp:(.text+0x1a01): undefined reference to boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)' /usr/bin/ld: Parameter.cpp:(.text+0x1ff7): undefined reference to boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
/usr/bin/ld: Parameter.cpp:(.text+0x266c): undefined reference to boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)' /usr/bin/ld: moses/bin/gcc-4.8/release/link-static/threading-multi/libmoses.a(Parameter.o):Parameter.cpp:(.text+0x2982): more undefined references to boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)' follow
collect2: error: ld returned 1 exit status

.............................
...failed gcc.link moses/LM/bin/BackwardTest.test/gcc-4.8/release/link-static/threading-multi/BackwardTest...
...skipped <pmoses/LM/bin/BackwardTest.test/gcc-4.8/release/link-static/threading-multi>BackwardTest.run for lack of <pmoses/LM/bin/BackwardTest.test/gcc-4.8/release/link-static/threading-multi>BackwardTest...
...failed updating 65 targets...
...skipped 7 targets...
The build failed. If you need support, run:
./jam-files/bjam --with-cmph=/home/namrata/smt/cmph-2.0 -j4 --debug-configuration -d2 |gzip >build.log.gz
then attach build.log.gz to your e-mail.
You MUST do 3 things before sending to the mailing list:

  1. Subscribe to the mailing list at http://mailman.mit.edu/mailman/listinfo/moses-support
  2. Attach build.log.gz to your e-mail
  3. Say what is the EXACT command you executed when you got the error
    ERROR

Moses result as scheme

Is there any way to print out moses results directly from the command line in a scheme format rather than a python snippet or a combo function? It is possible to do this using pymoses.But why isn't this possible form the command line?

All Unit tests failing on buildbot, why?

Unit tests report

0% tests passed, 35 tests failed out of 35

Total Test time (real) =   0.18 sec

more @ http://buildbot.opencog.org:8010/builders/moses_master_trusty/builds/0/steps/test/logs/stdio

The installed dependencies are https://github.com/opencog/docker/blob/master/opencog/base/Dockerfile#L8-L14 (basically all the opencog's system dependencies with the exception of link-grammar) and cogutils.

Are there any dependencies missing or configurations required for moses?

Boost fails

Lots'o boost errors. Using boost 1.58 for the most part. A couple of 1.54s.

CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o: In function boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::xparse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const': /usr/local/include/boost/program_options/detail/value_semantic.hpp:167: undefined reference to boost::program_options::validate(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, int)'
CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o: In function boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)': /usr/local/include/boost/program_options/errors.hpp:373: undefined reference to boost::program_options::validation_error::get_templateabi:cxx11'
/usr/local/include/boost/program_options/errors.hpp:373: undefined reference to boost::program_options::error_with_option_name::error_with_option_name(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o: In function boost::program_options::basic_command_line_parser::extra_parser(boost::function1<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&>)':
/usr/local/include/boost/program_options/detail/parsers.hpp:78: undefined reference to boost::program_options::detail::cmdline::set_additional_parser(boost::function1<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>)' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o: In function std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > boost::program_options::to_internal<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >(std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&)':
/usr/local/include/boost/program_options/detail/convert.hpp:79: undefined reference to boost::program_options::to_internal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o: In function boost::program_options::basic_command_line_parser::basic_command_line_parser(int, char const
const*)':
/usr/local/include/boost/program_options/detail/parsers.hpp:44: undefined reference to boost::program_options::detail::cmdline::cmdline(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o: In function boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, char>::name() const':
/usr/local/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to boost::program_options::arg[abi:cxx11]' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o: In function boost::program_options::typed_value<float, char>::name() const':
/usr/local/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to boost::program_options::arg[abi:cxx11]' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o: In function boost::program_options::typed_value<unsigned int, char>::name() const':
/usr/local/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to boost::program_options::arg[abi:cxx11]' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o: In function boost::program_options::typed_value<unsigned long, char>::name() const':
/usr/local/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to boost::program_options::arg[abi:cxx11]' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o: In function main':
/home/chris/Downloads/cog/moses/moses/comboreduct/main/gen-disj-conj.cc:57: undefined reference to boost::program_options::options_description::options_description(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o: In function void boost::program_options::validate<float, char>(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, float*, long)':
/usr/local/include/boost/program_options/detail/value_semantic.hpp:92: undefined reference to boost::program_options::invalid_option_value::invalid_option_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o: In function void boost::program_options::validate<unsigned int, char>(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, unsigned int*, long)':
/usr/local/include/boost/program_options/detail/value_semantic.hpp:92: undefined reference to boost::program_options::invalid_option_value::invalid_option_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o: In function void boost::program_options::validate<unsigned long, char>(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, unsigned long*, long)':
/usr/local/include/boost/program_options/detail/value_semantic.hpp:92: undefined reference to boost::program_options::invalid_option_value::invalid_option_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE]+0x30): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const'
CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE]+0x38): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE]+0x30): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const'
CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE]+0x38): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o:(.rodata._ZTVN5boost15program_options16validation_errorE[_ZTVN5boost15program_options16validation_errorE]+0x30): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const'
CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o:(.rodata._ZTVN5boost15program_options20invalid_option_valueE[_ZTVN5boost15program_options20invalid_option_valueE]+0x30): more undefined references to boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' follow CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o:(.rodata._ZTVN5boost15program_options11typed_valueImcEE[_ZTVN5boost15program_options11typed_valueImcEE]+0x40): undefined reference to boost::program_options::value_semantic_codecvt_helper::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, bool) const'
CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o:(.rodata._ZTVN5boost15program_options11typed_valueIjcEE[_ZTVN5boost15program_options11typed_valueIjcEE]+0x40): undefined reference to boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const' CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o:(.rodata._ZTVN5boost15program_options11typed_valueIfcEE[_ZTVN5boost15program_options11typed_valueIfcEE]+0x40): undefined reference to boost::program_options::value_semantic_codecvt_helper::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, bool) const'
CMakeFiles/gen-disj-conj.dir/gen-disj-conj.cc.o:(.rodata._ZTVN5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEE[_ZTVN5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEE]+0x40): undefined reference to boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const' ../libcomboreduct.so: undefined reference to boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > > > const&)'
../libcomboreduct.so: undefined reference to boost::gregorian::greg_month::get_month_map_ptr[abi:cxx11]()' ../libcomboreduct.so: undefined reference to boost::re_detail_106100::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > >, boost::regex_traits<char, boost::cpp_regex_traits > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits > > const&, boost::regex_constants::_match_flags)'
collect2: error: ld returned 1 exit status
moses/comboreduct/main/CMakeFiles/gen-disj-conj.dir/build.make:102: recipe for target 'moses/comboreduct/main/gen-disj-conj' failed
make[2]: *** [moses/comboreduct/main/gen-disj-conj] Error 1
CMakeFiles/Makefile2:566: recipe for target 'moses/comboreduct/main/CMakeFiles/gen-disj-conj.dir/all' failed
make[1]: *** [moses/comboreduct/main/CMakeFiles/gen-disj-conj.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMakeFiles/combo-fmt-converter.dir/combo-fmt-converter.cc.o: In function parse_program_args(int, char**)': /home/chris/Downloads/cog/moses/moses/comboreduct/main/combo-fmt-converter.cc:63: undefined reference to boost::program_options::options_description::options_description(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, unsigned int, unsigned int)'
CMakeFiles/combo-fmt-converter.dir/combo-fmt-converter.cc.o: In function boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::xparse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const': /usr/local/include/boost/program_options/detail/value_semantic.hpp:167: undefined reference to boost::program_options::validate(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, int)'
CMakeFiles/combo-fmt-converter.dir/combo-fmt-converter.cc.o: In function boost::program_options::basic_command_line_parser<char>::extra_parser(boost::function1<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>)': /usr/local/include/boost/program_options/detail/parsers.hpp:78: undefined reference to boost::program_options::detail::cmdline::set_additional_parser(boost::function1<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&>)'
CMakeFiles/combo-fmt-converter.dir/combo-fmt-converter.cc.o: In function std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > boost::program_options::to_internal<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)': /usr/local/include/boost/program_options/detail/convert.hpp:79: undefined reference to boost::program_options::to_internal(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
CMakeFiles/combo-fmt-converter.dir/combo-fmt-converter.cc.o: In function boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*)': /usr/local/include/boost/program_options/detail/parsers.hpp:44: undefined reference to boost::program_options::detail::cmdline::cmdline(std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&)'
CMakeFiles/combo-fmt-converter.dir/combo-fmt-converter.cc.o: In function boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::name() const': /usr/local/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to boost::program_options::arg[abi:cxx11]'
CMakeFiles/combo-fmt-converter.dir/combo-fmt-converter.cc.o: In function boost::program_options::typed_value<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, char>::name() const': /usr/local/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to boost::program_options::arg[abi:cxx11]'
CMakeFiles/combo-fmt-converter.dir/combo-fmt-converter.cc.o: In function void boost::program_options::validate<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*, int)': /usr/local/include/boost/program_options/detail/value_semantic.hpp:146: undefined reference to boost::program_options::validate(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >
, int)'
/usr/local/include/boost/program_options/detail/value_semantic.hpp:150: undefined reference to boost::program_options::invalid_option_value::invalid_option_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' CMakeFiles/combo-fmt-converter.dir/combo-fmt-converter.cc.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE]+0x30): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const'
CMakeFiles/combo-fmt-converter.dir/combo-fmt-converter.cc.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE]+0x38): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' CMakeFiles/combo-fmt-converter.dir/combo-fmt-converter.cc.o:(.rodata._ZTVN5boost15program_options16validation_errorE[_ZTVN5boost15program_options16validation_errorE]+0x30): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const'
CMakeFiles/combo-fmt-converter.dir/combo-fmt-converter.cc.o:(.rodata._ZTVN5boost15program_options20invalid_option_valueE[_ZTVN5boost15program_options20invalid_option_valueE]+0x30): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' CMakeFiles/combo-fmt-converter.dir/combo-fmt-converter.cc.o:(.rodata._ZTVN5boost15program_options11typed_valueISt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EEcEE[_ZTVN5boost15program_options11typed_valueISt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EEcEE]+0x40): undefined reference to boost::program_options::value_semantic_codecvt_helper::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, bool) const'
CMakeFiles/combo-fmt-converter.dir/combo-fmt-converter.cc.o:(.rodata._ZTVN5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEE[_ZTVN5boost15program_options11typed_valueINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEcEE]+0x40): undefined reference to boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const' ../libcomboreduct.so: undefined reference to boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > > > const&)'
../libcomboreduct.so: undefined reference to boost::gregorian::greg_month::get_month_map_ptr[abi:cxx11]()' ../libcomboreduct.so: undefined reference to boost::re_detail_106100::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > >, boost::regex_traits<char, boost::cpp_regex_traits > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits > > const&, boost::regex_constants::_match_flags)'
collect2: error: ld returned 1 exit status
moses/comboreduct/main/CMakeFiles/combo-fmt-converter.dir/build.make:102: recipe for target 'moses/comboreduct/main/combo-fmt-converter' failed
make[2]: *** [moses/comboreduct/main/combo-fmt-converter] Error 1
CMakeFiles/Makefile2:528: recipe for target 'moses/comboreduct/main/CMakeFiles/combo-fmt-converter.dir/all' failed
make[1]: *** [moses/comboreduct/main/CMakeFiles/combo-fmt-converter.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

metapopulation::ostream_metapop only logs the best candidate(s), not the top ones

metapopulation::ostream_metapop currently only outputs the very best candidate(s), not the top candidates as it was initially meant.

This does not affect the output of moses (which uses a provided printer, not metapopulation::ostream_metapop), however it removes the ability to partly or wholly record the metapopulation when fine log is enabled.

build fail for current commit ae725ae

anyone else having this problem?
moses build fail with current commit

$git log
commit ae725ae8ad6534638ef15a5f7556d18020291dae

current cogutils commit:

/cogutils/build$ git log
commit d85f7dcfc68e6f944c2d905de1b5229a69bc29b5

make error message:

[ 62%] Building CXX object moses/feature-selection/main/CMakeFiles/eval-features.dir/eval-features.cc.o
In file included from /home/biocog/moses/moses/comboreduct/main/tree_gen.cc:30:0:
/home/biocog/moses/moses/comboreduct/main/tree_generation.h: In function ‘void 
opencog::trees::ramped_half_and_half(It, It, const Selector&, int, int, bool)’:
/home/biocog/moses/moses/comboreduct/main/tree_generation.h:86:8: error: expected type-specifier before ‘TypeCheckException’
  catch(TypeCheckException) {
        ^
make[2]: *** [moses/comboreduct/main/CMakeFiles/tree_gen.dir/tree_gen.cc.o] Error 1
make[1]: *** [moses/comboreduct/main/CMakeFiles/tree_gen.dir/all] Error 2

MOSES example moses-ann-pole1 segmentation fault

I receive a segmentation fault when I run the MOSES example program moses-ann-pole1 on Ubuntu 14.04.1 with GCC 4.8.4.

Preparation:
mkdir build
cd build ; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make
make examples
cd ../examples/example-progs

Start gdb:
gdb moses-ann-pole1

Run the program:
(gdb) run 100 1

Starting program: /home/cosmo/moses/build/examples/example-progs/moses-ann-pole1 100 1
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff0d9b700 (LWP 17457)]

Program received signal SIGSEGV, Segmentation fault.
0x000000000046c0b4 in std::char_traits<char>::length (__s=0x0) at /usr/include/c++/4.8/bits/char_traits.h:259
259       { return __builtin_strlen(__s); }

(gdb) backtrace

#0  0x000000000046c0b4 in std::char_traits<char>::length (__s=0x0) at /usr/include/c++/4.8/bits/char_traits.h:259
#1  0x000000000047a8b9 in boost::detail::lexical_stream_limited_src<char, std::char_traits<char>, false>::shl_char_array (this=0x7fffffffc9d0, str=0x0) at /usr/include/boost/lexical_cast.hpp:1591
#2  0x0000000000478827 in boost::detail::lexical_stream_limited_src<char, std::char_traits<char>, false>::operator<< (this=0x7fffffffc9d0, str=0x0) at /usr/include/boost/lexical_cast.hpp:1818
#3  0x00000000004755bc in boost::detail::lexical_cast_do_cast<double, char*>::lexical_cast_impl (arg=@0x7fffffffd660: 0x0) at /usr/include/boost/lexical_cast.hpp:2354
#4  0x0000000000472229 in boost::lexical_cast<double, char*> (arg=@0x7fffffffd660: 0x0) at /usr/include/boost/lexical_cast.hpp:2523
#5  0x000000000046b405 in main (argc=3, argv=0x7fffffffd648) at /home/cosmo/moses/examples/example-progs/moses-ann-pole1.cc:58

Build fails due to ambiguous call with boost on some systems

This problem is also described at https://stackoverflow.com/questions/52122093/error-call-of-overloaded-distance-is-ambiguous . The link recommends replacing the call to distance with std::distance. I suppose boost::distance would also work.

I'm having this issue locally with boost 1.69 .

Building CXX object moses/comboreduct/CMakeFiles/comboreduct.dir/table/table.cc.o
/home/user/src/moses/moses/comboreduct/table/table.cc: In member function ‘int opencog::combo::ITable::get_column_offset(const string&) const’:
/home/user/src/moses/moses/comboreduct/table/table.cc:249:40: error: call of overloaded ‘distance(std::vector<std::basic_string<char> >::iterator, __gnu_cxx::__normal_iterator<std::basic_string<char>*, std::vector<std::basic_string<char> > >&)’ is ambiguous
     return distance(labels.begin(), pos);
                                        ^
/home/user/src/moses/moses/comboreduct/table/table.cc:249:40: note: candidates are:
In file included from /usr/local/include/boost/range/distance.hpp:18:0,
                 from /usr/local/include/boost/range/functions.hpp:21,
                 from /usr/local/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/local/include/boost/range/iterator_range.hpp:13,
                 from /usr/local/include/boost/range/detail/range_return.hpp:14,
                 from /usr/local/include/boost/range/algorithm/adjacent_find.hpp:17,
                 from /home/user/src/moses/moses/comboreduct/table/table.cc:33:
/usr/local/include/boost/iterator/distance.hpp:49:9: note: typename boost::iterators::iterator_difference<Iterator>::type boost::iterators::distance_adl_barrier::distance(SinglePassIterator, SinglePassIterator) [with SinglePassIterator = __gnu_cxx::__normal_iterator<std::basic_string<char>*, std::vector<std::basic_string<char> > >; typename boost::iterators::iterator_difference<Iterator>::type = long int]
         distance(SinglePassIterator first, SinglePassIterator last)
         ^
In file included from /usr/include/c++/4.8.2/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/4.8.2/bits/char_traits.h:39,
                 from /usr/include/c++/4.8.2/string:40,
                 from /usr/include/c++/4.8.2/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8.2/bits/ios_base.h:41,
                 from /usr/include/c++/4.8.2/iomanip:40,
                 from /home/user/src/moses/moses/comboreduct/table/table.cc:29:
/usr/include/c++/4.8.2/bits/stl_iterator_base_funcs.h:114:5: note: typename std::iterator_traits<_Iterator>::difference_type std::distance(_InputIterator, _InputIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<std::basic_string<char>*, std::vector<std::basic_string<char> > >; typename std::iterator_traits<_Iterator>::difference_type = long int]
     distance(_InputIterator __first, _InputIterator __last)
     ^
make[2]: *** [moses/comboreduct/CMakeFiles/comboreduct.dir/table/table.cc.o] Error 1
make[1]: *** [moses/comboreduct/CMakeFiles/comboreduct.dir/all] Error 2
make: *** [all] Error 2

make fails to cythonize pymoses

makeing moses fails at this particular spot:

[ 92%] Built target eval-diversity
[ 94%] Built target moses-exec
[ 94%] Built target moses-man
[ 96%] Built target eval-features
[ 98%] Built target fs-main
[ 98%] Built target feature-man
[ 98%] Cythonizing pymoses.pyx

Error compiling Cython file:

...
raise MosesException('Error: eval method
requires a list of input '
'values.')

    namespace = {}
    exec self.program in namespace
        ^

/home/me/opencog/moses/moses/cython/opencog/pymoses.pyx:34:13: Syntax error in simple statement list
moses/cython/opencog/CMakeFiles/moses_cython.dir/build.make:62: recipe for target 'moses/cython/opencog/pymoses.cpp' failed

My guess is that cython somehow gets confused by namespace being an empty dictionary, but I know next to no cython myself and so am probably wrong.

Add a division-of-constants reduction rule.

Add a contin reduction that can reduce this:

((5.06447865729134317 * x) - 1.38413811600397763)  > 0

to this:

(x - 0.2733031788002957) > 0

Such a rule does not currently exist, because when contins used the power-of-2 representation, performing constant divisions would blow up the rep (consider representing 1/3 by base-2 binary!)

Now that we use float-poit and PSO, it makes sense to add this new reduction rule.

Improve uniformity penalty formula

The uniformity penalty formula can probably be improved. This can be seen by looking at the log of resulting from running diversityUTest::test_diversity_5_parity_no_autoscale(). At the end of the first iteration, the best 2 candidates are true and false. However false already has a small uniformity penalty, which doesn't make much sense since its behavioral score is at maximum distance from the behavioral score of true, ideally it should be null.

`make` fails

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

error: call of overloaded distance is ambiguous

On Ubuntu 16.04 x64, with boost 1.68 and gcc 8.2, building moses fails with the following errors and warnings:

-- Build files have been written to: /tmp/moses-master/build
Scanning dependencies of target combo-man
Scanning dependencies of target feature_selection
Scanning dependencies of target moses_exec
Scanning dependencies of target comboreduct
[  0%] Generating eval-table.1.gz
[  0%] Built target combo-man
Scanning dependencies of target moses-man
[  0%] Generating moses.1.gz
[  0%] Built target moses-man
Scanning dependencies of target feature-man
[  0%] Generating feature-selection.1.gz
[  0%] Built target feature-man
[  0%] Building CXX object moses/moses/main/CMakeFiles/moses_exec.dir/demo-problems.cc.o
[  1%] Building CXX object moses/moses/main/CMakeFiles/moses_exec.dir/problem.cc.o
[  1%] Building CXX object moses/feature-selection/CMakeFiles/feature_selection.dir/algo/deme_optimize.cc.o
[  3%] Building CXX object moses/comboreduct/CMakeFiles/comboreduct.dir/crutil/exception.cc.o
[  3%] Building CXX object moses/comboreduct/CMakeFiles/comboreduct.dir/combo/action.cc.o
[  5%] Building CXX object moses/comboreduct/CMakeFiles/comboreduct.dir/combo/action_symbol.cc.o
[  5%] Building CXX object moses/moses/main/CMakeFiles/moses_exec.dir/problem-params.cc.o
[  7%] Building CXX object moses/feature-selection/CMakeFiles/feature_selection.dir/algo/incremental.cc.o
[  7%] Building CXX object moses/comboreduct/CMakeFiles/comboreduct.dir/combo/assumption.cc.o
[  7%] Building CXX object moses/feature-selection/CMakeFiles/feature_selection.dir/algo/random.cc.o
[  7%] Building CXX object moses/comboreduct/CMakeFiles/comboreduct.dir/combo/builtin_action.cc.o
[  9%] Building CXX object moses/comboreduct/CMakeFiles/comboreduct.dir/combo/definite_object.cc.o
[  9%] Building CXX object moses/comboreduct/CMakeFiles/comboreduct.dir/combo/descriptions.cc.o
[  9%] Building CXX object moses/comboreduct/CMakeFiles/comboreduct.dir/combo/enum_type.cc.o
[  9%] Building CXX object moses/feature-selection/CMakeFiles/feature_selection.dir/algo/simple.cc.o
[  9%] Building CXX object moses/moses/main/CMakeFiles/moses_exec.dir/moses_exec.cc.o
[ 11%] Building CXX object moses/comboreduct/CMakeFiles/comboreduct.dir/combo/indefinite_object.cc.o
[ 11%] Building CXX object moses/comboreduct/CMakeFiles/comboreduct.dir/combo/iostream_combo.cc.o
[ 11%] Building CXX object moses/comboreduct/CMakeFiles/comboreduct.dir/combo/message.cc.o
/tmp/moses-master/moses/comboreduct/combo/iostream_combo.cc: In function ‘std::__cxx11::string opencog::combo::l2ph(const string&, const std::vector<std::__cxx11::basic_string<char> >&)’:
/tmp/moses-master/moses/comboreduct/combo/iostream_combo.cc:543:64: error: call of overloaded ‘distance(std::vector<std::__cxx11::basic_string<char> >::const_iterator, __gnu_cxx::__normal_iterator<const std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >&)’ is ambiguous
                 arity_t idx = distance(labels.begin(), found_it) + 1;
                                                                ^
In file included from /usr/include/c++/8/bits/stl_algobase.h:66,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iostream:39,
                 from /tmp/moses-master/moses/comboreduct/combo/iostream_combo.h:28,
                 from /tmp/moses-master/moses/comboreduct/combo/iostream_combo.cc:24:
/usr/include/c++/8/bits/stl_iterator_base_funcs.h:138:5: note: candidate: ‘typename std::iterator_traits<_Iterator>::difference_type std::distance(_InputIterator, _InputIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; typename std::iterator_traits<_Iterator>::difference_type = long int]’
     distance(_InputIterator __first, _InputIterator __last)
     ^~~~~~~~
In file included from /usr/local/include/boost/range/distance.hpp:18,
                 from /usr/local/include/boost/range/functions.hpp:21,
                 from /usr/local/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/local/include/boost/lexical_cast.hpp:30,
                 from /tmp/moses-master/moses/comboreduct/combo/iostream_combo.h:30,
                 from /tmp/moses-master/moses/comboreduct/combo/iostream_combo.cc:24:
/usr/local/include/boost/iterator/distance.hpp:49:9: note: candidate: ‘typename boost::iterators::iterator_difference<Iterator>::type boost::iterators::distance_adl_barrier::distance(SinglePassIterator, SinglePassIterator) [with SinglePassIterator = __gnu_cxx::__normal_iterator<const std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; typename boost::iterators::iterator_difference<Iterator>::type = long int]’
         distance(SinglePassIterator first, SinglePassIterator last)
         ^~~~~~~~
/tmp/moses-master/moses/comboreduct/combo/iostream_combo.cc:556:56: error: call of overloaded ‘distance(std::vector<std::__cxx11::basic_string<char> >::const_iterator, __gnu_cxx::__normal_iterator<const std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >&)’ is ambiguous
         arity_t idx = distance(labels.begin(), found_it) + 1;
                                                        ^
In file included from /usr/include/c++/8/bits/stl_algobase.h:66,
                 from /usr/include/c++/8/bits/char_traits.h:39,
                 from /usr/include/c++/8/ios:40,
                 from /usr/include/c++/8/ostream:38,
                 from /usr/include/c++/8/iostream:39,
                 from /tmp/moses-master/moses/comboreduct/combo/iostream_combo.h:28,
                 from /tmp/moses-master/moses/comboreduct/combo/iostream_combo.cc:24:
/usr/include/c++/8/bits/stl_iterator_base_funcs.h:138:5: note: candidate: ‘typename std::iterator_traits<_Iterator>::difference_type std::distance(_InputIterator, _InputIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; typename std::iterator_traits<_Iterator>::difference_type = long int]’
     distance(_InputIterator __first, _InputIterator __last)
     ^~~~~~~~
In file included from /usr/local/include/boost/range/distance.hpp:18,
                 from /usr/local/include/boost/range/functions.hpp:21,
                 from /usr/local/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/local/include/boost/lexical_cast.hpp:30,
                 from /tmp/moses-master/moses/comboreduct/combo/iostream_combo.h:30,
                 from /tmp/moses-master/moses/comboreduct/combo/iostream_combo.cc:24:
/usr/local/include/boost/iterator/distance.hpp:49:9: note: candidate: ‘typename boost::iterators::iterator_difference<Iterator>::type boost::iterators::distance_adl_barrier::distance(SinglePassIterator, SinglePassIterator) [with SinglePassIterator = __gnu_cxx::__normal_iterator<const std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; typename boost::iterators::iterator_difference<Iterator>::type = long int]’
         distance(SinglePassIterator first, SinglePassIterator last)
         ^~~~~~~~
[ 13%] Building CXX object moses/comboreduct/CMakeFiles/comboreduct.dir/combo/perception.cc.o
moses/comboreduct/CMakeFiles/comboreduct.dir/build.make:179: recipe for target 'moses/comboreduct/CMakeFiles/comboreduct.dir/combo/iostream_combo.cc.o' failed
make[2]: *** [moses/comboreduct/CMakeFiles/comboreduct.dir/combo/iostream_combo.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 15%] Building CXX object moses/moses/main/CMakeFiles/moses_exec.dir/moses_exec_def.cc.o
[ 15%] Building CXX object moses/moses/main/CMakeFiles/moses_exec.dir/table-problems.cc.o
[ 17%] Building CXX object moses/feature-selection/CMakeFiles/feature_selection.dir/algo/stochastic_max_dependency.cc.o
CMakeFiles/Makefile2:343: recipe for target 'moses/comboreduct/CMakeFiles/comboreduct.dir/all' failed
make[1]: *** [moses/comboreduct/CMakeFiles/comboreduct.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 17%] Building CXX object moses/feature-selection/CMakeFiles/feature_selection.dir/scorers/moses_optim.cc.o
[ 17%] Building CXX object moses/feature-selection/CMakeFiles/feature_selection.dir/main/feature-selection.cc.o
[ 19%] Linking CXX shared library libmoses_exec.so
[ 19%] Built target moses_exec
[ 21%] Linking CXX shared library libfeature_selection.so
[ 21%] Built target feature_selection
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

I'll try to figure out a way to disambiguate that call to distance, but I'm not that knowledgeable in C++.

ETA: the type of labels.begin() is std::vector<std::__cxx11::basic_string<char>>::const_iterator. Explicitly casting found_it to the same type instead of using auto didn't get rid of the ambiguity.

build fails for ubuntu 18.04 at eval-table.cc for commit ce62ccbd1

ce62ccb Merge pull request #74 from linas/cm
singnet/cogutils is current: master f194b3300

[ 52%] Building CXX object moses/comboreduct/main/CMakeFiles/eval-table.dir/eval-table.cc.o
/home/mozi/oc/moses/moses/comboreduct/main/eval-table.cc: In function ‘void eval_output_results(const evalTableParameters&, const opencog::combo::Table&, const std::vector<opencog::tree<boost::variant<double, opencog::combo::enum_t, opencog::combo::id::builtin, opencog::combo::id::wild_card, opencog::combo::argument, opencog::combo::id::action, const opencog::combo::builtin_action_base*, const opencog::combo::perception_base*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, const opencog::combo::indefinite_object_base*, opencog::combo::message, const opencog::combo::procedure_call_base*, const opencog::combo::action_symbol_base*, opencog::combo::ann_type> > >&)’:
/home/mozi/oc/moses/moses/comboreduct/main/eval-table.cc:105:39: error: call of overloaded ‘ndigits(std::vector<opencog::tree<boost::variant<double, opencog::combo::enum_t, opencog::combo::id::builtin, opencog::combo::id::wild_card, opencog::combo::argument, opencog::combo::id::action, const opencog::combo::builtin_action_base*, const opencog::combo::perception_base*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, const opencog::combo::indefinite_object_base*, opencog::combo::message, const opencog::combo::procedure_call_base*, const opencog::combo::action_symbol_base*, opencog::combo::ann_type> > >::size_type)’ is ambiguous
     unsigned npad = ndigits(trs.size());
                                       ^
/home/mozi/oc/moses/moses/comboreduct/main/eval-table.cc:95:28: note: candidate: Int ndigits(Int) [with Int = long unsigned int]
 template<typename Int> Int ndigits(Int x)
                            ^~~~~~~
In file included from /home/mozi/oc/moses/moses/comboreduct/main/eval-table.cc:29:0:
/usr/local/include/opencog/util/numeric.h:266:28: note: candidate: Int opencog::ndigits(Int, Int) [with Int = long unsigned int]
 template<typename Int> Int ndigits(Int x, Int base = 10) {
                            ^~~~~~~
moses/comboreduct/main/CMakeFiles/eval-table.dir/build.make:62: recipe for target 'moses/comboreduct/main/CMakeFiles/eval-table.dir/eval-table.cc.o' failed
make[2]: *** [moses/comboreduct/main/CMakeFiles/eval-table.dir/eval-table.cc.o] Error 1
CMakeFiles/Makefile2:1022: recipe for target 'moses/comboreduct/main/CMakeFiles/eval-table.dir/all' failed
make[1]: *** [moses/comboreduct/main/CMakeFiles/eval-table.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

MOSES fails to run when boosting is enabled

I am trying to run MOSES with the --boost option set to true(1) to enable boosting. However, MOSES keeps failing by throwing the following exception:

terminate called after throwing an instance of 'opencog::AssertionException'
what(): bscore error not implemented for bscorer N7opencog5moses19ctruth_table_bscoreE (/home/xabush/moses/moses/moses/scoring/scoring_base.cc:116)

Here the full command line options that I used:

  moses -i train_temp_5b910dc42ae73d236f57cc08 -o 5b910dc42ae73d236f57cc08_fold_0_seed_941 --random-seed=941  '--balance=1' 
 '--boost=1'  '--boost-promote=2'  '--enable-fs=1'  '--fs-algo=simple'  '--fs-target-size=4'  '--hc-widen-search=1'  '--reduct-knob-building-effort=1'  '--result-count=100'  -W1  -j 8 -m 10000

‘pow’ is not a member of ‘std’

While makeing (a freshly git pulled)MOSES, I've run into an error:

[ 68%] Building CXX object moses/moses/CMakeFiles/moses.dir/moses/moses_main.cc.o
In file included from /home/myname/opencog/moses/moses/moses/moses/../metapopulation/metapopulation.h:42:0,
                 from /home/enoch/opencog/moses/moses/moses/moses/moses_main.cc:27:
/usr/local/include/opencog/util/boost_ext/accumulators/statistics/geometric_mean_mirror.h: In member function ‘boost::accumulators::impl::geometric_mean_mirror_impl<Sample, Tag>::result_type boost::accumulators::impl::geometric_mean_mirror_impl<Sample, Tag>::result(const Args&) const’:
/usr/local/include/opencog/util/boost_ext/accumulators/statistics/geometric_mean_mirror.h:73:24: error: ‘pow’ is not a member of ‘std’
             return 1 - std::pow(this->prod, 1.0 / count(args));

This looks like a simple C++ error, and should be easy to correct, unless I'm missing something vital.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.