Compilando boost::math's Performance Test Application

Has anyone successfully compiled the performance test application for boost::math library? link:

I tried compiling by running b2 in the directory and there were lots of errors (over 222000 lines).

First few lines of errors:

../test/erf_data.ipp:6:74: error: wrong number of template arguments (1, should be 2)
In file included from ../../../boost/math/tools/rational.hpp:13:0,
                 from ../../../boost/math/special_functions/log1p.hpp:18,
                 from ../../../boost/math/special_functions/gamma.hpp:35,
                 from test_erf.cpp:9:
../../../boost/array.hpp:60:11: error: provided for ‘template<class T, long unsigned int N> class boost::array’
In file included from test_erf.cpp:13:0:
../test/erf_data.ipp:6:80: error: template argument 1 is invalid
../test/erf_data.ipp:6:91: error: invalid type in declaration before ‘=’ token
../test/erf_data.ipp:7:38: error: ‘SC_’ was not declared in this scope
../test/erf_data.ipp:7:88: error: ‘SC_’ was not declared in this scope
In file included from test_erf.cpp:13:0:
../test/erf_data.ipp:7:136: error: ‘SC_’ was not declared in this scope

preguntado el 31 de julio de 12 a las 15:07

You could at least provide the errors.. -

@StackUnderflow But it is over 200000 lines. -

What about providing the first 10-20 lines of errors? -

@Deqing Done. Anyone intending to answer this will need to try compiling it. The error messages I have are probably not useful at all. -

If I answered 'probably' I should get the bounty, but I'll be down voted... (>_<) -

1 Respuestas

Alright, I got it to compile and link properly but it was not with b2. I know the OP asked for b2 but im not familiar with it so i am providing an alternative. This solution assumes you have Cmake installed. (easy to do, just ask dr google.)

If you go to the math tests location:


and you add a file called:


with the following Contents:

cmake_minimum_required(VERSION 2.8)
find_package(Boost COMPONENTS  REQUIRED)

add_executable(main main.cpp test_reference.cpp)
target_link_libraries (main ${Boost_LIBRARIES} boost_regex)

Then you make a folder called build:

mkdir build

And build it.

cd build
cmake ..

Doing this got me successful compilation and building. I get a program called main out of it.

Espero que esto ayude.

Respondido 06 ago 12, 03:08

i can get cmake .. to run, but what is build? which package does it come from? - ggg

build is part of the c++ compiler, what operating system are you developing on? linux? So typing build doesn't work? Maybe that is why your original code isn't working, maybe you don't have a compiler? - Fantástico señor Fox

Ok, so in the build file, after you run "cmake .." inside build, are some files created including a MakeFile? - Fantástico señor Fox

@ggg OH OH OH, i am very sorry, that should be make not build, dam i am an idiot, changing the answer now. - Fantástico señor Fox

tengo esto /usr/bin/ld: cannot find -lboost_regex - ggg

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.