scandum/quadsort

The quadsort doesn't even compile.

shyamalschandra opened this issue · 2 comments

I am getting the following error when trying to compile the bench.c program.

shyamalchandra@iMac quadsort % gcc bench.c
Undefined symbols for architecture x86_64:
  "_tail_insert32", referenced from:
      _tail_swap32 in bench-d905ef.o
  "_tail_insert64", referenced from:
      _tail_swap64 in bench-d905ef.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What is this bench-d905ef.o?

Try gcc -O3 bench.c

Looks like the problem was with me using inline, which I fixed in quadsort.h.

@scandum: Why do you need optimization at the higher levels?

From the Linux documentation:

-O3 Optimize yet more.  -O3 turns on all optimizations specified by
           -O2 and also turns on the following optimization flags:

           -fgcse-after-reload -finline-functions -fipa-cp-clone
           -floop-interchange -floop-unroll-and-jam -fpeel-loops
           -fpredictive-commoning -fsplit-paths
           -ftree-loop-distribute-patterns -ftree-loop-distribution
           -ftree-loop-vectorize -ftree-partial-pre -ftree-slp-vectorize
           -funswitch-loops -fvect-cost-model -fversion-loops-for-strides

Source: https://man7.org/linux/man-pages/man1/gcc.1.html