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

mingw msys errors, libgomp #8

Open
lvecsey opened this issue Jul 18, 2017 · 5 comments
Open

mingw msys errors, libgomp #8

lvecsey opened this issue Jul 18, 2017 · 5 comments

Comments

@lvecsey
Copy link

lvecsey commented Jul 18, 2017

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 to omp_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 to omp_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 to omp_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 to omp_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 to omp_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

@sneves
Copy link
Member

sneves commented Jul 20, 2017

-fopenmp should be the only required compiler flag, yes. libgomp must also be installed. That should be all that is needed.

@lvecsey
Copy link
Author

lvecsey commented Jul 20, 2017

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.

@noloader
Copy link
Contributor

noloader commented Jul 1, 2020

@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

@Biswa96
Copy link

Biswa96 commented Feb 18, 2022

Any progress on this issue?

@vtorri
Copy link

vtorri commented Sep 12, 2023

@Biswa96 i've just compiled git, and not problem with mingw-w64 on msys2

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

5 participants