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 detection broken when building with -coverage #1

Open
lpsinger opened this issue Dec 17, 2018 · 4 comments · Fixed by astropy/astropy-helpers#434 or astropy/astropy-helpers#495
Labels
help wanted Extra attention is needed

Comments

@lpsinger
Copy link
Contributor

Detection of OpenMP support when building with the -coverage option (see astropy/astropy-helpers#374) is broken again because the CFLAGS environment variable is propagated to the compiler invocation but not the linker invocation. The environment variable CFLAGS=-coverage normally tells the build process to add the -coverage option to both compiler AND linker commands for C binaries, but as shown below it is only passed to the compiler. As a result, the executable fails to run.

gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -coverage -fPIC -c test_openmp.c -o objects/test_openmp.o -fopenmp
gcc -pthread objects/test_openmp.o -o test_openmp -fopenmp
objects/test_openmp.o: In function `_GLOBAL__sub_I_65535_0_test_openmp.c':
test_openmp.c:(.text.startup+0x38): undefined reference to `__gcov_init'
objects/test_openmp.o:(.data.rel+0x20): undefined reference to `__gcov_merge_add'
collect2: error: ld returned 1 exit status
@bsipocz
Copy link
Member

bsipocz commented Jan 10, 2019

@lpsinger - Could you please tests the helpers' master with your package? This should have been fixed by astropy/astropy-helpers#434

@bsipocz bsipocz reopened this Jan 10, 2019
@lpsinger
Copy link
Contributor Author

No, that didn't help.

@pllim
Copy link
Member

pllim commented Feb 1, 2019

Ack, sorry! Feel free to revert merge of astropy/astropy-helpers#434 and re-open this issue.

lpsinger referenced this issue in lpsinger/astropy-helpers Aug 27, 2019
This reverts commit b4ffde3.

It did not fix #432.
@pllim
Copy link
Member

pllim commented Sep 14, 2019

Ops... need to reopen this. I think that "fix" directive in astropy/astropy-helpers#495 was accidental.

@bsipocz bsipocz reopened this Sep 14, 2019
@Cadair Cadair transferred this issue from astropy/astropy-helpers Dec 13, 2019
@astrofrog astrofrog added the help wanted Extra attention is needed label Dec 18, 2019
lpsinger added a commit to lpsinger/ligo.skymap that referenced this issue May 22, 2020
The OpenMP check in the extension-helpers package does not work
with the GCC `-coverage` option. See upstream issue:

astropy/extension-helpers#1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
4 participants