Giter VIP home page Giter VIP logo

sferes2's Issues

The ./waf check fails after successful build and configure

After successfully finishing the ./waf configure and the ./waf build, I try ./waf check, which returns a successful line:
Command-line options for exp [exp/example] : -> OK
followed immediately by a failure:
No function check defined in /home/nick/Desktop/sferes2-master/wscript
What do you think I should do? I'm at a loss.

Test setup error: test tree is empty

hi, jbmouret:
I follow the https://github.com/jbmouret/sferes2/wiki/Compilation to build the sferes2, all the versions of the libraries are the same as the link, include the boost and opencv.
It seems that the ./waf configure and build is right. However, when I do the ./waf check. It shows that:
*** No errors detected
Test setup error: test tree is empty
default/tests/tests_modif_diversity ............OK
……
default/modules/map_elite/test_map_elite ...FAILED
……
debug/modules/nn2/test_hyper_nn ............FAILED
……
debug/modules/map_elite/test_map_elite .....FAILED

The ……means that items are check okay, I omit them.
May you give me some suggestion?
Great thanks.

sferes with Python 3

The waf script does not work with Python 3; running ./waf configure gives "SyntaxError: Missing parentheses in call to 'print'"

Optimize disk space

  • switch to binary archives
  • compress executables when submitting jobs with qsub
  • compress the binary archives if the library is present?

Creation exp not up-to-date

Hi all,

it look like the automatic creation of new experiments is not compatible anymore with the waf version we are using.

./waf --create test_test 
./waf --exp test_test

complains about 'BuildContext' object has no attribute 'new_task_gen'

We should think to fix this.

Novelty Search improvement

Hi Mouret,

Thanks a lot for including a Novelty Search version in Sferes. I've found it very close to the description in NS paper.
I find the following issues that you might want to fix:

  1. In this file: sferes/modif/novelty.hpp, after lowering the rho_min, I think we need to reset the _not_added to be 0; otherwise every generation after this, the accumulated _not_added will always be larger than Params::novelty::stalled_tresh, resulting in _rho_min keeps getting lowered.

     // update rho_min
     if (_not_added > Params::novelty::stalled_tresh)//2500
     {
        _rho_min *= 0.95;
       _not_added = 0; // <--- suggested change
     }
  2. I find that after satisfying this check (n > _rho_min || misc::rand<float>() < Params::novelty::add_to_archive_prob) (in the code below), one individual will be added directly to the archive. However, there is a chance that this individual is exactly the same as one already in the archive or very close to one in the archive (distance ~ 0).

if (n > _rho_min
              || misc::rand<float>() < Params::novelty::add_to_archive_prob) {
            _archive.push_back(ea.pop()[i]);
            _not_added = 0;
            ++added;
          }

So I'm wondering if adding another check condition would help the search more efficient.
What do you think?

Best,

Again, I really appreciate such a great framework you created!

c++11

If you're interested to migrate to c++11, I made commands to do it quickly.

# constexpr
find sferes2 -type f -name '*.hpp' | xargs sed -i 's/static[    ]\+const[   ]\+\(\(\w[  :]*\)\+=\)/static constexpr \1/g' $1
find sferes2 -type f -name '*.cpp' | xargs sed -i 's/static[    ]\+const[   ]\+\(\(\w[  :]*\)\+=\)/static constexpr \1/g' $1
#be careful to got space and tabulation inside [  ]

# is_nan
find sferes2 -type f -name '*.hpp' | xargs sed -i 's/\([^:]\)isnan/\1std::isnan/g' $1
find sferes2 -type f -name '*.cpp' | xargs sed -i 's/\([^:]\)isnan/\1std::isnan/g' $1

I'm not sure the 2 first are necessary since you commit SFERES_CONST.

Last point, in the new macro SFERES_ARRAY, you should use directly "static const" instead of SFERES_CONST (which means "static constexpr" in c++11) since it is a function.

It's works well on my code.

sferes.create_variants also compiles source file without any definitions

This is a difference between old sferes behavior and new sferes behavior. When creating the following wscript file in an experiment:

#! /usr/bin/env python
import sferes

def options(opt): pass

def build(bld):
   uselib_ = 'BOOST EIGEN SDL'
   sferes.create_variants(bld,
                             source = 'maze.cpp',
                             use = 'sferes2 fastsim',
                             target = '',
                             uselib = 'BOOST EIGEN SDL',
                             variants = ['GEN1 POP4'])

My old sferes version compiles maze_gen21_pop4.cpp with GEN1 and POP4 defined. However, the current sferes version also tries to compile maze.cpp, without any defines. This is a problem for my current experimental setup, since many of my 'variant' arguments are mandatory, and maze.cpp does not compile as a result (and maze_gen21_pop4.cpp does not finish compilation either, because maze.cpp fails).

As such, I am curious what the intended behavior is of sferes.create_variants, and what the right way is to deal with this issue. For now, I have removed the statement that causes create_variants to build maze.cpp in my local copy.

libboost_mpi cannot be found during ./waf check

Hi I have successfully configured with ./waf configure with following message:

WARNING simplejson not found some function may not work
module : [modules/nn2]
module : [modules/map_elite]
Check for program g++ or c++             : /bin/g++
Check for program cpp                    : /bin/cpp
Check for program ar                     : /bin/ar
Check for program ranlib                 : /bin/ranlib
Checking for g++                         : ok
boost headers                            : Version 1_59 (/scratch/include)
library boost_serialization              : ok
library boost_filesystem                 : ok
library boost_system                     : ok
library boost_unit_test_framework        : ok
library boost_program_options            : ok
library boost_graph                      : ok
library boost_mpi                        : ok
library boost_python                     : ok
library boost_thread                     : ok
Checking for header tbb/parallel_for.h   : ok /usr/include
Checking for library libtbb              : not found
Checking for header tbb/parallel_for.h   : ok /usr/include
Checking for library libtbb              : not found
Checking for header mpi.h                : ok /scratch2/tmp_xin/foolingPath/openmpi-1.10.2//build/include/
Checking for SDL (optional)              : ok
Checking for header Eigen/Core           : ok /scratch/eigen
Check for program ode-config             : not found
Checking for ODE (optional)              : not found
Checking for GSL (optional)              : ok

--- configuration ---
compiler:
 * CXX: gcc
boost version: 1_59
mpi: True
Compilation flags :
 * default:
   CXXFLAGS : -D_REENTRANT -Wall -fPIC -ftemplate-depth-1024 -Wno-sign-compare -Wno-deprecated  -Wno-unused -DUSE_SDL  -I/scratch/protoc-2.6.1/include -DMPI_ENABLED -DNO_PARALLEL -DEIGEN3_ENABLED -DSFERES_ROOT="/scratch2/fuxin/fooling/sferes"  -DNDEBUG -O3 -ffast-math
   LINKFLAGS: -L/usr/local/apps/cuda/current/lib64 -L/scratch/protoc-2.6.1/lib -L/scratch2/fuxin/fooling/sferes/lib
 * debug:
   CXXFLAGS : -D_REENTRANT -Wall -fPIC -ftemplate-depth-1024 -Wno-sign-compare -Wno-deprecated  -Wno-unused -DUSE_SDL  -I/scratch/protoc-2.6.1/include -DMPI_ENABLED -DNO_PARALLEL -DEIGEN3_ENABLED -DSFERES_ROOT="/scratch2/fuxin/fooling/sferes" -O1 -ggdb3 -DDBG_ENABLED
   LINKFLAGS: -L/usr/local/apps/cuda/current/lib64 -L/scratch/protoc-2.6.1/lib -L/scratch2/fuxin/fooling/sferes/lib

--- license ---
Sferes2 is distributed under the CECILL license (GPL-compatible)
Please check the accompagnying COPYING file or http://www.cecill.info/
'configure' finished successfully (0.286s)

and was build successfully.

But when I use ./waf check, i get a lot of fail:

WARNING simplejson not found some function may not work
module : [modules/nn2]
module : [modules/map_elite]
Waf: Entering directory `/scratch2/fuxin/fooling/sferes/build'
Entering directory `/scratch2/fuxin/fooling/sferes'
Entering directory `/scratch2/fuxin/fooling/sferes/modules/'
Entering directory `/scratch2/fuxin/fooling/sferes/modules/'
Waf: Leaving directory `/scratch2/fuxin/fooling/sferes/build'
'build' finished successfully (0.072s)
Running the unit tests
/scratch2/fuxin/fooling/sferes/build/default/tests/tests_ea_cmaes: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/tests/tests_ea_dom_sort: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/tests/tests_ea_eps_moea: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/tests/tests_ea_nsga2: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/tests/tests_ea_rank_simple: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/tests/tests_eval_mpi: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/tests/tests_eval_parallel: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/tests/tests_gen_bit_string: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/tests/tests_gen_cmaes: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/tests/tests_gen_evo_float: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/tests/tests_gen_sampled: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/tests/tests_modif_diversity: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
Running 3 test cases...
Entering test module "nn"
../modules/nn2/test_nn.cpp(48): Entering test case "nn_basic"
../modules/nn2/test_nn.cpp(48): Leaving test case "nn_basic"; testing time: 10ms
../modules/nn2/test_nn.cpp(84): Entering test case "nn_remove_small_weights"
2
../modules/nn2/test_nn.cpp(84): Leaving test case "nn_remove_small_weights"; testing time: 10ms
../modules/nn2/test_nn.cpp(104): Entering test case "nn_speed"
timer (1000 iterations):0.59
Test case nn_speed did not check any assertions
../modules/nn2/test_nn.cpp(104): Leaving test case "nn_speed"; testing time: 1500ms
Leaving test module "nn"; testing time: 1520ms

*** No errors detected
/scratch2/fuxin/fooling/sferes/build/default/modules/nn2/test_dnn: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/modules/nn2/test_mlp: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/modules/nn2/test_hyper_nn: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/modules/nn2/test_dnn_ff: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/modules/nn2/test_osc: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/modules/nn2/test_hyper_nn_anh: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/default/modules/map_elite/test_map_elite: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/tests/tests_ea_cmaes: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/tests/tests_ea_dom_sort: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/tests/tests_ea_eps_moea: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/tests/tests_ea_nsga2: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/tests/tests_ea_rank_simple: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/tests/tests_eval_mpi: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/tests/tests_eval_parallel: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/tests/tests_gen_bit_string: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/tests/tests_gen_cmaes: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/tests/tests_gen_evo_float: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/tests/tests_gen_sampled: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/tests/tests_modif_diversity: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
Running 3 test cases...
Entering test module "nn"
../modules/nn2/test_nn.cpp(48): Entering test case "nn_basic"
../modules/nn2/test_nn.cpp(48): Leaving test case "nn_basic"; testing time: 10ms
../modules/nn2/test_nn.cpp(84): Entering test case "nn_remove_small_weights"
2
../modules/nn2/test_nn.cpp(84): Leaving test case "nn_remove_small_weights"
../modules/nn2/test_nn.cpp(104): Entering test case "nn_speed"
timer (1000 iterations):0.55
Test case nn_speed did not check any assertions
../modules/nn2/test_nn.cpp(104): Leaving test case "nn_speed"; testing time: 1600ms
Leaving test module "nn"; testing time: 1610ms

*** No errors detected
/scratch2/fuxin/fooling/sferes/build/debug/modules/nn2/test_dnn: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/modules/nn2/test_mlp: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/modules/nn2/test_hyper_nn: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/modules/nn2/test_dnn_ff: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/modules/nn2/test_osc: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/modules/nn2/test_hyper_nn_anh: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
/scratch2/fuxin/fooling/sferes/build/debug/modules/map_elite/test_map_elite: error while loading shared libraries: libboost_mpi.so.1.59.0: cannot open shared object file: No such file or directory
default/tests/tests_ea_cmaes ...............FAILED
default/tests/tests_ea_dom_sort ............FAILED
default/tests/tests_ea_eps_moea ............FAILED
default/tests/tests_ea_nsga2 ...............FAILED
default/tests/tests_ea_rank_simple .........FAILED
default/tests/tests_eval_mpi ...............FAILED
default/tests/tests_eval_parallel ..........FAILED
default/tests/tests_gen_bit_string .........FAILED
default/tests/tests_gen_cmaes ..............FAILED
default/tests/tests_gen_evo_float ..........FAILED
default/tests/tests_gen_sampled ............FAILED
default/tests/tests_modif_diversity ........FAILED
default/modules/nn2/test_nn ....................OK
default/modules/nn2/test_dnn ...............FAILED
default/modules/nn2/test_mlp ...............FAILED
default/modules/nn2/test_hyper_nn ..........FAILED
default/modules/nn2/test_dnn_ff ............FAILED
default/modules/nn2/test_osc ...............FAILED
default/modules/nn2/test_hyper_nn_anh ......FAILED
default/modules/map_elite/test_map_elite ...FAILED
debug/tests/tests_ea_cmaes .................FAILED
debug/tests/tests_ea_dom_sort ..............FAILED
debug/tests/tests_ea_eps_moea ..............FAILED
debug/tests/tests_ea_nsga2 .................FAILED
debug/tests/tests_ea_rank_simple ...........FAILED
debug/tests/tests_eval_mpi .................FAILED
debug/tests/tests_eval_parallel ............FAILED
debug/tests/tests_gen_bit_string ...........FAILED
debug/tests/tests_gen_cmaes ................FAILED
debug/tests/tests_gen_evo_float ............FAILED
debug/tests/tests_gen_sampled ..............FAILED
debug/tests/tests_modif_diversity ..........FAILED
debug/modules/nn2/test_nn ......................OK
debug/modules/nn2/test_dnn .................FAILED
debug/modules/nn2/test_mlp .................FAILED
debug/modules/nn2/test_hyper_nn ............FAILED
debug/modules/nn2/test_dnn_ff ..............FAILED
debug/modules/nn2/test_osc .................FAILED
debug/modules/nn2/test_hyper_nn_anh ........FAILED
debug/modules/map_elite/test_map_elite .....FAILED

Successful tests:      2 (5.0%)
Failed tests:          38 (95.0%)
Erroneous tests:       0 (0.0%)

Total number of tests: 40

Unit tests finished
'check' finished successfully (3.346s)

./waf configure --includes does not add more than one path

When configuring a project, the --includes option has some unexpected behavior (at least for me). When adding two paths, only the last path will be included. For example, when configuring with the following command:

./waf configure --includes /path/to/a --includes /path/to/b

Sferes will add the following flags:

CXXFLAGS : -D_REENTRANT -Wall -fPIC -ftemplate-depth-1024 -Wno-sign-compare -Wno-deprecated -Wno-unused -DSFERES_ROOT="/Users/joost/Documents/sferes/sferes2" -std=c++11 -I/path/to/b -DEIGEN3_ENABLED

Notice that -I/path/to/a is missing.

To fix the issue, I would suggest the following modifications to the wscript file in sferes root:

From:
opt.add_option('--includes', type='string', help='add an include path, e.g. /home/mandor/include', dest='includes')

To:
opt.add_option('--includes', action='append', type='string', help='add an include path, e.g. /home/mandor/include', dest='includes')

And from:

    if conf.options.includes :
        conf.env['CXXFLAGS'] += ["-I" + conf.options.includes]

To:

    if conf.options.includes :
        for inlcude_dir in conf.options.includes:
            conf.env['CXXFLAGS'] += [" -I" + inlcude_dir]

Failed in running the unit tests

Hi jbmouret,
The terminal shows the following errors when I do the ./waf check. These commands are done under Ubuntu 14.04 LTS. Thanks in advance!

module : [modules/nn2]
module : [modules/map_elite]
Waf: Entering directory /home/sferes/build' Entering directory/home/sferes'
Entering directory /home/sferes/modules/' Entering directory/home/sferes/modules/'
Waf: Leaving directory `/home/sferes/build'
'build' finished successfully (0.005s)
Running the unit tests
default/tests/tests_modif_diversity .........ERROR
default/tests/tests_eval_parallel ...........ERROR
default/tests/tests_eval_mpi ................ERROR
default/tests/tests_ea_cmaes ................ERROR
default/tests/tests_ea_nsga2 ................ERROR
default/tests/tests_ea_eps_moea .............ERROR
default/tests/tests_ea_rank_simple ..........ERROR
default/tests/tests_ea_dom_sort .............ERROR
default/tests/tests_gen_cmaes ...............ERROR
default/tests/tests_gen_bit_string ..........ERROR
default/tests/tests_gen_evo_float ...........ERROR
default/tests/tests_gen_sampled .............ERROR
default/modules/nn2/test_nn .................ERROR
default/modules/nn2/test_dnn ................ERROR
default/modules/nn2/test_mlp ................ERROR
default/modules/nn2/test_hyper_nn ...........ERROR
default/modules/nn2/test_dnn_ff .............ERROR
default/modules/nn2/test_osc ................ERROR
default/modules/nn2/test_hyper_nn_anh .......ERROR
default/modules/map_elite/test_map_elite ....ERROR
debug/tests/tests_modif_diversity ...........ERROR
debug/tests/tests_eval_parallel .............ERROR
debug/tests/tests_eval_mpi ..................ERROR
debug/tests/tests_ea_cmaes ..................ERROR
debug/tests/tests_ea_nsga2 ..................ERROR
debug/tests/tests_ea_eps_moea ...............ERROR
debug/tests/tests_ea_rank_simple ............ERROR
debug/tests/tests_ea_dom_sort ...............ERROR
debug/tests/tests_gen_cmaes .................ERROR
debug/tests/tests_gen_bit_string ............ERROR
debug/tests/tests_gen_evo_float .............ERROR
debug/tests/tests_gen_sampled ...............ERROR
debug/modules/nn2/test_nn ...................ERROR
debug/modules/nn2/test_dnn ..................ERROR
debug/modules/nn2/test_mlp ..................ERROR
debug/modules/nn2/test_hyper_nn .............ERROR
debug/modules/nn2/test_dnn_ff ...............ERROR
debug/modules/nn2/test_osc ..................ERROR
debug/modules/nn2/test_hyper_nn_anh .........ERROR
debug/modules/map_elite/test_map_elite ......ERROR

Successful tests: 0 (0.0%)
Failed tests: 0 (0.0%)
Erroneous tests: 40 (100.0%)

Total number of tests: 40

Unit tests finished
'check' finished successfully (0.094s)

Before this, I did ./waf configure, and the terminal returns:

module : [modules/nn2]
module : [modules/map_elite]
Check for program g++ or c++ : /usr/bin/g++
Check for program cpp : /usr/bin/cpp
Check for program ar : /usr/bin/ar
Check for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
boost headers : Version 1_54 (/usr/include)
library boost_serialization : not found
library boost_filesystem : not found
library boost_system : not found
library boost_unit_test_framework : not found
library boost_program_options : not found
library boost_graph : not found
library boost_mpi : not found
library boost_python : not found
library boost_thread : not found
Checking for header tbb/parallel_for.h : ok /usr/include
Checking for library libtbb : ok /usr/lib
Checking for header tbb/parallel_for.h : ok /usr/include
Checking for library libtbb : ok /usr/lib
Checking for header mpi.h : ok /usr/include/mpi
Checking for SDL (optional) : not found
Checking for header Eigen/Core : ok /usr/include/eigen3
Check for program ode-config : not found
Checking for ODE (optional) : not found
Checking for GSL (optional) : not found

--- configuration ---
compiler:

  • CXX: gcc
    boost version: 1_54
    mpi: False
    Compilation flags :
  • default:
    CXXFLAGS : -D_REENTRANT -Wall -fPIC -ftemplate-depth-1024 -Wno-sign-compare -Wno-deprecated -Wno-unused -DEIGEN3_ENABLED -DSFERES_ROOT="/home/sferes" -DNDEBUG -O3 -ffast-math
    LINKFLAGS:
  • debug:
    CXXFLAGS : -D_REENTRANT -Wall -fPIC -ftemplate-depth-1024 -Wno-sign-compare -Wno-deprecated -Wno-unused -DEIGEN3_ENABLED -DSFERES_ROOT="/home/sferes" -O1 -ggdb3 -DDBG_ENABLED
    LINKFLAGS:

--- license ---
Sferes2 is distributed under the CECILL license (GPL-compatible)
Please check the accompagnying COPYING file or http://www.cecill.info/
'configure' finished successfully (0.154s)

And ./waf build returns:

./waf buildmodule : [modules/nn2]
module : [modules/map_elite]
Waf: Entering directory /home/sferes/build' Entering directory/home/sferes'
Entering directory /home/sferes/modules/' Entering directory/home/sferes/modules/'
Waf: Leaving directory `/home/sferes/build'
'build' finished successfully (0.019s)

Clean sferes.py

There is still the old submission / parallelisation system (with references to the svn). I think nobody uses it.

Getter methods for population in NSGA2 seem to be missing const declaration

In the NSGA2 implementation provided with Sferes (sferes/ea/nsga2.hpp) the mixed_pop, parent_pop, and child_pop methods have a const return type, but the methods themselves are not declared as constant. This is inconvenient, especially when considering that the refresh method in sferes/stat/stat.hpp declares the ea as constant (void refresh(const E& ea)), meaning these populations can not be accessed in the stat refresh method, even if we do not actually change anything about these populations.

As such, I want to propose the following change, from:

  const pop_t& mixed_pop() {
    return _mixed_pop;
  }
  const pop_t& parent_pop() {
    return _parent_pop;
  }
  const pop_t& child_pop() {
    return _child_pop;
  }

To:

  const pop_t& mixed_pop() const {
    return _mixed_pop;
  }
  const pop_t& parent_pop() const {
    return _parent_pop;
  }
  const pop_t& child_pop() const {
    return _child_pop;
  }

Update to new waf version

Right now the waf version is 1.5.14, but a newer version is out: 1.8.17.

I think it's time to update the project to the new waf version.

Hostname on travis

Apparently Travis fails because of this:
tests_ea_resume: /home/travis/build/sferes2/sferes2/sferes/misc/sys.hpp:58: std::string sferes::misc::hostname(): Assertion res == 0' failed.`

=> It seems that we cannot get the hostname. Maybe because it is more than 30 characters long? Or there is something special going on with Travis...

ea.stat() is only available in const version

Okay, this will be the last issue I will submit for the day.

Is there a reason why the ea.stat() method is only available as a const version? Currently, I am only modifying the stat object in my (hopefully) obsolete continue module, but I wondered if there was any particular reason why I shouldn't. If not, I would suggest adding a non-cont ea.stat() method, just to provide users more freedom when designing algorithms or modules.

By the way, I would be happy to fix some of these issues myself (provided that they are actually issues that need to be fixed), and do a pull request.

nn2 build fail

Any ideas why a nn2 build would fail?

Following is the relevant output.

nick@nick-VirtualBox:~/Desktop/sferes2$ ./waf build
WARNING simplejson not found some function may not work
Command-line options for module [modules/nn2] : -> no option found
Command-line options for module [modules/fastsim] : -> no option found
Command-line options for exp [exp/example] : -> OK
Waf: Entering directory /home/nick/Desktop/sferes2/build' Entering directory /home/nick/Desktop/sferes2'
Building module: modules/nn2
Entering directory `/home/nick/Desktop/sferes2/modules/'
Building module: modules/fastsim
[12/38] Compiling modules/nn2/test_nn.cpp
In file included from ../modules/nn2/nn.hpp:60:0,
from ../modules/nn2/test_nn.cpp:46:
../modules/nn2/pf.hpp:101:2: warning: #warning "No EIGEN3 -> no vectorization of pwfsum" [-Wcpp]
#warning "No EIGEN3 -> no vectorization of pwfsum"
^
In file included from ../modules/nn2/pf.hpp:42:0,
from ../modules/nn2/nn.hpp:60,
from ../modules/nn2/test_nn.cpp:46:
../modules/nn2/trait.hpp:92:13: error: ‘Eigen’ does not name a type
typedef Eigen::VectorXf vector_t;
^
../modules/nn2/trait.hpp:96:12: error: ‘vector_t’ does not name a type
static vector_t zero(size_t k) {
^
In file included from ../modules/nn2/nn.hpp:60:0,
from ../modules/nn2/test_nn.cpp:46:
../modules/nn2/pf.hpp:92:43: error: ‘vector_t’ in ‘struct nn::trait’ does not name a type
float operator() (const trait::vector_t & inputs) const {
^
../modules/nn2/pf.hpp:106:19: error: ‘vector_t’ in ‘struct nn::trait’ does not name a type
trait::vector_t _w_cache;
^
../modules/nn2/pf.hpp: In member function ‘void nn::PfWSum::init()’:
../modules/nn2/pf.hpp:88:7: error: ‘_w_cache’ was not declared in this scope
_w_cache.resize(this->_weights.size());
^
In file included from /usr/local/include/boost/graph/graph_utility.hpp:17:0,
from ../modules/nn2/nn.hpp:54,
from ../modules/nn2/test_nn.cpp:46:
../modules/nn2/pf.hpp: In member function ‘float nn::PfWSum::operator()(const int&) const’:
../modules/nn2/pf.hpp:93:21: error: request for member ‘size’ in ‘inputs’, which is of non-class type ‘const int’
assert(inputs.size() == _w_cache.size());
^
../modules/nn2/pf.hpp:93:31: error: ‘_w_cache’ was not declared in this scope
assert(inputs.size() == _w_cache.size());
^
In file included from ../modules/nn2/nn.hpp:60:0,
from ../modules/nn2/test_nn.cpp:46:
../modules/nn2/pf.hpp:96:18: error: request for member ‘size’ in ‘inputs’, which is of non-class type ‘const int’
if (inputs.size() == 0)
^
In file included from ../modules/nn2/nn.hpp:62:0,
from ../modules/nn2/test_nn.cpp:46:
../modules/nn2/neuron.hpp: In instantiation of ‘class nn::Neuron<nn::PfWSum<>, nn::AfTanh >’:
../modules/nn2/nn.hpp:99:30: required from ‘class nn::NN<nn::Neuron<nn::PfWSum<>, nn::AfTanh >, nn::Connection<> >’
../modules/nn2/test_nn.cpp:51:55: required from here
../modules/nn2/neuron.hpp:204:36: error: no type named ‘vector_t’ in ‘struct nn::trait’
typename trait<io_t>::vector_t _inputs;
^
../modules/nn2/neuron.hpp: In instantiation of ‘void nn::Neuron<Pot, Act, IO>::set_in_degree(unsigned int) [with Pot = nn::PfWSum<>; Act = nn::AfTanh; IO = float]’:
../modules/nn2/nn.hpp:559:9: required from ‘void nn::NN<N, C>::_init() [with N = nn::Neuron<nn::PfWSum<>, nn::AfTanh >; C = nn::Connection<>]’
../modules/nn2/nn.hpp:125:12: required from ‘void nn::NN<N, C>::init() [with N = nn::Neuron<nn::PfWSum<>, nn::AfTanh >; C = nn::Connection<>]’
../modules/nn2/test_nn.cpp:56:12: required from here
../modules/nn2/neuron.hpp:119:7: error: using invalid field ‘nn::Neuron<Pot, Act, IO>::_inputs’
_inputs.resize(k);
^
../modules/nn2/neuron.hpp:122:15: error: using invalid field ‘nn::Neuron<Pot, Act, IO>::_inputs’
_inputs = trait<io_t>::zero(k);
^
../modules/nn2/neuron.hpp:122:34: error: no matching function for call to ‘nn::trait::zero(unsigned int&)’
_inputs = trait<io_t>::zero(k);
^
In file included from ../modules/nn2/pf.hpp:42:0,
from ../modules/nn2/nn.hpp:60,
from ../modules/nn2/test_nn.cpp:46:
../modules/nn2/trait.hpp:93:18: note: candidate: static float nn::trait::zero()
static float zero() {
^
../modules/nn2/trait.hpp:93:18: note: candidate expects 0 arguments, 1 provided
In file included from ../modules/nn2/nn.hpp:62:0,
from ../modules/nn2/test_nn.cpp:46:
../modules/nn2/neuron.hpp: In instantiation of ‘void nn::Neuron<Pot, Act, IO>::init() [with Pot = nn::PfWSum<>; Act = nn::AfTanh; IO = float]’:
../modules/nn2/nn.hpp:572:9: required from ‘void nn::NN<N, C>::_init() [with N = nn::Neuron<nn::PfWSum<>, nn::AfTanh >; C = nn::Connection<>]’
../modules/nn2/nn.hpp:125:12: required from ‘void nn::NN<N, C>::init() [with N = nn::Neuron<nn::PfWSum<>, nn::AfTanh >; C = nn::Connection<>]’
../modules/nn2/test_nn.cpp:56:12: required from here
../modules/nn2/neuron.hpp:81:17: error: using invalid field ‘nn::Neuron<Pot, Act, IO>::_inputs’
_inputs = trait<io_t>::zero(get_in_degree());
^
../modules/nn2/neuron.hpp:81:36: error: no matching function for call to ‘nn::trait::zero(unsigned int)’
_inputs = trait<io_t>::zero(get_in_degree());
^
In file included from ../modules/nn2/pf.hpp:42:0,
from ../modules/nn2/nn.hpp:60,
from ../modules/nn2/test_nn.cpp:46:
../modules/nn2/trait.hpp:93:18: note: candidate: static float nn::trait::zero()
static float zero() {
^
../modules/nn2/trait.hpp:93:18: note: candidate expects 0 arguments, 1 provided
In file included from /usr/local/include/boost/graph/graph_utility.hpp:17:0,
from ../modules/nn2/nn.hpp:54,
from ../modules/nn2/test_nn.cpp:46:
../modules/nn2/neuron.hpp: In instantiation of ‘void nn::Neuron<Pot, Act, IO>::set_input(unsigned int, const io_t&) [with Pot = nn::PfWSum<>; Act = nn::AfTanh; IO = float; nn::Neuron<Pot, Act, IO>::io_t = float]’:
../modules/nn2/nn.hpp:498:9: required from ‘void nn::NN<N, C>::_activate(nn::NN<N, C>::vertex_desc_t) [with N = nn::Neuron<nn::PfWSum<>, nn::AfTanh >; C = nn::Connection<>; nn::NN<N, C>::vertex_desc_t = void*]’
../modules/nn2/nn.hpp:528:18: required from ‘void nn::NN<N, C>::_step(const std::vector&) [with N = nn::Neuron<nn::PfWSum<>, nn::AfTanh >; C = nn::Connection<>; typename C::io_t = float]’
../modules/nn2/nn.hpp:290:12: required from ‘void nn::NN<N, C>::step(const std::vector&) [with N = nn::Neuron<nn::PfWSum<>, nn::AfTanh >; C = nn::Connection<>; typename C::io_t = float]’
../modules/nn2/test_nn.cpp:60:16: required from here
../modules/nn2/neuron.hpp:87:16: error: using invalid field ‘nn::Neuron<Pot, Act, IO>::_inputs’
assert(i < _inputs.size());
^
In file included from ../modules/nn2/nn.hpp:62:0,
from ../modules/nn2/test_nn.cpp:46:
../modules/nn2/neuron.hpp:88:14: error: using invalid field ‘nn::Neuron<Pot, Act, IO>::_inputs’
_inputs[i] = in;
^
../modules/nn2/neuron.hpp: In instantiation of ‘nn::Neuron<Pot, Act, IO>::io_t nn::Neuron<Pot, Act, IO>::activate() [with Pot = nn::PfWSum<>; Act = nn::AfTanh; IO = float; nn::Neuron<Pot, Act, IO>::io_t = float]’:
../modules/nn2/nn.hpp:500:7: required from ‘void nn::NN<N, C>::_activate(nn::NN<N, C>::vertex_desc_t) [with N = nn::Neuron<nn::PfWSum<>, nn::AfTanh >; C = nn::Connection<>; nn::NN<N, C>::vertex_desc_t = void*]’
../modules/nn2/nn.hpp:528:18: required from ‘void nn::NN<N, C>::_step(const std::vector&) [with N = nn::Neuron<nn::PfWSum<>, nn::AfTanh >; C = nn::Connection<>; typename C::io_t = float]’
../modules/nn2/nn.hpp:290:12: required from ‘void nn::NN<N, C>::step(const std::vector&) [with N = nn::Neuron<nn::PfWSum<>, nn::AfTanh >; C = nn::Connection<>; typename C::io_t = float]’
../modules/nn2/test_nn.cpp:60:16: required from here
../modules/nn2/neuron.hpp:73:22: error: using invalid field ‘nn::Neuron<Pot, Act, IO>::_inputs’
_next_output = _af(_pf(_inputs));
^

Waf: Leaving directory `/home/nick/Desktop/sferes2/build'
Build failed
-> task in 'test_nn' failed (exit status 1):
{task 140500547413072: cxx test_nn.cpp -> test_nn.cpp.1.o}
['/usr/bin/g++', '-D_REENTRANT', '-Wall', '-fPIC', '-ftemplate-depth-1024', '-Wno-sign-compare', '-Wno-deprecated', '', '-Wno-unused', '-DSFERES_ROOT="/home/nick/Desktop/sferes2"', '', '-std=c++11', '-DMPI_ENABLED', '-DNO_PARALLEL', '-DVERSION="(const char*)\"sh: 1: git: not found\""', '-O3', '-I/home/nick/Desktop/sferes2/build/modules/nn2', '-I/home/nick/Desktop/sferes2/modules/nn2', '-I/home/nick/Desktop/sferes2/build', '-I/home/nick/Desktop/sferes2', '-I/usr/include', '../modules/nn2/test_nn.cpp', '-c', '-o', '/home/nick/Desktop/sferes2/build/modules/nn2/test_nn.cpp.1.o']
nick@nick-VirtualBox:~/Desktop/sferes2$

Feature request: print found libraries when running ./waf configure --verbose

When running ./waf configure, sferes will print which libraries and header files are being checked. e.g.:

Checking boost includes                  : 1_61 
Checking boost libs                      : ok 
Checking Intel TBB includes              : ok 
Checking for Eigen                       : ok 

I would like to get some extra information when the --verbose option is passed. Currently, passing --verbose to ./waf configure prints this:

Checking boost includes                  : 1_61 
    path : /usr/local/include 
Checking boost libs                      : ok 
    path : /usr/local/lib 
    libs : ['boost_serialization-mt', 'boost_filesystem-mt', 'boost_system-mt', 'boost_unit_test_framework-mt', 'boost_program_options-mt', 'boost_graph-mt', 'boost_thread-mt', 'boost_regex-mt'] 
Checking Intel TBB includes              : ok 
Checking for Eigen                       : ok 

I would like to know at which paths the TBB and Eigen libraries where found.

As for the problem that raised this issue, I did not think I had TBB installed on my laptop, but apparently sferes does find an implementation. Unfortunately, the implementation I have installed fails to link.

MPI_ENABLED is not defined automatically when MPI is found

When configuring a project on a machine that has both MPI and Boost installed, and both libraries are found successfully, the MPI_ENABLED flag is still not set. For example:

[jhuizing@mmmlog1 sferes2]$ ./waf configure --no-assert
WARNING simplejson not found some function may not work
Command-line options for module [modules/nn2] : OK 
Command-line options for module [modules/continue] : OK 
Command-line options for module [modules/fastsim2] : OK 
Command-line options for module [modules/randmaze] : OK 
Command-line options for module [modules/misc]     : OK 
Command-line options for exp [exp/map_elite]       :  -> OK 
Command-line options for exp [exp/example]         :  -> OK 
Command-line options for exp [exp/modularity]      :  -> OK 
Command-line options for exp [exp/cmoea]           :  -> OK 
Setting top to                           : /pfs/bh/home/jhuizing/sferes/sferes2 
Setting out to                           : /pfs/bh/home/jhuizing/sferes/sferes2/build 
Checking for 'g++' (C++ compiler)        : not found 
Checking for 'clang++' (C++ compiler)    : not found 
Checking for 'icpc' (C++ compiler)       : mpicxx 
### Checking for boost ###
Checking boost includes                  : 1_60 
Checking boost libs                      : ok 
Checking Intel TBB includes              : not found 
Checking for MPI include                 : ok 
Checking for Eigen                       : ok 
Configuring for module: [modules/nn2]
modules/nn2 -> ok
Configuring for module: [modules/continue]
modules/continue -> ok
Configuring for module: [modules/fastsim2]
Checking for SDL include                 : Not found 
modules/fastsim2 -> ok
Configuring for module: [modules/randmaze]
modules/randmaze -> ok
Configuring for module: [modules/misc]
modules/misc -> ok

--- configuration ---
compiler(s):
 * CXX: icc
boost version: 1_60
mpi: False
Compilation flags :
   CXXFLAGS : -D_REENTRANT -Wall -fPIC -ftemplate-depth-1024 -Wno-sign-compare -Wno-deprecated  -Wno-unused -DSFERES_ROOT="/pfs/bh/home/jhuizing/sferes/sferes2"  -std=c++11 -DNO_PARALLEL -DEIGEN3_ENABLED -DNDEBUG 
   LINKFLAGS: 
--- license ---
Sferes2 is distributed under the CECILL license (GPL-compatible)
Please check the accompagnying COPYING file or http://www.cecill.info/
'configure' finished successfully (1.243s)

Notice that the -DMPI_ENABLED flag is not part of the CXXFLAGS.

Looking at the code of the wscript in sferes root, I found that it fails on the following test:

    # boost mpi
    if (len(conf.env['LIB_BOOST_MPI']) != 0 and conf.env['MPI_FOUND']):
        print "MPI Enabled!"
        conf.env['MPI_ENABLED'] = True
    else:
        print "MPI Disabled! len(conf.env['LIB_BOOST_MPI'])", len(conf.env['LIB_BOOST_MPI']), "conf.env['MPI_FOUND']", conf.env['MPI_FOUND']
        conf.env['MPI_ENABLED'] = False

Which results in the following output (only the result of the print statement is shown):

MPI Disabled! len(conf.env['LIB_BOOST_MPI']) 0 conf.env['MPI_FOUND'] True

It turns out the LIB_BOOST_MPI environment property is never set. Looking at boost.py in waf_tools, shows why:

        var = kw.get('uselib_store', 'BOOST')

        self.start_msg('Checking boost includes')
        self.env['INCLUDES_%s' % var] = self.boost_get_includes(**params)
        self.env.BOOST_VERSION = self.boost_get_version(self.env['INCLUDES_%s' % var])
        self.end_msg(self.env.BOOST_VERSION)
        if Logs.verbose:
                Logs.pprint('CYAN', '   path : %s' % self.env['INCLUDES_%s' % var])

        if not params['lib']:
                return
        self.start_msg('Checking boost libs')
        suffix = params.get('static', 'ST') or ''
        path, libs = self.boost_get_libs(**params)
        self.env['%sLIBPATH_%s' % (suffix, var)] = [path]
        self.env['%sLIB_%s' % (suffix, var)] = libs

Here var is completely independent of the libraries found, meaning LIB_BOOST will be defined, but LIB_BOOST_MPI will not.

As for resolving this issue, we may be able to simply test for not conf.options.no_mpi, because conf.check_boost(lib='mpi') will halt configuration if it fails to find boost MPI. As it stands, unless conf.options.no_mpi is set, MPI is simply a requirement. (In fact, even if conf.options.no_mpi is set, sferes will still fail to configure if boost MPI is not found, but that is a different issue entirely #43).

Compilation: ../sferes/phen/parameters.hpp:57:26: error: the value of ‘Params1::parameters::max’ is not usable in a constant expression

System: Ubuntu 16.04

Configure output:

`old-ufo@oldufo-UX303UB:~/dev/fooling/sferes$ ./waf configure --no-mpi --cpp11 false --boost-libs 
 /usr/lib/x86_64-linux-gnu/
    module : [modules/nn2]
module : [modules/map_elite]
Check for program g++ or c++             : /usr/bin/g++ 
Check for program cpp                    : /usr/bin/cpp 
Check for program ar                     : /usr/bin/ar 
Check for program ranlib                 : /usr/bin/ranlib 
Checking for g++                         : ok  
boost headers                            : Version 1_58 (/usr/include) 
library boost_serialization              : ok 
library boost_filesystem                 : ok 
library boost_system                     : ok 
library boost_unit_test_framework        : ok 
library boost_program_options            : ok 
library boost_graph                      : ok 
library boost_mpi                        : ok 
library boost_python                     : ok 
library boost_thread                     : ok 
Checking for header tbb/parallel_for.h   : ok /usr/include 
Checking for library libtbb              : not found 
Checking for header tbb/parallel_for.h   : ok /usr/include 
Checking for library libtbb              : not found 
Checking for SDL (optional)              : not found 
Checking for header Eigen/Core           : ok /usr/include/eigen3 
Check for program ode-config             : not found 
Checking for ODE (optional)              : not found 
Checking for GSL (optional)              : ok 

--- configuration ---
compiler:
 * CXX: gcc
boost version: 1_58
mpi: False
Compilation flags :
 * default:
   CXXFLAGS : -D_REENTRANT -Wall -fPIC -ftemplate-depth-1024 -Wno-sign-compare -Wno-deprecated  -Wno-unused -DNO_PARALLEL -DEIGEN3_ENABLED -DSFERES_ROOT="/home/old-ufo/dev/fooling/sferes"  -DNDEBUG -O3 -ffast-math 
   LINKFLAGS: 
 * debug:
   CXXFLAGS : -D_REENTRANT -Wall -fPIC -ftemplate-depth-1024 -Wno-sign-compare -Wno-deprecated  -Wno-unused -DNO_PARALLEL -DEIGEN3_ENABLED -DSFERES_ROOT="/home/old-ufo/dev/fooling/sferes" -O1 -ggdb3 -DDBG_ENABLED 
   LINKFLAGS: 
 
--- license ---
Sferes2 is distributed under the CECILL license (GPL-compatible)
Please check the accompagnying COPYING file or http://www.cecill.info/
'configure' finished successfully (0.240s)`

Compilation output:

`	old-ufo@oldufo-UX303UB:~/dev/fooling/sferes$ ./waf build
module : [modules/nn2]
module : [modules/map_elite]
Waf: Entering directory `/home/old-ufo/dev/fooling/sferes/build'
Entering directory `/home/old-ufo/dev/fooling/sferes'
Entering directory `/home/old-ufo/dev/fooling/sferes/modules/'
Entering directory `/home/old-ufo/dev/fooling/sferes/modules/'
[18/90] cxx: modules/nn2/test_hyper_nn.cpp -> build/default/modules/nn2/test_hyper_nn_4.o
[19/90] cxx: modules/nn2/test_dnn_ff.cpp -> build/default/modules/nn2/test_dnn_ff_5.o
[22/90] cxx: modules/nn2/test_hyper_nn_anh.cpp -> build/default/modules/nn2/test_hyper_nn_anh_8.o
[27/90] cxx: tests/gen/bit_string.cpp -> build/debug/tests/gen/bit_string_2.o
In file included from ../modules/nn2/test_hyper_nn_anh.cpp:41:0:
../sferes/phen/parameters.hpp: In instantiation of ‘const float sferes::phen::Parameters<sferes::gen::EvoFloat<1, Params1>, sferes::fit::FitDummy<>, Params1>::max_p’:
../sferes/phen/parameters.hpp:61:52:   required from ‘void sferes::phen::Parameters<Gen, Fit, Params, Exact>::develop() [with Gen = sferes::gen::EvoFloat<1, Params1>; Fit = sferes::fit::FitDummy<>; Params = Params1; Exact = stc::Itself]’
../modules/nn2/gen_hyper_nn.hpp:68:11:   required from ‘void sferes::gen::HyperNn<W, Params>::init() [with W = sferes::phen::Parameters<sferes::gen::EvoFloat<1, Params1>, sferes::fit::FitDummy<>, Params1>; Params = Params1]’
../modules/nn2/test_hyper_nn_anh.cpp:209:15:   required from here
../sferes/phen/parameters.hpp:57:26: error: the value of ‘Params1::parameters::max’ is not usable in a constant expression
       SFERES_CONST float max_p = Params::parameters::max;
	                  ^
../modules/nn2/test_hyper_nn_anh.cpp:81:24: note: ‘Params1::parameters::max’ does not have integral or enumeration type
     SFERES_CONST float max = 2.0f;
	                ^
In file included from ../modules/nn2/test_dnn_ff.cpp:52:0:
../sferes/phen/parameters.hpp: In instantiation of ‘const float sferes::phen::Parameters<sferes::gen::EvoFloat<1, Params>, sferes::fit::FitDummy<>, Params>::max_p’:
../sferes/phen/parameters.hpp:61:52:   required from ‘void sferes::phen::Parameters<Gen, Fit, Params, Exact>::develop() [with Gen = sferes::gen::EvoFloat<1, Params>; Fit = sferes::fit::FitDummy<>; Params = Params; Exact = stc::Itself]’
../modules/nn2/phen_dnn.hpp:58:8:   required from ‘void sferes::phen::Dnn<Gen, Fit, Params, Exact>::develop() [with Gen = sferes::gen::DnnFF<nn::Neuron<nn::PfWSum<sferes::phen::Parameters<sferes::gen::EvoFloat<1, Params>, sferes::fit::FitDummy<>, Params> >, nn::AfTanh<sferes::phen::Parameters<sferes::gen::EvoFloat<1, Params>, sferes::fit::FitDummy<>, Params> > >, nn::Connection<sferes::phen::Parameters<sferes::gen::EvoFloat<1, Params>, sferes::fit::FitDummy<>, Params> >, Params>; Fit = sferes::fit::FitDummy<Params>; Params = Params; Exact = stc::Itself]’
../modules/nn2/test_dnn_ff.cpp:123:13:   required from here
../sferes/phen/parameters.hpp:57:26: error: the value of ‘Params::parameters::max’ is not usable in a constant expression
       SFERES_CONST float max_p = Params::parameters::max;
	                  ^
../modules/nn2/test_dnn_ff.cpp:75:24: note: ‘Params::parameters::max’ does not have integral or enumeration type
     SFERES_CONST float max = 5.0f;
	                ^
In file included from ../modules/nn2/test_hyper_nn.cpp:41:0:
../sferes/phen/parameters.hpp: In instantiation of ‘const float sferes::phen::Parameters<sferes::gen::EvoFloat<1, Params1>, sferes::fit::FitDummy<>, Params1>::max_p’:
../sferes/phen/parameters.hpp:61:52:   required from ‘void sferes::phen::Parameters<Gen, Fit, Params, Exact>::develop() [with Gen = sferes::gen::EvoFloat<1, Params1>; Fit = sferes::fit::FitDummy<>; Params = Params1; Exact = stc::Itself]’
../modules/nn2/gen_hyper_nn.hpp:68:11:   required from ‘void sferes::gen::HyperNn<W, Params>::init() [with W = sferes::phen::Parameters<sferes::gen::EvoFloat<1, Params1>, sferes::fit::FitDummy<>, Params1>; Params = Params1]’
../modules/nn2/test_hyper_nn.cpp:196:13:   required from here
../sferes/phen/parameters.hpp:57:26: error: the value of ‘Params1::parameters::max’ is not usable in a constant expression
       SFERES_CONST float max_p = Params::parameters::max;
	                  ^
../modules/nn2/test_hyper_nn.cpp:78:24: note: ‘Params1::parameters::max’ does not have integral or enumeration type
     SFERES_CONST float max = 2.0f;
	                ^
In file included from ../modules/nn2/test_hyper_nn.cpp:41:0:
../sferes/phen/parameters.hpp: In instantiation of ‘const float sferes::phen::Parameters<sferes::gen::EvoFloat<1, Params2>, sferes::fit::FitDummy<>, Params2>::max_p’:
../sferes/phen/parameters.hpp:61:52:   required from ‘void sferes::phen::Parameters<Gen, Fit, Params, Exact>::develop() [with Gen = sferes::gen::EvoFloat<1, Params2>; Fit = sferes::fit::FitDummy<>; Params = Params2; Exact = stc::Itself]’
../modules/nn2/phen_hyper_nn.hpp:121:11:   required from ‘void sferes::phen::HyperNn<Gen, Fit, Params, Exact>::develop() [with Gen = sferes::gen::HyperNn<sferes::phen::Parameters<sferes::gen::EvoFloat<1, Params2>, sferes::fit::FitDummy<>, Params2>, Params2>; Fit = sferes::fit::FitDummy<>; Params = Params2; Exact = stc::Itself]’
../modules/nn2/test_hyper_nn.cpp:235:17:   required from here
../sferes/phen/parameters.hpp:57:26: error: the value of ‘Params2::parameters::max’ is not usable in a constant expression
       SFERES_CONST float max_p = Params::parameters::max;
	                  ^
../modules/nn2/test_hyper_nn.cpp:135:24: note: ‘Params2::parameters::max’ does not have integral or enumeration type
     SFERES_CONST float max = 2.0f;
	                ^
Waf: Leaving directory `/home/old-ufo/dev/fooling/sferes/build'
Build failed:
 -> task failed (err #1): 
	{task: cxx test_hyper_nn_anh.cpp -> test_hyper_nn_anh_8.o}
 -> task failed (err #1): 
	{task: cxx test_dnn_ff.cpp -> test_dnn_ff_5.o}
 -> task failed (err #1): 
	{task: cxx test_hyper_nn.cpp -> test_hyper_nn_4.o}

`

Libboost libraries installed but not detected.

In ubuntu 14.04 LTS I have installed libboost-all-dev but I get:

$ ./waf configure
Check for program g++ or c++ : /usr/bin/g++
Check for program cpp : /usr/bin/cpp
Check for program ar : /usr/bin/ar
Check for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
boost headers : Version 1_54 (/usr/include)
library boost_serialization : not found
library boost_filesystem : not found
library boost_system : not found
library boost_unit_test_framework : not found
library boost_program_options : not found
library boost_graph : not found
library boost_mpi : not found
library boost_python : not found
library boost_thread : not found
Checking for header tbb/parallel_for.h : ok /usr/include
Checking for library libtbb : ok /usr/lib
Checking for header tbb/parallel_for.h : ok /usr/include
Checking for library libtbb : ok /usr/lib
Checking for header mpi.h : ok /usr/include/mpi
Checking for SDL (optional) : ok
Checking for header Eigen/Core : ok /usr/include/eigen3
Check for program ode-config : /usr/bin/ode-config
Checking for ODE (optional) : ok
Checking for GSL (optional) : ok

--- configuration ---
compiler:

  • CXX: gcc
    boost version: 1_54
    mpi: False
    Compilation flags :
  • default:
    CXXFLAGS : -D_REENTRANT -Wall -fPIC -ftemplate-depth-1024 -Wno-sign-compare -Wno-deprecated -Wno-unused -DUSE_SDL -DEIGEN3_ENABLED -DSFERES_ROOT="/home/pablo/Dev/sferes2" -DNDEBUG -O3 -ffast-math
    LINKFLAGS:
  • debug:
    CXXFLAGS : -D_REENTRANT -Wall -fPIC -ftemplate-depth-1024 -Wno-sign-compare -Wno-deprecated -Wno-unused -DUSE_SDL -DEIGEN3_ENABLED -DSFERES_ROOT="/home/pablo/Dev/sferes2" -O1 -ggdb3 -DDBG_ENABLED
    LINKFLAGS:

--- license ---
Sferes2 is distributed under the CECILL license (GPL-compatible)
Please check the accompagnying COPYING file or http://www.cecill.info/
'configure' finished successfully (0.402s)

Some people say that Boost is broken and it is not possible to check Boost versions. Can we avoid it?
conf.check_boost(lib='serialization filesystem system unit_test_framework program_options graph mpi python thread', min_version='1.35')

Default values for parameters

Changing the way the parameters work should allow us to have default values. Principle:

#Include <iostream>

#define SFERES_PARAM(T, Name, Value) static constexpr T Name() { return Value; }
struct ParamDefault 
{
  SFERES_PARAM(float, eps, 0.5);
};

struct Param : public ParamDefault
{
  SFERES_PARAM(float, eps, 0.6f);
};

int main()
{
  std::cout << Param::eps() << std::endl;
}

Using Additional Modules

I'm sure there must be instructions I'm overlooking here, but how do you use the additional sferes2 modules, such as nn2 and fastsim?

I'm trying to just forge through as best as I can, but I thought I ought to ask, as it seems there may be a missing wiki note somewhere.

Feature request: more control for writing gen files

These suggestions are not essential, but I have found them useful in the past.

  1. Dump gen files at different times than at fixed intervals. For example, I would like to be able to not dump the first gen file (because gen_0 is not that useful, yet can take up a lot of space), or to be able to dump checkpoints based on wall-clock time rather than generation interval (so I don't have to tune checkpointing based on the speed of the machine I am on).
  2. Write gen files with a different name from gen_[generation]. This is mostly so I can distinguish between files I created just for checkpointing (which can be deleted at the end of a run), and files used for analysis (which certainly should not be deleted).
  3. Call arbitrary code after a gen file is written. This functionality has mostly been important on the OSG cluster, a heterogenous cluster without a shared filesystem. On OSG, every file you write has to be transferred manually to your local account, because all files written locally are lost if the job gets preempted (which happens a lot). Another use-case is that I like to clean-up checkpoints during a run, just to minimize disk usage (we, as a lab, have lots of trouble remaining within our allocated quota).
  4. A quick way to test gen file integrity. Since writing to disk is often one of the slower processes, preemption can quite often halt your program in the middle of writing a checkpoint, leaving a corrupt gen file in its wake. This makes it hard to continue automatically, since continue scripts will usually just load the most recent gen file available.

For points 1 to 3, I would suggest adding (yet) another object to the Ea class, which would be something like a gen-file manager. The manager would decide when to write a gen file, what to name the gen file, and when to call additional code.

For point 4, I solved that by simply writing a string of special characters to the end of every gen file. To be precise, I added the following code:

        //If our archive is binary, explicitly set these characters at the end of the file
        //so we can check (or at least be reasonably certain) that the archive was written
        //successfully and entirely
        char end[25] = "\n</boost_serialization>\n";
        boost::serialization::binary_object object(end, 25);
        oa << object;

You can then read the last 25 bytes of a gen file, and check that it matches this particular magic string. This method is technically not fool proof, because that string of characters may accidentally be written somewhere in the middle of a file right at the time that a job gets preempted, but I think the chances of that happening are so low (about the chance of guessing a 25 character password), that I think it is good enough.

P.S. While it may not seem like it, given the number of issues I am creating, I think Sferes is a very nice and robust framework, and I thank all contributors for creating and maintaining it.

Configuring experiments improvement

At the moment, when configuring experiments (see here), if an experiment has a required component that is not found and halts the execution (with conf.fatal), we catch it and the execution continues. The same applies if the wscript file of the experiment has a syntax error.. We should make this part better..

Excessive memory consumption when using eval::Parallel

Hi all,
I am using sferes (via modular_QD) with dart to simulate the Baxter robot (including meshes).
I am running into a serious problem as the memory usage of my program keeps growing until reaching 100% of the 64GB, and finally being killed by the OS.
I have checked and I have no memory leak (I actually fixed some of them in Dart and Assimp).

It look like even if I release the robot used in the evaluation, the corresponding memory is not released. More precisely, I think it comes from the allocation done by TBB:
When compiled with eval::Parallel after 350 generations, it uses 2GB of ram (3.3%) and keeps growing.
When compile with eval::Eval after 350 generations, it uses only 50MB of ram (less than 0.1%) and remains constant.
This is a difference of several orders of magnitude.

I am reading articles about scalable memory allocation to try to find a nice solution, but any suggestion will be appreciated.

Building with --no-mpi still requires boost mpi

On a system where boost mpi is not installed, configuring sferes with the option --no-mpi fails with the following message:

Checking boost libs                      : lib mpi not found in lib
(complete log in /Users/joost/Documents/sferes/sferes2/build/config.log)

I have currently resolved the issue by changing the following code in the wscript file in the sferes root folder:

Original code:
conf.check_boost(lib='serialization filesystem system unit_test_framework program_options graph mpi thread regex', min_version='1.35')

My 'fix':

    if conf.options.no_mpi:
        conf.check_boost(lib='serialization filesystem system unit_test_framework program_options graph thread regex', min_version='1.35')
    else:
        conf.check_boost(lib='serialization filesystem system unit_test_framework program_options graph mpi thread regex', min_version='1.35')

However, I am not sure if this is the most elegant way of doing things, especially because the --no-mpi option is part of the mpi.py modules, and not part of the basic wscript.

Installation problems

I am trying to install Sferes2 + collectball. My Ubuntu version is 14.04, running on VirtualBox.
Getting an error as in this attached document: ErrorMessage_sferes2.docx

Terminal input is precisely the following (installing from scratch):
`sudo apt-get install build-essential
sudo apt-get install libboost-dev libboost-test-dev libboost-filesystem-dev libboost-program-options-dev libboost-graph-parallel-dev python g++ libtbb-dev libeigen3-dev python-simplejson libgoogle-perftools-dev

mkdir git
cd git
git clone https://github.com/sferes2/sferes2
git clone https://github.com/sferes2/fastsim
git clone https://github.com/sferes2/nn2
git clone https://github.com/jbmouret/libfastsim
git clone https://github.com/doncieux/collectball

cd ~/git/libfastsim
./waf configure
./waf build

cd ~/git/sferes2/modules
ln -s ~/git/fastsim
ln -s ~/git/nn2
cd ~/git/sferes2/exp
ln -s ~/git/collectball
cd ~/git/sferes2/
echo fastsim >> modules.conf
echo nn2 >> modules.conf

cd ~/git/sferes2
./waf configure
./waf build --exp=collectball
`

When I replace the ./waf configure in the end with ./waf configuration –boost-includes=BOOSTINCLUDES –boost-libs=BOOSTLIBS, I get the this error:
screenshot from 2016-05-19 17 19 07

And declaring C++11 flags during the configuration gives the following errors:
2
3

Feature request: automatic detection of libraries loaded through modules

Most clusters I know of use the Lmod package to allow user to load different libraries and different versions of those libraries. However, while Sferes is designed to run on clusters and other parallel environments, it is generally unable to find libraries loaded through modules, and users will have to specify include paths and library paths manually.

While a system that can detect any module on any cluster may be difficult to create, I think we can go a long way by simply checking the CPPFLAGS and LD_LIBRARY_PATH environment variables, both of which are set by Lmod on Mount Moran (the University of Wyoming cluster).

Finding 'MPI' is a little bit harder (you are supposed to rely on the mpicxx wrapper compiler to handle these includes for you), but by checking the environment variables for MPI_ROOT and I_MPI_ROOT, we can at least provide some 'best effort' detection.

I have already implement this kind of detection for boost.py, mpi.py, eigen.py, and tbb.py, in case you are interested.

For cmeas.cpp: clang warns that abs is given long but has parameter int.

When compiling spheres on OS X, clang prints the following warning when compiling cmeas:

../sferes/ea/cmaes.cpp:2273:29: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
    inseed = (long unsigned)abs((long)(100*time(NULL)+clock()));
                           ^
../sferes/ea/cmaes.cpp:2273:29: note: use function 'std::abs' instead
    inseed = (long unsigned)abs((long)(100*time(NULL)+clock()));
                            ^~~
                            std::abs
../sferes/ea/cmaes.cpp:2273:29: note: include the header <cstdlib> or explicitly provide a declaration for 'std::abs'
../sferes/ea/cmaes.cpp:2659:29: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
    t->seed = (unsigned int)abs((long)(100*time(NULL)+clock()));
                            ^
../sferes/ea/cmaes.cpp:2659:29: note: use function 'std::abs' instead
    t->seed = (unsigned int)abs((long)(100*time(NULL)+clock()));
                            ^~~
                            std::abs
../sferes/ea/cmaes.cpp:2659:29: note: include the header <cstdlib> or explicitly provide a declaration for 'std::abs'
2 warnings generated.

I'm compiling with the the following version of clang:
Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

This issue is not sferes breaking, but it does mean the wrong implementation of abs is used.

Replacing abs by std::abs, as suggested by clang, does not work because std is not defined within this scope:

../sferes/ea/cmaes.cpp:2273:29: error: use of undeclared identifier 'std'
    inseed = (long unsigned)std::abs((long)(100*time(NULL)+clock()));

I am suggesting replacing the two instances with:

inseed = (long unsigned)labs((long)(100*time(NULL)+clock()));

Explicitly calling the abs value function for long integers that is defined in stdlib.h.

It cannot be built without GIT value VERSION

It cannot be built without GIT cloning.
If you the the zip file it fails when seeing the token VERSION when compiling.
Maybe here...
v = commands.getoutput('git rev-parse HEAD')
bld.env_of_name('default')['CXXFLAGS'].append("-DVERSION="(const char_)\""+v+"\""")
bld.env_of_name('debug')['CXXFLAGS'].append("-DVERSION="(const char_)\""+v+"\""")

Issue configuring libboost

I have an issue configuring the libboost directory
I've created a link like #20 and when I run the following it seems to work.
However when I look at the configuration again it hows not found

~/Documents/innovation-engine/sferes ./waf configure --boost-libs=/usr/lib64
module : [modules/nn2]
module : [modules/map_elite]
Check for program g++ or c++             : /usr/bin/g++ 
Check for program cpp                    : /usr/bin/cpp 
Check for program ar                     : /usr/bin/ar 
Check for program ranlib                 : /usr/bin/ranlib 
Checking for g++                         : ok  
boost headers                            : Version 1_58 (/usr/include) 
library boost_serialization: ok 
library boost_filesystem                 : ok 
library boost_system                     : ok 
library boost_unit_test_framework        : ok 
library boost_program_options            : ok 
library boost_graph                      : ok 
library boost_mpi                        : ok 
library boost_python                     : ok 
library boost_thread                     : ok 
Checking for header tbb/parallel_for.h   : ok /usr/include 
Checking for library libtbb              : not found 
Checking for header tbb/parallel_for.h   : ok /usr/include 
Checking for library libtbb              : not found 
Checking for header mpi.h                : ok /usr/include/mpi 
Checking for SDL (optional)              : not found 
Checking for header Eigen/Core           : ok /usr/include/eigen3 
Check for program ode-config             : not found 
Checking for ODE (optional)              : not found 
Checking for GSL (optional)              : not found 

--- configuration ---
compiler:
 * CXX: gcc
boost version: 1_58
mpi: True
Compilation flags :
 * default:
   CXXFLAGS : -D_REENTRANT -Wall -fPIC -ftemplate-depth-1024 -Wno-sign-compare -Wno-deprecated  -Wno-unused -DMPI_ENABLED -DNO_PARALLEL -DEIGEN3_ENABLED -DSFERES_ROOT="/home/eric/Documents/innovation-engine/sferes"  -DNDEBUG -O3 -ffast-math 
   LINKFLAGS: 
 * debug:
   CXXFLAGS : -D_REENTRANT -Wall -fPIC -ftemplate-depth-1024 -Wno-sign-compare -Wno-deprecated  -Wno-unused -DMPI_ENABLED -DNO_PARALLEL -DEIGEN3_ENABLED -DSFERES_ROOT="/home/eric/Documents/innovation-engine/sferes" -O1 -ggdb3 -DDBG_ENABLED 
   LINKFLAGS: 
 
--- license ---
Sferes2 is distributed under the CECILL license (GPL-compatible)
Please check the accompagnying COPYING file or http://www.cecill.info/
'configure' finished successfully (0.385s)
~/Documents/innovation-engine/sferes ./waf configure              
module : [modules/nn2]
module : [modules/map_elite]
Check for program g++ or c++             : /usr/bin/g++ 
Check for program cpp                    : /usr/bin/cpp 
Check for program ar                     : /usr/bin/ar 
Check for program ranlib                 : /usr/bin/ranlib 
Checking for g++                         : ok  
boost headers                            : Version 1_58 (/usr/include) 
library boost_serialization              : not found 
library boost_filesystem                 : not found 
library boost_system                     : not found 
library boost_unit_test_framework        : not found 
library boost_program_options            : not found 
library boost_graph                      : not found 
library boost_mpi                        : not found 
library boost_python                     : not found 
library boost_thread                     : not found 
Checking for header tbb/parallel_for.h   : ok /usr/include 
Checking for library libtbb              : not found 
Checking for header tbb/parallel_for.h   : ok /usr/include 
Checking for library libtbb              : not found 
Checking for header mpi.h                : ok /usr/include/mpi 
Checking for SDL (optional)              : not found 
Checking for header Eigen/Core           : ok /usr/include/eigen3 
Check for program ode-config             : not found 
Checking for ODE (optional)              : not found 
Checking for GSL (optional)              : not found 

--- configuration ---
compiler:
 * CXX: gcc
boost version: 1_58
mpi: False
Compilation flags :
 * default:
   CXXFLAGS : -D_REENTRANT -Wall -fPIC -ftemplate-depth-1024 -Wno-sign-compare -Wno-deprecated  -Wno-unused -DNO_PARALLEL -DEIGEN3_ENABLED -DSFERES_ROOT="/home/eric/Documents/innovation-engine/sferes"  -DNDEBUG -O3 -ffast-math 
   LINKFLAGS: 
 * debug:
   CXXFLAGS : -D_REENTRANT -Wall -fPIC -ftemplate-depth-1024 -Wno-sign-compare -Wno-deprecated  -Wno-unused -DNO_PARALLEL -DEIGEN3_ENABLED -DSFERES_ROOT="/home/eric/Documents/innovation-engine/sferes" -O1 -ggdb3 -DDBG_ENABLED 
   LINKFLAGS: 
 
--- license ---
Sferes2 is distributed under the CECILL license (GPL-compatible)
Please check the accompagnying COPYING file or http://www.cecill.info/
'configure' finished successfully (0.284s)

And when I run ./waf build right after setting the libboost directory I get all kinds of errors

~/Documents/innovation-engine/sferes   master  ./waf build
module : [modules/nn2]
module : [modules/map_elite]
Waf: Entering directory `/home/eric/Documents/innovation-engine/sferes/build'
Entering directory `/home/eric/Documents/innovation-engine/sferes'
Entering directory `/home/eric/Documents/innovation-engine/sferes/modules/'
Entering directory `/home/eric/Documents/innovation-engine/sferes/modules/'
[  3/106] cxx: examples/ex_ea.cpp -> build/default/examples/ex_ea_1.o
[  4/106] cxx: examples/ex_ea_mpi.cpp -> build/default/examples/ex_ea_mpi_2.o
In file included from ../examples/ex_ea.cpp:4:0:
../sferes/ea/rank_simple.hpp: In instantiation of ‘const unsigned int sferes::ea::RankSimple<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, sferes::eval::Eval<Params>, boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >, sferes::modif::Dummy<>, Params>::nb_keep’:
../sferes/ea/rank_simple.hpp:67:27:   required from ‘void sferes::ea::RankSimple<Phen, Eval, Stat, FitModifier, Params, Exact>::epoch() [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Eval = sferes::eval::Eval<Params>; Stat = boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >; FitModifier = sferes::modif::Dummy<>; Params = Params; Exact = stc::Itself]’
../sferes/ea/ea.hpp:173:9:   required from ‘void sferes::ea::Ea<Phen, Eval, Stat, FitModifier, Params, Exact>::epoch() [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Eval = sferes::eval::Eval<Params>; Stat = boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >; FitModifier = sferes::modif::Dummy<>; Params = Params; Exact = sferes::ea::RankSimple<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, sferes::eval::Eval<Params>, boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >, sferes::modif::Dummy<>, Params>]’
../sferes/ea/ea.hpp:161:16:   required from ‘void sferes::ea::Ea<Phen, Eval, Stat, FitModifier, Params, Exact>::run() [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Eval = sferes::eval::Eval<Params>; Stat = boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >; FitModifier = sferes::modif::Dummy<>; Params = Params; Exact = sferes::ea::RankSimple<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, sferes::eval::Eval<Params>, boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >, sferes::modif::Dummy<>, Params>]’
../sferes/run.hpp:127:7:   required from ‘void sferes::run_ea(int, char**, Ea&, const boost::program_options::options_description&, bool) [with Ea = sferes::ea::RankSimple<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, sferes::eval::Eval<Params>, boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >, sferes::modif::Dummy<>, Params>]’
../examples/ex_ea.cpp:110:24:   required from here
../sferes/ea/rank_simple.hpp:51:29: error: the value of ‘Params::pop::keep_rate’ is not usable in a constant expression
       SFERES_CONST unsigned nb_keep = (unsigned)(Params::pop::keep_rate * Params::pop::size)
                             ^
../examples/ex_ea.cpp:44:24: note: ‘Params::pop::keep_rate’ does not have integral or enumeration type
     SFERES_CONST float keep_rate = 0.6f;
                        ^
In file included from ../examples/ex_ea.cpp:2:0:
../sferes/phen/parameters.hpp: In instantiation of ‘const float sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>::max_p’:
../sferes/phen/parameters.hpp:61:52:   required from ‘void sferes::phen::Parameters<Gen, Fit, Params, Exact>::develop() [with Gen = sferes::gen::EvoFloat<10, Params>; Fit = FitTest<Params>; Params = Params; Exact = stc::Itself]’
../sferes/eval/eval.hpp:57:11:   required from ‘void sferes::eval::Eval<Params, Exact>::eval(std::vector<boost::shared_ptr<Y> >&, size_t, size_t) [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Params = Params; Exact = stc::Itself; size_t = long unsigned int]’
../sferes/ea/rank_simple.hpp:59:9:   required from ‘void sferes::ea::RankSimple<Phen, Eval, Stat, FitModifier, Params, Exact>::random_pop() [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Eval = sferes::eval::Eval<Params>; Stat = boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >; FitModifier = sferes::modif::Dummy<>; Params = Params; Exact = stc::Itself]’
../sferes/ea/ea.hpp:169:9:   required from ‘void sferes::ea::Ea<Phen, Eval, Stat, FitModifier, Params, Exact>::random_pop() [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Eval = sferes::eval::Eval<Params>; Stat = boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >; FitModifier = sferes::modif::Dummy<>; Params = Params; Exact = sferes::ea::RankSimple<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, sferes::eval::Eval<Params>, boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >, sferes::modif::Dummy<>, Params>]’
../sferes/ea/ea.hpp:159:19:   required from ‘void sferes::ea::Ea<Phen, Eval, Stat, FitModifier, Params, Exact>::run() [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Eval = sferes::eval::Eval<Params>; Stat = boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >; FitModifier = sferes::modif::Dummy<>; Params = Params; Exact = sferes::ea::RankSimple<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, sferes::eval::Eval<Params>, boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >, sferes::modif::Dummy<>, Params>]’
../sferes/run.hpp:127:7:   required from ‘void sferes::run_ea(int, char**, Ea&, const boost::program_options::options_description&, bool) [with Ea = sferes::ea::RankSimple<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, sferes::eval::Eval<Params>, boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >, sferes::modif::Dummy<>, Params>]’
../examples/ex_ea.cpp:110:24:   required from here
../sferes/phen/parameters.hpp:57:26: error: the value of ‘Params::parameters::max’ is not usable in a constant expression
       SFERES_CONST float max_p = Params::parameters::max;
                          ^
../examples/ex_ea.cpp:50:24: note: ‘Params::parameters::max’ does not have integral or enumeration type
     SFERES_CONST float max = 10.0f;
                        ^
In file included from ../examples/ex_ea_mpi.cpp:6:0:
../sferes/ea/rank_simple.hpp: In instantiation of ‘const unsigned int sferes::ea::RankSimple<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, sferes::eval::Mpi<Params>, boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >, sferes::modif::Dummy<>, Params>::nb_keep’:
../sferes/ea/rank_simple.hpp:67:27:   required from ‘void sferes::ea::RankSimple<Phen, Eval, Stat, FitModifier, Params, Exact>::epoch() [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Eval = sferes::eval::Mpi<Params>; Stat = boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >; FitModifier = sferes::modif::Dummy<>; Params = Params; Exact = stc::Itself]’
../sferes/ea/ea.hpp:173:9:   required from ‘void sferes::ea::Ea<Phen, Eval, Stat, FitModifier, Params, Exact>::epoch() [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Eval = sferes::eval::Mpi<Params>; Stat = boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >; FitModifier = sferes::modif::Dummy<>; Params = Params; Exact = sferes::ea::RankSimple<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, sferes::eval::Mpi<Params>, boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >, sferes::modif::Dummy<>, Params>]’
../sferes/ea/ea.hpp:161:16:   required from ‘void sferes::ea::Ea<Phen, Eval, Stat, FitModifier, Params, Exact>::run() [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Eval = sferes::eval::Mpi<Params>; Stat = boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >; FitModifier = sferes::modif::Dummy<>; Params = Params; Exact = sferes::ea::RankSimple<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, sferes::eval::Mpi<Params>, boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >, sferes::modif::Dummy<>, Params>]’
../sferes/run.hpp:127:7:   required from ‘void sferes::run_ea(int, char**, Ea&, const boost::program_options::options_description&, bool) [with Ea = sferes::ea::RankSimple<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, sferes::eval::Mpi<Params>, boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >, sferes::modif::Dummy<>, Params>]’
../examples/ex_ea_mpi.cpp:72:24:   required from here
../sferes/ea/rank_simple.hpp:51:29: error: the value of ‘Params::pop::keep_rate’ is not usable in a constant expression
       SFERES_CONST unsigned nb_keep = (unsigned)(Params::pop::keep_rate * Params::pop::size)
                             ^
../examples/ex_ea_mpi.cpp:33:24: note: ‘Params::pop::keep_rate’ does not have integral or enumeration type
     SFERES_CONST float keep_rate = 0.6f;
                        ^
In file included from ../examples/ex_ea_mpi.cpp:4:0:
../sferes/phen/parameters.hpp: In instantiation of ‘const float sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>::max_p’:
../sferes/phen/parameters.hpp:61:52:   required from ‘void sferes::phen::Parameters<Gen, Fit, Params, Exact>::develop() [with Gen = sferes::gen::EvoFloat<10, Params>; Fit = FitTest<Params>; Params = Params; Exact = stc::Itself]’
../sferes/eval/mpi.hpp:151:13:   required from ‘void sferes::eval::Mpi<Params, Exact>::_slave_loop() [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Params = Params; Exact = stc::Itself]’
../sferes/eval/mpi.hpp:74:28:   required from ‘void sferes::eval::Mpi<Params, Exact>::eval(std::vector<boost::shared_ptr<Y> >&, size_t, size_t) [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Params = Params; Exact = stc::Itself; size_t = long unsigned int]’
../sferes/ea/rank_simple.hpp:59:9:   required from ‘void sferes::ea::RankSimple<Phen, Eval, Stat, FitModifier, Params, Exact>::random_pop() [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Eval = sferes::eval::Mpi<Params>; Stat = boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >; FitModifier = sferes::modif::Dummy<>; Params = Params; Exact = stc::Itself]’
../sferes/ea/ea.hpp:169:9:   required from ‘void sferes::ea::Ea<Phen, Eval, Stat, FitModifier, Params, Exact>::random_pop() [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Eval = sferes::eval::Mpi<Params>; Stat = boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >; FitModifier = sferes::modif::Dummy<>; Params = Params; Exact = sferes::ea::RankSimple<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, sferes::eval::Mpi<Params>, boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >, sferes::modif::Dummy<>, Params>]’
../sferes/ea/ea.hpp:159:19:   required from ‘void sferes::ea::Ea<Phen, Eval, Stat, FitModifier, Params, Exact>::run() [with Phen = sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>; Eval = sferes::eval::Mpi<Params>; Stat = boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >; FitModifier = sferes::modif::Dummy<>; Params = Params; Exact = sferes::ea::RankSimple<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, sferes::eval::Mpi<Params>, boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >, sferes::modif::Dummy<>, Params>]’
../sferes/run.hpp:127:7:   required from ‘void sferes::run_ea(int, char**, Ea&, const boost::program_options::options_description&, bool) [with Ea = sferes::ea::RankSimple<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, sferes::eval::Mpi<Params>, boost::fusion::vector<sferes::stat::BestFit<sferes::phen::Parameters<sferes::gen::EvoFloat<10, Params>, FitTest<Params>, Params>, Params>, sferes::stat::MeanFit<Params> >, sferes::modif::Dummy<>, Params>]’
../examples/ex_ea_mpi.cpp:72:24:   required from here
../sferes/phen/parameters.hpp:57:26: error: the value of ‘Params::parameters::max’ is not usable in a constant expression
       SFERES_CONST float max_p = Params::parameters::max;
                          ^
../examples/ex_ea_mpi.cpp:37:24: note: ‘Params::parameters::max’ does not have integral or enumeration type
     SFERES_CONST float max = 10.0f;
                        ^
Waf: Leaving directory `/home/eric/Documents/innovation-engine/sferes/build'
Build failed:
 -> task failed (err #1): 
	{task: cxx ex_ea.cpp -> ex_ea_1.o}
 -> task failed (err #1): 
	{task: cxx ex_ea_mpi.cpp -> ex_ea_mpi_2.o}


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.