python-samplerate
python-samplerate copied to clipboard
samplerate cannot be installed in OpenSuse Tumbleweed
Problem: samplerate cannot be installed in OpenSuse Tumbleweed
Platform: OpenSuse Tumbleweed with all packages up-to-date Python 3.11 virtual environment
Steps to reproduce: python3 -m venv led source led/bin/activate python3 -m pip install samplerate
Trace:
Collecting samplerate
Using cached samplerate-0.2.1.tar.gz (21 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Collecting numpy (from samplerate)
Using cached numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)
Using cached numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.3 MB)
Building wheels for collected packages: samplerate
Building wheel for samplerate (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for samplerate (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [149 lines of output]
running bdist_wheel
running build
running build_ext
-- Found Python prefix
-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at build/temp.linux-x86_64-cpython-311/samplerate/_deps/pybind11-src/CMakeLists.txt:8 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- pybind11 v2.10.4
CMake Warning (dev) at build/temp.linux-x86_64-cpython-311/samplerate/_deps/pybind11-src/tools/FindPythonLibsNew.cmake:98 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
build/temp.linux-x86_64-cpython-311/samplerate/_deps/pybind11-src/tools/pybind11Tools.cmake:50 (find_package)
build/temp.linux-x86_64-cpython-311/samplerate/_deps/pybind11-src/tools/pybind11Common.cmake:180 (include)
build/temp.linux-x86_64-cpython-311/samplerate/_deps/pybind11-src/CMakeLists.txt:208 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found PythonInterp: /home/julian/led/bin/python3 (found suitable version "3.11.8", minimum required is "3.6")
-- Found PythonLibs: /usr/lib64/libpython3.11.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
CMake Deprecation Warning at build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-src/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-src/CMakeLists.txt:16 (cmake_policy):
The OLD behavior for policy CMP0091 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
-- Looking for stdbool.h
-- Looking for stdbool.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.1.1")
-- Checking processor clipping capabilities...
-- Performing Test CPU_CLIPS_POSITIVE
-- Performing Test CPU_CLIPS_POSITIVE - Failed
-- Performing Test CPU_CLIPS_NEGATIVE
-- Performing Test CPU_CLIPS_NEGATIVE - Failed
-- Checking processor clipping capabilities... none
-- Performing Test HAVE_VISIBILITY
-- Performing Test HAVE_VISIBILITY - Success
-- Configuring done (24.9s)
-- Generating done (0.0s)
-- Build files have been written to: /tmp/pip-install-11ji9nc2/samplerate_223f7f72bd134c9fbab22e639081d602/build/temp.linux-x86_64-cpython-311/samplerate
[ 14%] Building C object _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/samplerate.c.o
[ 28%] Building C object _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/src_linear.c.o
[ 42%] Building C object _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/src_sinc.c.o
[ 57%] Building C object _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/src_zoh.c.o
[ 71%] Linking C static library libsamplerate.a
[ 71%] Built target samplerate
[ 85%] Building CXX object CMakeFiles/python-samplerate.dir/src/samplerate.cpp.o
[100%] Linking C shared module /tmp/pip-install-11ji9nc2/samplerate_223f7f72bd134c9fbab22e639081d602/build/lib.linux-x86_64-cpython-311/samplerate.cpython-311-x86_64-linux-gnu.so
lto-wrapper: warning: using serial compilation of 4 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: _deps/libsamplerate-build/src/libsamplerate.a(samplerate.c.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/python-samplerate.dir/build.make:99: /tmp/pip-install-11ji9nc2/samplerate_223f7f72bd134c9fbab22e639081d602/build/lib.linux-x86_64-cpython-311/samplerate.cpython-311-x86_64-linux-gnu.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:148: CMakeFiles/python-samplerate.dir/all] Error 2
gmake: *** [Makefile:111: all] Error 2
Traceback (most recent call last):
File "/home/julian/led/lib64/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/julian/led/lib64/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/julian/led/lib64/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 410, in build_wheel
return self._build_with_temp_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 395, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 129, in <module>
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-kvs7ltuy/normal/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 368, in run
self.run_command("build")
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 131, in run
self.run_command(cmd_name)
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 89, in run
_build_ext.run(self)
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
self.build_extensions()
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
self._build_extensions_serial()
File "/tmp/pip-build-env-kvs7ltuy/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
self.build_extension(ext)
File "<string>", line 124, in build_extension
File "/usr/lib64/python3.11/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '--build', '.']' returned non-zero exit status 2.
[end of output]
Also tried clearing cache with same results.
This looks tricky to debug. Can you try to clone from github and build the package manually ? Please paste the output here if it looks useful.
git clone [email protected]:tuxu/python-samplerate.git
cd python-samplerate
VERBOSE=1 python ./setup.py build_ext --inplace
Thanks for the suggestion. The output when compiling the source is similar (to me)
(led) julian@Superhijitus:~/python-samplerate> VERBOSE=1 python ./setup.py build_ext --inplace
/home/julian/python-samplerate/led/lib64/python3.11/site-packages/setuptools/config/pyprojecttoml.py:108: _BetaConfiguration: Support for [tool.setuptools]
in pyproject.toml
is still beta.
warnings.warn(msg, _BetaConfiguration)
running build_ext
Re-run cmake no build system arguments
-- Found Python prefix
-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at build/temp.linux-x86_64-cpython-311/samplerate/_deps/pybind11-src/CMakeLists.txt:8 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument
-- pybind11 v2.10.4 CMake Warning (dev) at build/temp.linux-x86_64-cpython-311/samplerate/_deps/pybind11-src/tools/FindPythonLibsNew.cmake:98 (find_package): Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules are removed. Run "cmake --help-policy CMP0148" for policy details. Use the cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first): build/temp.linux-x86_64-cpython-311/samplerate/_deps/pybind11-src/tools/pybind11Tools.cmake:50 (find_package) build/temp.linux-x86_64-cpython-311/samplerate/_deps/pybind11-src/tools/pybind11Common.cmake:180 (include) build/temp.linux-x86_64-cpython-311/samplerate/_deps/pybind11-src/CMakeLists.txt:208 (include) This warning is for project developers. Use -Wno-dev to suppress it.
-- Found PythonInterp: /home/julian/python-samplerate/led/bin/python (found suitable version "3.11.8", minimum required is "3.6") -- Found PythonLibs: /usr/lib64/libpython3.11.so -- Performing Test HAS_FLTO -- Performing Test HAS_FLTO - Success CMake Deprecation Warning at build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-src/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.
Update the VERSION argument
CMake Deprecation Warning at build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-src/CMakeLists.txt:16 (cmake_policy): The OLD behavior for policy CMP0091 will be removed from a future version of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all policies are deprecated and that a policy should be set to OLD only under specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD.
-- Looking for stdbool.h -- Looking for stdbool.h - found -- Looking for unistd.h -- Looking for unistd.h - found -- Found PkgConfig: /usr/bin/pkg-config (found version "2.1.1") -- Checking processor clipping capabilities... -- Performing Test CPU_CLIPS_POSITIVE -- Performing Test CPU_CLIPS_POSITIVE - Failed -- Performing Test CPU_CLIPS_NEGATIVE -- Performing Test CPU_CLIPS_NEGATIVE - Failed -- Checking processor clipping capabilities... none -- Performing Test HAVE_VISIBILITY -- Performing Test HAVE_VISIBILITY - Success -- Configuring done (60.7s) -- Generating done (0.0s) -- Build files have been written to: /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate Change Dir: '/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate'
Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile /usr/bin/cmake -S/home/julian/python-samplerate -B/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate --check-build-system CMakeFiles/Makefile.cmake 0 /usr/bin/cmake -E cmake_progress_start /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/CMakeFiles /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate//CMakeFiles/progress.marks /usr/bin/gmake -f CMakeFiles/Makefile2 all gmake[1]: Entering directory '/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate' /usr/bin/gmake -f _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/build.make _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/depend gmake[2]: Entering directory '/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate' cd /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/julian/python-samplerate /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-src/src /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-build/src /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/DependInfo.cmake "--color=" gmake[2]: Leaving directory '/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate' /usr/bin/gmake -f _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/build.make _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/build gmake[2]: Entering directory '/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate' [ 14%] Building C object _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/samplerate.c.o cd /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-build/src && /usr/bin/cc -DHAVE_CONFIG_H -I/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-build -I/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-src/include -O3 -DNDEBUG -std=gnu99 -MD -MT _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/samplerate.c.o -MF CMakeFiles/samplerate.dir/samplerate.c.o.d -o CMakeFiles/samplerate.dir/samplerate.c.o -c /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-src/src/samplerate.c [ 28%] Building C object _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/src_linear.c.o cd /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-build/src && /usr/bin/cc -DHAVE_CONFIG_H -I/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-build -I/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-src/include -O3 -DNDEBUG -std=gnu99 -MD -MT _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/src_linear.c.o -MF CMakeFiles/samplerate.dir/src_linear.c.o.d -o CMakeFiles/samplerate.dir/src_linear.c.o -c /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-src/src/src_linear.c [ 42%] Building C object _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/src_sinc.c.o cd /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-build/src && /usr/bin/cc -DHAVE_CONFIG_H -I/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-build -I/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-src/include -O3 -DNDEBUG -std=gnu99 -MD -MT _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/src_sinc.c.o -MF CMakeFiles/samplerate.dir/src_sinc.c.o.d -o CMakeFiles/samplerate.dir/src_sinc.c.o -c /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-src/src/src_sinc.c [ 57%] Building C object _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/src_zoh.c.o cd /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-build/src && /usr/bin/cc -DHAVE_CONFIG_H -I/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-build -I/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-src/include -O3 -DNDEBUG -std=gnu99 -MD -MT _deps/libsamplerate-build/src/CMakeFiles/samplerate.dir/src_zoh.c.o -MF CMakeFiles/samplerate.dir/src_zoh.c.o.d -o CMakeFiles/samplerate.dir/src_zoh.c.o -c /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-src/src/src_zoh.c [ 71%] Linking C static library libsamplerate.a cd /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-build/src && /usr/bin/cmake -P CMakeFiles/samplerate.dir/cmake_clean_target.cmake cd /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/samplerate.dir/link.txt --verbose=1 /usr/bin/ar qc libsamplerate.a CMakeFiles/samplerate.dir/samplerate.c.o CMakeFiles/samplerate.dir/src_linear.c.o CMakeFiles/samplerate.dir/src_sinc.c.o CMakeFiles/samplerate.dir/src_zoh.c.o /usr/bin/ranlib libsamplerate.a gmake[2]: Leaving directory '/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate' [ 71%] Built target samplerate /usr/bin/gmake -f CMakeFiles/python-samplerate.dir/build.make CMakeFiles/python-samplerate.dir/depend gmake[2]: Entering directory '/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate' cd /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/julian/python-samplerate /home/julian/python-samplerate /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/CMakeFiles/python-samplerate.dir/DependInfo.cmake "--color=" gmake[2]: Leaving directory '/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate' /usr/bin/gmake -f CMakeFiles/python-samplerate.dir/build.make CMakeFiles/python-samplerate.dir/build gmake[2]: Entering directory '/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate' [ 85%] Building CXX object CMakeFiles/python-samplerate.dir/src/samplerate.cpp.o /usr/bin/c++ -DLIBSAMPLERATE_VERSION="0.2.2" -DVERSION_INFO="0.0.0" -Dpython_samplerate_EXPORTS -I/home/julian/python-samplerate/./external/libsamplerate/include -I/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/libsamplerate-src/include -isystem /home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate/_deps/pybind11-src/include -isystem /usr/include/python3.11 -O3 -DNDEBUG -fPIC -fvisibility=hidden -std=c++14 -O3 -Wall -Wextra -flto -fno-fat-lto-objects -MD -MT CMakeFiles/python-samplerate.dir/src/samplerate.cpp.o -MF CMakeFiles/python-samplerate.dir/src/samplerate.cpp.o.d -o CMakeFiles/python-samplerate.dir/src/samplerate.cpp.o -c /home/julian/python-samplerate/src/samplerate.cpp [100%] Linking C shared module /home/julian/python-samplerate/build/lib.linux-x86_64-cpython-311/samplerate.cpython-311-x86_64-linux-gnu.so /usr/bin/cmake -E cmake_link_script CMakeFiles/python-samplerate.dir/link.txt --verbose=1 /usr/bin/cc -fPIC -O3 -DNDEBUG -flto -shared -o /home/julian/python-samplerate/build/lib.linux-x86_64-cpython-311/samplerate.cpython-311-x86_64-linux-gnu.so "CMakeFiles/python-samplerate.dir/src/samplerate.cpp.o" _deps/libsamplerate-build/src/libsamplerate.a -lm -lm -lstdc++ -lm lto-wrapper: warning: using serial compilation of 4 LTRANS jobs lto-wrapper: note: see the ‘-flto’ option documentation for more information /usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: _deps/libsamplerate-build/src/libsamplerate.a(samplerate.c.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: failed to set dynamic section sizes: bad value collect2: error: ld returned 1 exit status gmake[2]: *** [CMakeFiles/python-samplerate.dir/build.make:99: /home/julian/python-samplerate/build/lib.linux-x86_64-cpython-311/samplerate.cpython-311-x86_64-linux-gnu.so] Error 1 gmake[2]: Leaving directory '/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate' gmake[1]: *** [CMakeFiles/Makefile2:148: CMakeFiles/python-samplerate.dir/all] Error 2 gmake[1]: Leaving directory '/home/julian/python-samplerate/build/temp.linux-x86_64-cpython-311/samplerate' gmake: *** [Makefile:111: all] Error 2
Traceback (most recent call last):
File "/home/julian/python-samplerate/./setup.py", line 137, in
Thanks for trying. Unfortunately, this is true it does not help so much...
lto-wrapper: warning: using serial compilation of 4 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: _deps/libsamplerate-build/src/libsamplerate.a(samplerate.c.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
There seems to be some issue with dynamic library. I am not sure why since libsamplerate is compiled and linked statically. Googling a little bit it seems these kind of errors can also happen when the file that should be linked cannot be found.
I am very sorry, but it is difficult to help debug without access to this exact system. Maybe try to google around the error message and see if something relevant pops up ? Please update if you find a solution.
I have been researching a bit, and I think the issue could be related to some compiler options. My educated guess is that some package in my system has been compiled with different flags and is running havoc.
I would like to try compiling / linking with other flags such as -fPIC, like suggested by the linker error. But I am not familiar with the build environment of setup.py.
I have tried adding -fPIC in CMakeLists.txt target_compile_options but it doesn't seem to make difference. The option does get pulled somehow (adding an invalid option breaks the build earlier), but the error message still suggests adding -fPIC even after I add it to target_compile_options. Is this the right place to add compiler and linker flags? Thanks
I have been able to fix this by including the proper flag.
CFLAGS="-fPIC" python3 -m pip install samplerate
I'll close topic.
CFLAGS="-fPIC" python3 -m pip install samplerate
LEGENDARY!! I've been struggling with this issue for so long, and I've tried all sorts of methods. But they either caused new bugs or just didn't work. Luckily, I found your response, and it solved the problem perfectly. Thanks, bro. You are a hero!