Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation when compiling on Windows #161

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f089084
Add api folder to target_include_directories, so that fftw3 can be in…
Jan 22, 2019
a805a51
Add support for aligned memory allocation when using MinGW
Jan 23, 2019
da35c39
Remove __declspec definitions as it does not work anyways
Jan 24, 2019
5c7b25c
Fix compilation with MinGW
Jan 24, 2019
31bb5c1
Add missing include guards for header files
Jan 24, 2019
d601140
Export static variables for MSVC
Jan 24, 2019
40029c5
Remove accidentally commited "#pragma message" debug messages
Jan 24, 2019
2f40c5c
Remove unnecessary API specifiers in C implementation files
Feb 6, 2019
819be0a
Remove unused CALLING_FFTW and CALLING_FFTW defines
Feb 7, 2019
cf8ec7a
Only export symbols when building FFTW as shared library
Feb 7, 2019
0136f15
Use new CMake command 'add_compile_definitions'
Feb 11, 2019
3a94455
Add missing FindThreads include
Jul 18, 2019
596fe13
Revert "Add missing FindThreads include"
Oct 2, 2019
aca236e
Don't link fftw3_omp library against the Threads library
Oct 2, 2019
c4d0594
Use target Threads::Threads to link fftw3_threads
Oct 2, 2019
758754a
Fix building of bench executable when ENABLE_OPENMP=ON and ENABLE_THR…
Oct 2, 2019
1ed6354
Use add_compile_definitions to specify target compile definitions
Oct 2, 2019
7e96ffb
Add alias defines for libraries
Dec 12, 2019
8e992d6
Fix version string
Dec 12, 2019
632f7b8
Remove unused variable
Dec 12, 2019
dfba9ed
Use write_basic_package_version_file to generate package config versi…
Dec 16, 2019
cddcb5c
Replace FFTW3 with ${PROJECT_NAME}
Dec 16, 2019
73349aa
Require Threads and OpenMP packages if corresponding options were ena…
Dec 16, 2019
824777b
Use namespaced names to link libraries to bench executable
Dec 16, 2019
fc67cfb
Explicitly set link dependencies for ${fftw3_lib}_threads and ${fftw3…
Dec 16, 2019
5e8c76a
Rename variable OPENMP_FOUND to OpenMP_FOUND
Dec 16, 2019
93a1cba
Clean up package install
Dec 16, 2019
5ce8eb8
Add missing soname version
Dec 19, 2019
a8ec8e8
Add conanfile.py to project
Jan 21, 2020
db40ad8
Add option to create Debian package with CPack
Jan 21, 2020
bbd6740
Explicitly list source files for targets in CMakeLists.txt files
Jan 21, 2020
8d40fce
Use namespace identifiers to link to fftw3 library target
Jan 21, 2020
62f01a1
Add fftw3.h to target source files
Jan 21, 2020
f0a2a97
Clean up including of directories
Jan 21, 2020
eeeea36
Clean up exporting of symbols
Jan 21, 2020
fcbe7f5
Add language standards for targets
Jan 21, 2020
1c4e6f2
Remove dependencies on internal library functions for bench executable
Jan 21, 2020
c9310ca
Set HAVE_OPENMP to true in config.h if OpenMP was enabled
Jan 21, 2020
b0eb89f
Always prefer linking to threads enabled library if both threads and …
Jan 21, 2020
d736c09
Set value of USING_POSIX_THREADS in config.h
Jan 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
325 changes: 179 additions & 146 deletions CMakeLists.txt

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions FFTW3Config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# defined since 2.8.3
if (CMAKE_VERSION VERSION_LESS 2.8.3)
get_filename_component (CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
endif ()

# Allows loading FFTW3 settings from another project
set (FFTW3_CONFIG_FILE "${CMAKE_CURRENT_LIST_FILE}")

set (FFTW3@PREC_SUFFIX@_LIBRARIES fftw3@PREC_SUFFIX@)
set (FFTW3@PREC_SUFFIX@_LIBRARY_DIRS @CMAKE_INSTALL_FULL_LIBDIR@)
set (FFTW3@PREC_SUFFIX@_INCLUDE_DIRS @CMAKE_INSTALL_FULL_INCLUDEDIR@)

include ("${CMAKE_CURRENT_LIST_DIR}/FFTW3LibraryDepends.cmake")

if (CMAKE_VERSION VERSION_LESS 2.8.3)
set (CMAKE_CURRENT_LIST_DIR)
endif ()
get_filename_component(@PROJECT_NAME@@PREC_SUFFIX@_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(CMakeFindDependencyMacro)
set(ENABLE_OPENMP @ENABLE_OPENMP@)
set(ENABLE_THREADS @ENABLE_THREADS@)
if(${ENABLE_OPENMP})
find_dependency(OpenMP REQUIRED)
endif()
if(${ENABLE_THREADS})
find_dependency(Threads REQUIRED)
endif()
if(NOT TARGET @PROJECT_NAME@@PREC_SUFFIX@::fftw3@PREC_SUFFIX@)
include("${@PROJECT_NAME@@PREC_SUFFIX@_CMAKE_DIR}/@PROJECT_NAME@@[email protected]")
endif()
12 changes: 0 additions & 12 deletions FFTW3ConfigVersion.cmake.in

This file was deleted.

83 changes: 83 additions & 0 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
target_sources(${fftw3_lib}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/fftw3.h>
PRIVATE
api.h
f77funcs.h
guru.h
guru64.h
mktensor-iodims.h
plan-guru-dft-c2r.h
plan-guru-dft-r2c.h
plan-guru-dft.h
plan-guru-r2r.h
plan-guru-split-dft-c2r.h
plan-guru-split-dft-r2c.h
plan-guru-split-dft.h
x77.h
apiplan.c
configure.c
execute-dft-c2r.c
execute-dft-r2c.c
execute-dft.c
execute-r2r.c
execute-split-dft-c2r.c
execute-split-dft-r2c.c
execute-split-dft.c
execute.c
export-wisdom-to-file.c
export-wisdom-to-string.c
export-wisdom.c
f77api.c
flops.c
forget-wisdom.c
import-system-wisdom.c
import-wisdom-from-file.c
import-wisdom-from-string.c
import-wisdom.c
malloc.c
map-r2r-kind.c
mapflags.c
mkprinter-file.c
mkprinter-str.c
mktensor-iodims.c
mktensor-iodims64.c
mktensor-rowmajor.c
plan-dft-1d.c
plan-dft-2d.c
plan-dft-3d.c
plan-dft-c2r-1d.c
plan-dft-c2r-2d.c
plan-dft-c2r-3d.c
plan-dft-c2r.c
plan-dft-r2c-1d.c
plan-dft-r2c-2d.c
plan-dft-r2c-3d.c
plan-dft-r2c.c
plan-dft.c
plan-guru-dft-c2r.c
plan-guru-dft-r2c.c
plan-guru-dft.c
plan-guru-r2r.c
plan-guru-split-dft-c2r.c
plan-guru-split-dft-r2c.c
plan-guru-split-dft.c
plan-guru64-dft-c2r.c
plan-guru64-dft-r2c.c
plan-guru64-dft.c
plan-guru64-r2r.c
plan-guru64-split-dft-c2r.c
plan-guru64-split-dft-r2c.c
plan-guru64-split-dft.c
plan-many-dft-c2r.c
plan-many-dft-r2c.c
plan-many-dft.c
plan-many-r2r.c
plan-r2r-1d.c
plan-r2r-2d.c
plan-r2r-3d.c
plan-r2r.c
print-plan.c
rdft2-pad.c
the-planner.c
version.c)
30 changes: 4 additions & 26 deletions api/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,6 @@
#ifndef __API_H__
#define __API_H__

#ifndef CALLING_FFTW /* defined in hook.c, when calling internal functions */
# define COMPILING_FFTW /* used for DLL symbol exporting in fftw3.h */
#endif

/* When compiling with GNU libtool on Windows, DLL_EXPORT is #defined
for compiling the shared-library code. In this case, we'll #define
FFTW_DLL to add dllexport attributes to the specified functions in
fftw3.h.

If we don't specify dllexport explicitly, then libtool
automatically exports all symbols. However, if we specify
dllexport explicitly for any functions, then libtool apparently
doesn't do any automatic exporting. (Not documented, grrr, but
this is the observed behavior with libtool 1.5.8.) Thus, using
this forces us to correctly dllexport every exported symbol, or
linking bench.exe will fail. This has the advantage of forcing
us to mark things correctly, which is necessary for other compilers
(such as MS VC++). */
#ifdef DLL_EXPORT
# define FFTW_DLL
#endif

/* just in case: force <fftw3.h> not to use C99 complex numbers
(we need this for IBM xlc because _Complex_I is treated specially
and is defined even if <complex.h> is not included) */
Expand Down Expand Up @@ -90,14 +68,14 @@ int X(guru_kosherp)(int rank, const X(iodim) *dims,
int X(guru64_kosherp)(int rank, const X(iodim64) *dims,
int howmany_rank, const X(iodim64) *howmany_dims);

/* Note: FFTW_EXTERN is used for "internal" functions used in tests/hook.c */
/* Note: extern is used for "internal" functions used in tests/hook.c */

FFTW_EXTERN printer *X(mkprinter_file)(FILE *f);
FFTW3_EXPORT printer *X(mkprinter_file)(FILE *f);

printer *X(mkprinter_cnt)(size_t *cnt);
printer *X(mkprinter_str)(char *s);

FFTW_EXTERN planner *X(the_planner)(void);
FFTW3_EXPORT planner *X(the_planner)(void);
void X(configure_planner)(planner *plnr);

void X(mapflags)(planner *, unsigned);
Expand All @@ -108,7 +86,7 @@ rdft_kind *X(map_r2r_kind)(int rank, const X(r2r_kind) * kind);

typedef void (*planner_hook_t)(void);

void X(set_planner_hooks)(planner_hook_t before, planner_hook_t after);
void EXPORT_ADDITIONAL_FUNCTIONS X(set_planner_hooks)(planner_hook_t before, planner_hook_t after);

#ifdef __cplusplus
} /* extern "C" */
Expand Down
Loading