haskell-numerics / hmatrix

Linear algebra and numerical computation
381 stars 104 forks source link

Possible fix for #141 #142

Closed ntfrgl closed 9 years ago

ntfrgl commented 9 years ago

Move definitions of mod/mod_l to lapack-aux.h, where they can be directly seen by lapack-aux.c and vector-aux.c. Compiler-dependant interpretations of inline are thus avoided. Works for me!

Some relevant discussions: http://stackoverflow.com/questions/6312597/is-inline-without-static-or-extern-ever-useful-in-c99/6312854 http://stackoverflow.com/questions/216510/extern-inline/216546 http://stackoverflow.com/questions/16245521/c99-inline-function-in-c-file/16245669

albertoruiz commented 9 years ago

Thanks for the fix! In my Ubuntu machine I had errors because of multiple definitions:

dist/build/src/Internal/C/vector-aux.dyn_o: In function `mod':
vector-aux.c:(.text+0x200): multiple definition of `mod'
dist/build/src/Internal/C/lapack-aux.dyn_o:lapack-aux.c:(.text+0x0): first defined here
...(the same for mod_l)

But it seems that it can be easily fixed just by using static inline. Can you check if my last commit works in your system?

ntfrgl commented 9 years ago

Yes, thank you!