FFTW / fftw3

DO NOT CHECK OUT THESE FILES FROM GITHUB UNLESS YOU KNOW WHAT YOU ARE DOING. (See below.)
GNU General Public License v2.0
2.73k stars 664 forks source link

openmp mingw undefined references #120

Open sonoro1234 opened 6 years ago

sonoro1234 commented 6 years ago

Hi, I am trying to compile fftw3_omp with cmake and mingw-w64 (32 bits)

cmake -G"MinGW Makefiles"  -DCMAKE_BUILD_TYPE=Release -DENABLE_FLOAT=off -DENABLE_SSE=on -DENABLE_SSE2=on -DENABLE_OPENMP=on  -DBUILD_TESTS=off   ../fftw-3.3.7

I get this linking errors

[100%] Linking C shared library libfftw3_omp.dll
CMakeFiles\fftw3_omp.dir/objects.a(api.c.obj):api.c:(.text+0x22): undefined reference to `fftw_mksolver_ct_hoo
k'
CMakeFiles\fftw3_omp.dir/objects.a(api.c.obj):api.c:(.text+0x2c): undefined reference to `fftw_mksolver_hc2hc_
hook'
CMakeFiles\fftw3_omp.dir/objects.a(api.c.obj):api.c:(.text+0x79): undefined reference to `fftw_mksolver_ct_hoo
k'
CMakeFiles\fftw3_omp.dir/objects.a(api.c.obj):api.c:(.text+0x83): undefined reference to `fftw_mksolver_hc2hc_
hook'
CMakeFiles\fftw3_omp.dir/objects.a(api.c.obj):api.c:(.text+0xc4): undefined reference to `fftw_imax'
CMakeFiles\fftw3_omp.dir/objects.a(api.c.obj):api.c:(.text+0xed): undefined reference to `fftw_mksolver_ct_hoo
k'
CMakeFiles\fftw3_omp.dir/objects.a(api.c.obj):api.c:(.text+0xf7): undefined reference to `fftw_mksolver_hc2hc_
hook'

Any idea?

thanks victor bombi

sonoro1234 commented 6 years ago

Also tried with msys mingw-w64 (32 bits)

 ./configure --with-our-malloc16 --with-windows-f77-mangling --enable-shared --disable-static --enable-openmp --enable-portable-binary --enable-sse2 --with-incoming-stack-boundary=2

but the error after make was:

/bin/sh ../libtool  --tag=CC   --mode=link gcc -std=gnu99 -mincoming-stack-boundary=2 -fopenmp -O3 -
fomit-frame-pointer -mtune=native -malign-double -fstrict-aliasing -fno-schedule-insns -ffast-math -
version-info 8:7:5  -o libfftw3_omp.la -rpath /usr/local/lib libfftw3_omp_la-api.lo libfftw3_omp_la-
conf.lo libfftw3_omp_la-openmp.lo libfftw3_omp_la-dft-vrank-geq1.lo libfftw3_omp_la-ct.lo libfftw3_o
mp_la-rdft-vrank-geq1.lo libfftw3_omp_la-hc2hc.lo libfftw3_omp_la-vrank-geq1-rdft2.lo libfftw3_omp_l
a-f77api.lo ../libfftw3.la -lm
libtool:   error: can't build i686-pc-mingw32 shared library unless -no-undefined is specified
make[2]: *** [libfftw3_omp.la] Error 1
make[2]: Leaving directory `/c/inpaint/fftw-3.3.7mingw/threads'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/c/inpaint/fftw-3.3.7mingw'
make: *** [all] Error 2
sonoro1234 commented 6 years ago

with cmake it works if I modify CMakeLists.txt as

if (OPENMP_FOUND)
  add_library (${fftw3_lib}_omp ${SOURCEFILES} ${fftw_omp_SOURCE})
  if (HAVE_SSE)
  target_compile_options (${fftw3_lib}_omp PRIVATE ${SSE_FLAG})
endif ()
if (HAVE_SSE2)
  target_compile_options (${fftw3_lib}_omp PRIVATE ${SSE2_FLAG})
endif ()
  target_link_libraries (${fftw3_lib}_omp ${fftw3_lib})
  target_link_libraries (${fftw3_lib}_omp ${CMAKE_THREAD_LIBS_INIT})
  list (APPEND subtargets ${fftw3_lib}_omp)
  target_compile_options (${fftw3_lib}_omp PRIVATE ${OpenMP_C_FLAGS})
  set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} " -Wall ${OpenMP_C_FLAGS}")
endif ()
umadevimcw commented 5 years ago

@sonoro1234 I am also facing same issue with MINGW-64. Did you able to fix

libtool: error: build x86_64-w64-mingw32 shared library unless -no-undefined is specified

issue on Mingw-64 without using cmake?

sonoro1234 commented 5 years ago

Sorry, i only tried cmake