Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

to_string test fails #44

Closed
mkatliar opened this issue Jun 6, 2019 · 6 comments
Closed

to_string test fails #44

mkatliar opened this issue Jun 6, 2019 · 6 comments

Comments

@mkatliar
Copy link

mkatliar commented Jun 6, 2019

I get the following output from make check:

[  3%] Built target introduction
Begin test group introduction
exp_2               OK
exp_2_cppad         OK
exp_2_for0          OK
exp_2_for1          OK
exp_2_for2          OK
exp_2_rev1          OK
exp_2_rev2          OK
exp_eps             OK
exp_eps_cppad       OK
exp_eps_for0        OK
exp_eps_for1        OK
exp_eps_for2        OK
exp_eps_rev1        OK
exp_eps_rev2        OK
memory_leak         OK
All 15 tests passed.
End test group introduction
[  3%] Built target check_introduction
[  5%] Built target speed_example
[  7%] Built target speed_src
det_of_minor        OK
det_by_minor        OK
det_by_lu           OK
elapsed_seconds     OK
mat_sum_sq          OK
ode_evaluate        OK
sparse_hes_fun      OK
sparse_jac_fun      OK
speed_test          OK
time_test           OK
Check above to see if all 10 tests passed.
possible exceptions are: elapsed_seconds, speed_test, time_test

[  7%] Built target check_speed_example
[  9%] Built target speed_cppad
cppad_det_lu_ok =  true
cppad_det_minor_ok =  true
cppad_mat_mul_ok =  true
cppad_ode_ok =  true
cppad_poly_ok =  true
cppad_sparse_hessian_ok =  true
cppad_sparse_jacobian_ok =  true
All 7 correctness tests passed.
memory allocated at end of last cppad speed test = 18805
speed main: OK
[  9%] Built target check_speed_cppad
[ 12%] Built target speed_double
double_det_lu_ok =  true
double_det_minor_ok =  true
double_mat_mul_ok =  true
double_ode_ok =  true
double_poly_ok =  true
double_sparse_hessian_ok =  true
double_sparse_jacobian_ok =  true
All 7 correctness tests passed.
speed main: OK
[ 12%] Built target check_speed_double
[ 12%] Built target check_speed
[ 18%] Built target example_utility
Begin test group example/utility
CheckNumericType    OK
CheckSimpleVector   OK
CppAD_vector        OK
ErrorHandler        OK
index_sort          OK
LuFactor            OK
LuInvert            OK
LuSolve             OK
nan                 OK
Near_Equal          OK
OdeErrControl       OK
OdeErrMaxabs        OK
OdeGearControl      OK
OdeGear             OK
RombergMul          OK
RombergOne          OK
runge_45_1          OK
set_union           OK
SimpleVector        OK
thread_alloc        OK
sparse_rc           OK
sparse_rcv          OK
to_string           Error
vectorBool          OK
memory_leak         OK
1 tests failed.
End test group example/utility
make[3]: *** [example/utility/CMakeFiles/check_example_utility.dir/build.make:57: example/utility/CMakeFiles/check_example_utility] Error 1
make[2]: *** [CMakeFiles/Makefile2:1327: example/utility/CMakeFiles/check_example_utility.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/check.dir/rule] Error 2
make: *** [Makefile:164: check] Error 2

CMAKE_BUILD_TYPE is "Release", compiler version is "g++ (Ubuntu 8.3.0-6ubuntu1) 8.3.0".

@bradbell
Copy link
Contributor

bradbell commented Jun 6, 2019

Using the following system:
cppad.git>lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
cppad.git>g++ --version
g++ (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0

I also got an error in the to_string test.
Starting in the top soruce directory and using the commands:
rm -rf build
mkdir build
cd build
cmake -D cppad_debug_which=debug_none ..
make check_example_utility

When I changed from debug_none to debug_all, I did not get the errror.

@bradbell
Copy link
Contributor

bradbell commented Jun 6, 2019

If I insert the following print
std::cout << "max = " << max << ", check = " << check << "\n";
before line 54 in the file example/utility/to_string.cpp; just before
ok &= max == check;
The test passes. Do you get the same result ?

@bradbell
Copy link
Contributor

bradbell commented Jun 9, 2019

I have submitted a Ubuntu g++ but report for this issue; see
https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1832132

@bradbell
Copy link
Contributor

bradbell commented Dec 4, 2020

I think this is a gcc problem because it reproduces on Fedora 33 with
g++ (GCC) 10.2.1 20201125 (Red Hat 10.2.1-9)

In addition, the only compiler flag that is necessary to demonstrate the bug is '-O3' (on my Fedora 33 system). Any other level of optimization passes the test.

@bradbell
Copy link
Contributor

bradbell commented Dec 5, 2020

It turns out it was an error in my test; see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98151

I have made the corresponding fix to the test; see
9c2e69f

@bradbell
Copy link
Contributor

bradbell commented Jan 3, 2021

@mkatliar Please close this issue if the current version works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants