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

openmp mingw undefined references #120

Open
sonoro1234 opened this issue Dec 18, 2017 · 4 comments
Open

openmp mingw undefined references #120

sonoro1234 opened this issue Dec 18, 2017 · 4 comments

Comments

@sonoro1234
Copy link

sonoro1234 commented Dec 18, 2017

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
Copy link
Author

sonoro1234 commented Dec 18, 2017

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 sonoro1234 changed the title mingw and cmake undefined references openmp mingw undefined references Dec 27, 2017
@sonoro1234
Copy link
Author

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
Copy link

umadevimcw commented Sep 5, 2019

@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
Copy link
Author

Sorry, i only tried cmake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants