Skip to content

Commit

Permalink
Fix Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
msg7086 committed Jun 21, 2020
1 parent 483297a commit 0246a8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ if(ENABLE_PAR AND HAS_EXECUTION)
endif()
endif()

if (NOT WIN32)
target_link_libraries(neo-fft3d dl)
endif()

add_custom_command(
TARGET neo-fft3d POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:neo-fft3d> "../Release_${VERSION}/${_DIR}/$<TARGET_FILE_NAME:neo-fft3d>"
Expand Down
12 changes: 6 additions & 6 deletions src/fftwlite.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ struct FFTFunctionPointers {
if (library == NULL)
library = LoadLibraryW(L"fftw3");
if (library == NULL)
#ifdef _WIN32
throw("libfftw3f-3.dll or fftw3.dll not found. Please put in PATH or use LoadDll() plugin");
#else
throw("libfftw3f_threads.so.3 not found. Please install libfftw3-single3 (deb) or fftw-devel (rpm) package");
#endif
throw("libfftw3f-3.dll or fftw3.dll not found. Please put in PATH or use LoadDll() plugin");
}
void fftw3_close() { FreeLibrary(library); }
func_t fftw3_address(LPCSTR func) { return GetProcAddress(library, func); }
#else
void fftw3_open() { library = dlopen("libfftw3f_threads.so.3", RTLD_NOW); }
void fftw3_open() {
library = dlopen("libfftw3f_threads.so.3", RTLD_NOW);
if (library == NULL)
throw("libfftw3f_threads.so.3 not found. Please install libfftw3-single3 (deb) or fftw-devel (rpm) package");
}
void fftw3_close() { dlclose(library); }
func_t fftw3_address(const char * func) { return dlsym(library, func); }
#endif
Expand Down

0 comments on commit 0246a8f

Please sign in to comment.