Skip to content

Commit

Permalink
Fix libfftw3/libfftw3_threads chicken-egg problem
Browse files Browse the repository at this point in the history
On most systems we want to build libfftw3 first, so that
libfftw3_threads can depend upon libfftw3.  When producing a single
combined-thread library (e.g. on Windows) we want the opposite,
so that libfftw3 can include libfftw3_threads.
  • Loading branch information
matteo-frigo committed Apr 28, 2012
1 parent 4bcfb67 commit 747ece1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,25 @@ endif

ACLOCAL_AMFLAGS=-I m4

# when using combined thread libraries (necessary on Windows), we want
# to build threads/ first, because libfftw3_threads is added to
# libfftw3.
#
# Otherwise, we want to build libfftw3_threads after libfftw3
# so that we can track the fact that libfftw3_threads depends upon
# libfftw3.
#
# This is the inescapable result of combining three bad ideas
# (threads, Windows, and shared libraries).
#
if COMBINED_THREADS
CHICKEN_EGG=threads .
else
CHICKEN_EGG=. threads
endif

SUBDIRS=support $(GENFFT) kernel simd-support dft rdft reodft api \
libbench2 . threads tests mpi doc tools m4
libbench2 $(CHICKEN_EGG) tests mpi doc tools m4
EXTRA_DIST=COPYRIGHT bootstrap.sh CONVENTIONS fftw.pc.in

SIMD_LIBS = \
Expand Down
5 changes: 5 additions & 0 deletions threads/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ threads.h dft-vrank-geq1.c ct.c rdft-vrank-geq1.c hc2hc.c \
vrank-geq1-rdft2.c f77api.c f77funcs.h
libfftw3@PREC_SUFFIX@_threads_la_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS)
libfftw3@PREC_SUFFIX@_threads_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
if !COMBINED_THREADS
libfftw3@PREC_SUFFIX@_threads_la_LIBADD = ../libfftw3@[email protected]
endif

libfftw3@PREC_SUFFIX@_omp_la_SOURCES = api.c conf.c openmp.c \
threads.h dft-vrank-geq1.c ct.c rdft-vrank-geq1.c hc2hc.c \
vrank-geq1-rdft2.c f77api.c f77funcs.h
libfftw3@PREC_SUFFIX@_omp_la_CFLAGS = $(AM_CFLAGS) $(OPENMP_CFLAGS)
libfftw3@PREC_SUFFIX@_omp_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
if !COMBINED_THREADS
libfftw3@PREC_SUFFIX@_omp_la_LIBADD = ../libfftw3@[email protected]
endif

0 comments on commit 747ece1

Please sign in to comment.