hbf / miniball

Fast computation of the smallest enclosing ball of a point set, in low or moderately high dimensions.
133 stars 41 forks source link

Updated example.c to work with newer versions of g++ #38

Closed janbridley closed 1 year ago

janbridley commented 1 year ago

As in #37, example.c cannot be compiled as written on g++ versions 10 or newer. The following error results from attempting to compile the script:


g++ -I../main example.C -o example -O3
>Undefined symbols for architecture arm64:
>  "Seb::Timer::lapse(char const*)", referenced from:
>      _main in example-897173.o
>  "Seb::Timer::start(char const*)", referenced from:
>      _main in example-897173.o
>  "Seb::Timer::instance()", referenced from:
>      _main in example-897173.o
>ld: symbol(s) not found for architecture arm64

A very similar error is raised on x86-64 linux systems as well. The change proposed in 7532079 works for g++-11, g++-12, g++-13, and g++-14 on macOS arm64 and g++-10 on Red Hat linux x86-64.

The line #include "Seb_debug.h" is not required for proper function on any of the versions of g++ tested, but has been left in to improve backwards compatibility.

hbf commented 1 year ago

Thanks for the fix, @janbridley.

If you'd like to be mentioned in the contributors section (https://github.com/hbf/miniball#authors--acknowledgements), feel free to submit a PR.