I ran into an issue with compiling GNU Go 3.8 on Amazon Linux 2023 (gcc
(GCC) 11.3.1 20221121 (Red Hat 11.3.1-4)).

I receive the follow error when running `./configure` and `make`:

gcc  -g -O2   -o mkpat  mkpat.o transform.o dfa.o ../utils/libutils.a -lm
> /usr/bin/ld:
> transform.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:861:
> multiple definition of `meaningless_white_moves';
> mkpat.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:861:
> first defined here
> /usr/bin/ld:
> transform.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:860:
> multiple definition of `meaningless_black_moves';
> mkpat.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:860:
> first defined here
> /usr/bin/ld:
> dfa.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:861:
> multiple definition of `meaningless_white_moves';
> mkpat.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:861:
> first defined here
> /usr/bin/ld:
> dfa.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:860:
> multiple definition of `meaningless_black_moves';
> mkpat.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:860:
> first defined here
> collect2: error: ld returned 1 exit status
> make[2]: *** [Makefile:371: mkpat] Error 1
> make[2]: Leaving directory
> '/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns'
> make[1]: *** [Makefile:232: all-recursive] Error 1
> make[1]: Leaving directory '/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8'
> make: *** [Makefile:168: all] Error 2


My solution was to move the following lines from `liberty.h` to
`unconditional.c`:

/* Unconditionally meaningless moves. */
> int meaningless_black_moves[BOARDMAX];
> int meaningless_white_moves[BOARDMAX];


This change allowed me to compile successfully.

I am not a C programmer.  Is this a reasonable change to make and does not
functionally affect the program?  Why was this error encountered in the
first place?

Thank you.
_______________________________________________
gnugo-devel mailing list
gnugo-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/gnugo-devel

Reply via email to