Open lvecsey opened 7 years ago
-fopenmp
should be the only required compiler flag, yes. libgomp must also be installed. That should be all that is needed.
I got it working by adding -lgomp however I also had to make sure I was using the correct compiler in my path, in my case TDM-GCC-64
I can also suggest adding a line to configure.ac
AC_SEARCH_LIBS([GOMP_parallel], [gomp])
Thanks.
@lvecsey,
I think the problem was due to AC_OPENMP
and the way flags were setup/used. Flags include AM_CFLAGS
and CFLAGS
. And I think the biggest offender was AC_OPENMP
. The macro did not behave well during my testing.
There's an upcoming PR that tests OK on MinGW at Noloader | Autotools. The Autotools changes removes AC_OPENMP
, uses AX_OPENMP
and properly manages AM_CFLAGS
and CFLAGS
. The Autotools changes do not require work-arounds like AC_SEARCH_LIBS
.
The Autotools changes also test OK on Cygwin.
What I am not sure of is, do we have similar environments. I'm testing on Windows 7. I don't know which MinGW version I have. Searching for "mingw get version" is turning up irrelevant noise.
For completeness, here are the commands I ran:
./autogen.sh
./configure --enable-openmp
make
Any progress on this issue?
@Biswa96 i've just compiled git, and not problem with mingw-w64 on msys2
I am getting errors at the linking stage, when compiling on mingw msys.
Do I need to compile with -fopenmp or something else, such as installing a libgomp library? What steps would I follow to do that exactly?
Thank you.
--
.libs/libb2_la-blake2sp.o:blake2sp.c:(.text+0xc): undefined reference to
omp_get_thread_num' .libs/libb2_la-blake2sp.o:blake2sp.c:(.text+0x7c): undefined reference to
omp_get_thread_num' .libs/libb2_la-blake2sp.o:blake2sp.c:(.text+0x5ea): undefined reference toomp_set_num_threads' .libs/libb2_la-blake2sp.o:blake2sp.c:(.text+0x626): undefined reference to
GOMP_parallel' .libs/libb2_la-blake2sp.o:blake2sp.c:(.text+0x9d8): undefined reference toomp_set_num_threads' .libs/libb2_la-blake2sp.o:blake2sp.c:(.text+0xa1d): undefined reference to
GOMP_parallel' .libs/libb2_la-blake2bp.o:blake2bp.c:(.text+0xc): undefined reference toomp_get_thread_num' .libs/libb2_la-blake2bp.o:blake2bp.c:(.text+0x7c): undefined reference to
omp_get_thread_num' .libs/libb2_la-blake2bp.o:blake2bp.c:(.text+0x6ba): undefined reference toomp_set_num_threads' .libs/libb2_la-blake2bp.o:blake2bp.c:(.text+0x6f2): undefined reference to
GOMP_parallel' .libs/libb2_la-blake2bp.o:blake2bp.c:(.text+0xabb): undefined reference toomp_set_num_threads' .libs/libb2_la-blake2bp.o:blake2bp.c:(.text+0xb0c): undefined reference to
GOMP_parallel' collect2.exe: error: ld returned 1 exit status