ltfat / libltfat

Backend library for LTFAT
http://ltfat.github.io/libltfat
GNU General Public License v3.0
12 stars 2 forks source link

libltfatf depends on libltfat #3

Closed susnak closed 8 years ago

susnak commented 8 years ago

c-safe-memalloc.c integer_manip.c reassign_typeconstant.c are only compiled in libltfat and not in libltfatf. They could be, but then there will be a name conflict when linking against both. Solve this so libltfatf and libltfat can be used both independently and together like fftw3 and fftw3f can be used.

susnak commented 8 years ago

There seems to be two options:

1) Wrap all type independent code to LTFAT_NAME(name) macro. This will make the libraries completely independent, but the code will be included in both libltfat and libltfatf. This is how FFTW works.

2) Separate the type independent code in a separate archive libltfat_indep and make both libltfat and libltfatf depend on libltfat_indep This will make the linking a slightly more complex.

susnak commented 8 years ago

Solved by introducing 3 compilation targets: libltfat -- contains double, single and common code (depends on both libfftw3 and libfftw3f) libltfatd -- double and common (depends just on libfftw3) libltfatf -- single and common (depends just on libfftw3f) Note that linking both libltfatd and libltfatf will not work because of the code duplicity. One should link just libltfat if both precisions are required.