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

fftw: compile with -fPIC instead of -fPIE #420

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

daniestevez
Copy link
Contributor

Compiling with -fPIE doesn't allow building dynamic libraries (for instance, a dynamic library that contains blocks using fftw or a Python module with Python bindings for these blocks).


Context: I'm building a Python module with Python bindings for gr4-packet-modem, and with -fPIE I get the following error:

[ 50%] Linking CXX shared module gr4_packet_modem_python.cpython-312-x86_64-linux-gnu.so
/usr/bin/ld: /gr4-packet-modem/build/gnuradio4/fftw/install/lib/libfftw3f.a(tensor7.o): warning: relocation against `fftwf_dimcmp' in read-only section `.text'
/usr/bin/ld: /gr4-packet-modem/build/gnuradio4/fftw/install/lib/libfftw3f.a(tensor7.o): relocation R_X86_64_PC32 against symbol `fftwf_dimcmp' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
c++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/gr4_packet_modem_python.dir/build.make:1013: gr4_packet_modem_python.cpython-312-x86_64-linux-gnu.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:1022: CMakeFiles/gr4_packet_modem_python.dir/all] Error 2

With -fPIC the error goes away.

Compiling with -fPIE doesn't allow building dynamic libraries
(for instance, a dynamic library that contains blocks using fftw
or a Python module with Python bindings for these blocks).

Signed-off-by: Daniel Estévez <[email protected]>
Copy link
Contributor

@drslebedev drslebedev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your PR!

Changes look good to me and the PR can be merged.

@drslebedev drslebedev merged commit 4d73ac7 into fair-acc:main Sep 30, 2024
10 of 11 checks passed
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

Successfully merging this pull request may close these issues.

2 participants