uwplse / herbgrind

A Valgrind tool for Herbie
GNU General Public License v3.0
90 stars 7 forks source link

COmpilation error due to C99 support, on Ubuntu 2018.04 #54

Closed noureddine-as closed 4 years ago

noureddine-as commented 4 years ago

I get an Valgrind relies on a C compiler supporting C99 error when I launch make. I tried to play around with the parametrs passed to the ./configure script that builds valgrind, but I didn't succeed to build it. Any ideas ?

make
rm -r -f valgrind/herbgrind/*
mkdir -p valgrind/herbgrind
cp -r src/* valgrind/herbgrind/
cd valgrind && ./autogen.sh
running: aclocal
running: autoheader
running: automake -a
running: autoconf
cd valgrind && \
        CFLAGS="-fno-stack-protector" \
        ./configure --prefix=/path-here/herbgrind/valgrind/herbgrind-install \
                    --enable-only64bit \
                    --build=amd64-linux
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether ln -s works... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for ranlib... ranlib
checking for gcc-ranlib... /usr/bin/gcc-ranlib
checking for a sed that does not truncate output... /bin/sed
checking for ar... /usr/bin/ar
checking for gcc-ar... /usr/bin/gcc-ar
checking for perl... /usr/bin/perl
checking for gdb... /usr/bin/gdb
checking dependency style of gcc... gcc3
checking for diff -u... yes
checking for gcc option to accept ISO C99... unsupported
configure: error: Valgrind relies on a C compiler supporting C99
Makefile:104: recipe for target 'valgrind/herbgrind/Makefile' failed
make: *** [valgrind/herbgrind/Makefile] Error 1
pavpanchekha commented 4 years ago

What's your version of GCC? What happens when you run gcc --std=c99?

noureddine-as commented 4 years ago

I have version 7.4.0. I succeeded to install it finally. Actually the first time I compiled the project I've got some undefined references to some mpfr functions, so I just modified the LD_LIBRARY_PATH trying to compile with. And that's where I've got this problem. I knew later from the issues and the repo that MPFR, GMP and other deps will be downloaded locally. So I just moved to a fresh VM (Ubuntu 16.04) with no MPFR/GMP... installed. Now The installation is OK. (I had to sudo make)

However, I get the following output for diff-roots-simple.c.out, which, as I see, different than the result mentioned in here http://herbgrind.ucsd.edu/using-herbgrind.html. Any idea? (I'm on a Intel(R) Xeon(R) E-2176M CPU)

..../herbgrind$ ./herbgrind.sh bench/diff-roots-simple.c.out
==1058== Herbgrind, a valgrind tool for Herbie
==1058== Copyright (C) 2016-2017, and GNU GPL'd, by Alex Sanchez-Stern
==1058== Using Valgrind-3.15.0.GIT and LibVEX; rerun with -h for copyright info
==1058== Command: bench/diff-roots-simple.c.out
==1058== 
0.000000e+00
==1058== 

And the output file contains the following, which is also very different than expected

Output @ diff-roots-simple.c:8 in main (addr 400695)
61.959049 bits average error
61.959049 bits max error
Aggregated over 1 instances
Influenced by erroneous expression:

    (FPCore ()
          (- (sqrt (+ 1.000000 1.000000e16)) (sqrt 1.000000e16)))
   diff-roots-simple.c:7 in main (addr 40066D)
   61.959049 bits average error
   61.959049 bits max error
   61.959049 bits average local error
   61.959049 bits max local error
   Aggregated over 1 instances
pavpanchekha commented 4 years ago

I'll have to leave it to @HazardousPeach to answer these questions, but the output file looks alright to me.

HazardousPeach commented 4 years ago

I'm going to finally close this issue, it looks like you got the right output.