FFHT icon indicating copy to clipboard operation
FFHT copied to clipboard

Compilation fails with newer gcc/clang due to C99 'inline' vs C89 'inline'

Open dnbaker opened this issue 8 years ago • 4 comments

Unresolved symbol errors occur when using gcc7 or 6 but succeeds with gcc4.

See http://clang.llvm.org/compatibility.html#inline for an explanation. A fix is simply replacing "inline" with "static inline", which I can confirm works with gcc7 and clang.

Example error:

Undefined symbols for architecture x86_64:
  "_helper_double_10", referenced from:
      _fht_double in fht.o
  "_helper_double_11", referenced from:
      _fht_double in fht.o
  "_helper_double_5", referenced from:
      _fht_double in fht.o
  "_helper_double_6", referenced from:
      _fht_double in fht.o
  "_helper_double_7", referenced from:
      _fht_double in fht.o
  "_helper_double_8", referenced from:
      _fht_double in fht.o
  "_helper_double_9", referenced from:
      _fht_double in fht.o
  "_helper_float_12", referenced from:
      _fht_float in fht.o
  "_helper_float_4", referenced from:
      _fht_float in fht.o
  "_helper_float_5", referenced from:
      _fht_float in fht.o
  "_helper_float_6", referenced from:
      _fht_float in fht.o
  "_helper_float_9", referenced from:
      _fht_float in fht.o
ld: symbol(s) not found for architecture x86_64

This is fixed in my fork, but it also adds some additional methods which might not be worthy of inclusion and a simple replacement of 'inline' with 'static inline' might be preferable.

dnbaker avatar Oct 29 '17 19:10 dnbaker

Thanks a lot for your numerous contributions! I will merge them after the next week, since I have a major deadline (STOC 2018) upcoming. :)

ilyaraz avatar Oct 29 '17 20:10 ilyaraz

I understand! Take your time. I'm just happy to take advantage of your hard work.

I think it's exciting to see kernel methods, dimensionality reduction, neural network acceleration and locality-sensitive hashing all converge on careful application of FFT-like algorithms.

dnbaker avatar Oct 30 '17 21:10 dnbaker

If you don't mind telling me, do you have any specific application in mind?

ilyaraz avatar Oct 30 '17 21:10 ilyaraz

Primarily variations on random projections for kernel applications, building on Choromanski et al.'s and Smola's work. Your "Practical and optimal LSH for angular distance" is cited in most of Choromanski's papers on the subject.

dnbaker avatar Oct 30 '17 22:10 dnbaker