-
Notifications
You must be signed in to change notification settings - Fork 667
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
base: master
Are you sure you want to change the base?
Conversation
…cluded with add_subdirectory in other CMake project
Bump required CMake version to 3.4 as this is the first version which supports CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
Bump required CMake version to 3.9 as this is the first version which supports the OpenMP::OpenMP_C syntax for target_link_libraries
Assume FFTW is build as shared library per default (FFTW_STATIC define has to be set when using the static version)
Just checked out this branch and tried compilation on VS 2017 x64. I'm getting linking errors:
I configured with:
CMake on MSYS2 also gives the same:
Output:
UPDATE: Build works when using the autoconf |
@StMartin81 Any ideas on what could be wrong with the linking? (as above) |
I'm sorry it took me so long to answer this question. I didn't have time to look into the problem and it's been a while since I was working with FFTW. The master branch is a clone of the original FFTW master branch. This branch is not supposed to be used by end users as some files have to be generated first. These auto generated files provide the functions which the linker is complaining about. Try to use the 3.3.8 branch which is based on the source .tar.gz files provided by the authors of FFTW. This branch includes the needed generated files. I would also strongly recommend to use Ninja as build generator, as this will greatly speed up the compilation:
This should hopefully successfully build FFTW. |
@StMartin81 Thank you very much! Building from the |
I don't know how to generate the files. You would have to ask the authors of FFTW3 for that. Some hints can be found here: http://www.fftw.org/fftw3_doc/Generating-your-own-code.html#Generating-your-own-code |
@StMartin81 Is there a plan to integrate this PR before the next FFTW3 release? |
I don't think so. At least I haven't heard anything back from the authors of FFTW. |
What's wrong with using (We have used mingw a lot to compile FFTW for Windows, but it was with the autoconf configure scripts, which use GNU libtool, which |
This reverts commit 3a94455. Including FindThreads will set Threads_FOUND to true if the thread library was found regardless if ENABLE_THREADS was enabled or not.
…EADS=OFF If both options are enabled link against fftw3_threads/fftw3
The
The linker will output error messages like the following:
This is because |
…bled for CMake project
Bump required CMake version to 3.12
Can't the CMake script add |
I've added the following define in my CMakeLists.txt:
|
…OpenMP are enabled
@StMartin81 Seems like some of the recent changes have broken the build for me. I'm getting errors that |
I've tried to convert more of the project to CMake but I currently don't
have the time to continue this project. Seems like I've messed something
up. Problem also is that the Intel FFT library is available for free, which
is faster than FFTW3. So that doesn't help my motivation to continue this
project...
Am Do., 28. Mai 2020 um 11:06 Uhr schrieb nickdademo <
[email protected]>:
… @StMartin81 <https://github.com/StMartin81> Seems like some of the recent
changes have broken the build for me. I'm getting errors that fftw3.h
cannot be found. I assume the build is fine for you? What options are you
using?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#161 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC6TWOL4PI5OEJC7RVPGLZDRTYSPVANCNFSM4GSELX4A>
.
|
Hello, |
I have deleted my branch as I don't have the time to work on it. I guess it would need a lot of work to refactor the build system so that it's not intermingled (I would imagine a script which auto generates the needed files and a CMake script file for the actual build process). |
I have tested the changes with the 3.3.8 release version of FFTW.
The changes will require a CMake version which is at least 3.9. The reasons for this are that I use the "CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS" CMake option to export all functions and additionally "OpenMP::OpenMP_C" is used to link against OpenMP.
The "Remove __declspec definitions as it does not work anyways" commit is rather large. I've tried the patch with the release version but the git version uses some generator functions, for which I'm not sure that I have modified all of them accordingly. This should also fix the problems described in openmp mingw undefined references.
When compiling FFTW as a shared library on Windows the "CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS" CMake option has to be set to "ON".