[Nauty-list] Failed compile on Ubuntu 9.04

Brendan McKay bdm at cs.anu.edu.au
Thu Nov 12 18:44:23 EST 2009


Hi Jason,

A function getline() is defined as a GNU extension. Since it is not
in either ANSI or ISO C (if anyone knows otherwise, please send
details), it is not supposed to be declared in stdio.h unless it
is specifically requested by defining _GNU_SOURCE, __USE_GNU, or
similar. However, some combinations of gcc and stdio.h, including
yours apparently, declare it anyway and this causes trouble with any
program that wants to use the same name for a function.

I guess your compiler is including GNU extensions by default.

The quickest workaround will be to rename the nauty function
readline() in gtools-h.in, shortg.c and gtools.c, then configure again.
Another possible option is to use -ansi on the compiles.

I guess I should rename it permanently; I am reluctant because
that will break some code people have written.  I just named it
gtools_getline() for version 2.5, not available yet.

Please let me know if this doesn't fix the problem.  Thanks for
reporting this.

Brendan.


* Jason Grout <grout at math.byu.edu> [091112 17:27]:
> We just recently realized (in the Sage project) that nauty 2.4 fails to  
> compile on Ubuntu 9.04. Has anyone else seen this or fixed it?
>
> Thanks,
>
> Jason
>
> --
> Jason Grout
>
>
> $ gcc -v
> Using built-in specs.
> Target: i486-linux-gnu
> Configured with: ../src/configure -v --with-pkgversion='Ubuntu  
> 4.4.1-4ubuntu8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs  
> --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr  
> --enable-shared --enable-multiarch --enable-linker-build-id  
> --with-system-zlib --libexecdir=/usr/lib --without-included-gettext  
> --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4  
> --program-suffix=-4.4 --enable-nls --enable-clocale=gnu  
> --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all  
> --disable-werror --with-arch-32=i486 --with-tune=generic  
> --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu  
> --target=i486-linux-gnu
> Thread model: posix
> gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8)
>
> $ ./configure
> checking build system type... i686-pc-linux-gnu
> checking host system type... i686-pc-linux-gnu
> checking for gcc... gcc
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> 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 if gcc supports -O4 flags... yes
> checking if gcc supports -march=i686 flags... yes
> CFLAGS= -O4 -march=i686
> MORECFLAGS=
> checking for sys/wait.h that is POSIX.1 compatible... yes
> checking how to run the C preprocessor... gcc -E
> checking for grep that handles long lines and -e... /bin/grep
> checking for egrep... /bin/grep -E
> checking for ANSI C header files... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking stddef.h usability... yes
> checking stddef.h presence... yes
> checking for stddef.h... yes
> checking for unistd.h... (cached) yes
> checking for sys/types.h... (cached) yes
> checking for sys/wait.h... (cached) yes
> checking for stdlib.h... (cached) yes
> checking for string.h... (cached) yes
> checking errno.h usability... yes
> checking errno.h presence... yes
> checking for errno.h... yes
> checking for pid_t... yes
> checking if malloc is declared in stdlib.h or malloc.h... 1
> checking if ftell is declared in stdio.h... 1
> checking if fdopen is declared in stdio.h... 1
> checking if popen is declared in stdio.h... 1
> checking if putenv is declared in stdlib.h... 1
> checking if setenv is declared in stdlib.h... 1
> checking if INFINITY is declared in math.h... 1
> checking for int... yes
> checking size of int... 4
> checking for long... yes
> checking size of long... 4
> checking for long long... yes
> checking size of long long... 8
> checking for an ANSI C-conforming const... yes
> checking for isatty... yes
> checking for times... yes
> checking for time... yes
> checking for gettimeofday... yes
> checking for times... (cached) yes
> checking for getrusage... yes
> checking for perror... yes
> checking for pipe... yes
> checking for wait... yes
> checking for popen... yes
> checking for putenv... yes
> checking for setenv... yes
> checking for getc_unlocked... yes
> checking for flockfile... yes
> checking for gsort... no
> checking for sort... sort
> configure: creating ./config.status
> config.status: creating makefile
> config.status: creating nauty.h
> config.status: creating naututil.h
> config.status: creating gtools.h
>
> $ make
> gcc -c -O4 -march=i686 naututil.c
> gcc -c -O4 -march=i686 nauty.c
> gcc -c -O4 -march=i686 nautil.c
> gcc -c -O4 -march=i686 nautinv.c
> gcc -c -O4 -march=i686 naugraph.c
> gcc -c -O4 -march=i686 rng.c
> gcc -o dreadnaut -O4 -march=i686 dreadnaut.c \
> naututil.o nauty.o nautil.o nautinv.o naugraph.o rng.o
> gcc -c -O4 -march=i686 gtools.c
> In file included from gtools.c:6:
> gtools.h:159: error: conflicting types for ?getline?
> /usr/include/stdio.h:651: note: previous declaration of ?getline? was here
> gtools.c:375: error: conflicting types for ?getline?
> /usr/include/stdio.h:651: note: previous declaration of ?getline? was here
> gtools.c: In function ?gt_abort?:
> gtools.c:1835: warning: format not a string literal and no format arguments
> make: *** [gtools.o] Error 1
>
>
> _______________________________________________
> Nauty-list mailing list
> Nauty-list at cs.anu.edu.au
> http://dcsmail.anu.edu.au/cgi-bin/mailman/listinfo/nauty-list




More information about the Nauty mailing list