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

Cannot build pywhispercpp due to an error in the OpenMP condition/check in cmake #94

Open
Brainiarc7 opened this issue Dec 31, 2024 · 17 comments

Comments

@Brainiarc7
Copy link

Following the wiki's instructions, namely building from source with pip on a CUDA-enabled environment, I run into the error(s):

       -- Found Git: /usr/bin/git (found version "2.34.1")
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
       -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
       -- Found Threads: TRUE
       -- Found OpenMP_C: -fopenmp (found version "4.5")
       CMake Error at /tmp/pip-build-env-h39djzmn/overlay/local/lib/python3.10/dist-packages/cmake/data/share/cmake-3.31/Modules/FindOpenMP.cmake:644 (if):
         if given arguments:
       
           "CMAKE_C_COMPILER_ID" "STREQUAL" "Fujitsu" "OR" "STREQUAL" "IntelLLVM"
       
         Unknown arguments specified
       Call Stack (most recent call first):
         whisper.cpp/ggml/src/CMakeLists.txt:154 (find_package)
       
       
       -- Configuring incomplete, errors occurred!

This happens on both the main and the current release tag.

This is an Ubuntu 22.04LTS machine, with CUDA and the relevant developer-related packages installed.
For sanity checks, I've also installed the OpenMP-related packages:

sudo apt install openmpi-bin openmpi-common libopenmpi-dev libomp-dev

To no avail.

Any pointers?

@Brainiarc7
Copy link
Author

Also, attempting to generate the wheel via:

GGML_CUDA=1 GGML_VULKAN=1 GGML_SYCL=1 python3 -m build --wheel .

Results in the same build failure as before.

@absadiki
Copy link
Owner

absadiki commented Dec 31, 2024

@Brainiarc7, does the build work without any accelerators flag (i.e., CPU only)?

@Brainiarc7
Copy link
Author

Brainiarc7 commented Dec 31, 2024

No, it's still broken.
The only branch that builds correctly is v1.2.0.
Possibly related to this comment on #37

To get it building, the branch v1.2.0 and the referenced commit hash in the linked issue are needed.

@absadiki
Copy link
Owner

Probably related, but I think those issues are already solved.
I believe the issue here might be a version mismatch or something wrong with OpenMP.

Here are some things you can try:

  • Build the package with OpenMP off: GGML_OPENMP=OFF python3 -m build --wheel .
  • Downgrade CMake to version 3.22.1.
  • Delete the OpenMP libraries or check their compatibility with the CMake version you're using.

@Brainiarc7
Copy link
Author

Hmm, now running into a new build failure:

29.16       -- Found Git: /usr/bin/git (found version "2.43.0")
29.16       -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
29.16       -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
29.16       -- Found Threads: TRUE
29.16       -- Found CUDAToolkit: /usr/local/cuda/targets/x86_64-linux/include (found version "12.6.85")
29.16       CMake Warning at /tmp/pip-build-env-ga_65wx2/overlay/local/lib/python3.12/dist-packages/cmake/data/share/cmake-3.31/Modules/FindCUDAToolkit.cmake:1216 (message):
29.16         Could not find librt library, needed by CUDA::cudart_static
29.16       Call Stack (most recent call first):
29.16         whisper.cpp/ggml/src/CMakeLists.txt:273 (find_package)
29.16       
29.16       
29.16       -- CUDA found
29.16       -- Using CUDA architectures: 52;61;70;75
29.16       CMake Error at /tmp/pip-build-env-ga_65wx2/overlay/local/lib/python3.12/dist-packages/cmake/data/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:865 (message):
29.16         Compiling the CUDA compiler identification source file
29.16         "CMakeCUDACompilerId.cu" failed.
29.16       
29.16         Compiler: /usr/local/cuda/bin/nvcc
29.16       
29.16         Build flags:
29.16       
29.16         Id flags: --keep;--keep-dir;tmp -v
29.16       
29.16       
29.16       
29.16         The output was:
29.16       
29.16         1
29.16       
29.16         #$ _NVVM_BRANCH_=nvvm
29.16       
29.16         #$ _SPACE_=
29.16       
29.16         #$ _CUDART_=cudart
29.16       
29.16         #$ _HERE_=/usr/local/cuda/bin
29.16       
29.16         #$ _THERE_=/usr/local/cuda/bin
29.16       
29.16         #$ _TARGET_SIZE_=
29.16       
29.16         #$ _TARGET_DIR_=
29.16       
29.16         #$ _TARGET_DIR_=targets/x86_64-linux
29.16       
29.16         #$ TOP=/usr/local/cuda/bin/..
29.16       
29.16         #$ CICC_PATH=/usr/local/cuda/bin/../nvvm/bin
29.16       
29.16         #$ NVVMIR_LIBRARY_DIR=/usr/local/cuda/bin/../nvvm/libdevice
29.16       
29.16         #$ LD_LIBRARY_PATH=/usr/local/cuda/bin/../lib:
29.16       
29.16         #$
29.16         PATH=/usr/local/cuda/bin/../nvvm/bin:/usr/local/cuda/bin:/tmp/pip-build-env-ga_65wx2/overlay/local/bin:/tmp/pip-build-env-ga_65wx2/normal/local/bin:/usr/local/cuda/bin:/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
29.16       
29.16       
29.16         #$ INCLUDES="-I/usr/local/cuda/bin/../targets/x86_64-linux/include"
29.16       
29.16         #$ LIBRARIES= "-L/usr/local/cuda/bin/../targets/x86_64-linux/lib/stubs"
29.16         "-L/usr/local/cuda/bin/../targets/x86_64-linux/lib"
29.16       
29.16         #$ CUDAFE_FLAGS=
29.16       
29.16         #$ PTXAS_FLAGS=
29.16       
29.16         #$ rm tmp/a_dlink.reg.c
29.16       
29.16         #$ gcc -D__CUDA_ARCH_LIST__=520 -D__NV_LEGACY_LAUNCH -E -x c++ -D__CUDACC__
29.16         -D__NVCC__ "-I/usr/local/cuda/bin/../targets/x86_64-linux/include"
29.16         -D__CUDACC_VER_MAJOR__=12 -D__CUDACC_VER_MINOR__=6
29.16         -D__CUDACC_VER_BUILD__=85 -D__CUDA_API_VER_MAJOR__=12
29.16         -D__CUDA_API_VER_MINOR__=6 -D__NVCC_DIAG_PRAGMA_SUPPORT__=1 -include
29.16         "cuda_runtime.h" -m64 "CMakeCUDACompilerId.cu" -o
29.16         "tmp/CMakeCUDACompilerId.cpp4.ii"
29.16       
29.16         CMakeCUDACompilerId.cu:16:11: error: macro names must be identifiers
29.16       
29.16            16 | #  define /usr/localSIMULATE_ID "GNU"
29.16               |           ^
29.16       
29.16         CMakeCUDACompilerId.cu:19:11: error: macro names must be identifiers
29.16       
29.16            19 | #  define /usr/localCOMPILER_VERSION_MAJOR DEC(__CUDACC_VER_MAJOR__)
29.16               |           ^
29.16       
29.16         CMakeCUDACompilerId.cu:20:11: error: macro names must be identifiers
29.16       
29.16            20 | #  define /usr/localCOMPILER_VERSION_MINOR DEC(__CUDACC_VER_MINOR__)
29.16               |           ^
29.16       
29.16         CMakeCUDACompilerId.cu:21:11: error: macro names must be identifiers
29.16       
29.16            21 | #  define /usr/localCOMPILER_VERSION_PATCH DEC(__CUDACC_VER_BUILD__)
29.16               |           ^
29.16       
29.16         CMakeCUDACompilerId.cu:31:11: error: macro names must be identifiers
29.16       
29.16            31 | #  define /usr/localSIMULATE_VERSION_MAJOR DEC(__GNUC__)
29.16               |           ^
29.16       
29.16         CMakeCUDACompilerId.cu:32:11: error: macro names must be identifiers
29.16       
29.16            32 | #  define /usr/localSIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
29.16               |           ^
29.16       
29.16         # --error 0x1 --
29.16       
29.16       
29.16       
29.16       
29.16       
29.16       Call Stack (most recent call first):
29.16         /tmp/pip-build-env-ga_65wx2/overlay/local/lib/python3.12/dist-packages/cmake/data/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
29.16         /tmp/pip-build-env-ga_65wx2/overlay/local/lib/python3.12/dist-packages/cmake/data/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test)
29.16         /tmp/pip-build-env-ga_65wx2/overlay/local/lib/python3.12/dist-packages/cmake/data/share/cmake-3.31/Modules/CMakeDetermineCUDACompiler.cmake:131 (CMAKE_DETERMINE_COMPILER_ID)
29.16         whisper.cpp/ggml/src/CMakeLists.txt:296 (enable_language)
29.16       
29.16       
29.16       -- Configuring incomplete, errors occurred!

CUDA-related?

@Brainiarc7
Copy link
Author

And with GGML_OPENMP=OFF and CUDA disabled, the error log is as shown:

18.08   × Building wheel for pywhispercpp (pyproject.toml) did not run successfully.
18.08   │ exit code: 1
18.08   ╰─> [163 lines of output]
18.08       running bdist_wheel
18.08       running build
18.08       running build_py
18.08       creating build/lib.linux-x86_64-cpython-312/pywhispercpp
18.08       copying ./pywhispercpp/constants.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp
18.08       copying ./pywhispercpp/__init__.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp
18.08       copying ./pywhispercpp/utils.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp
18.08       copying ./pywhispercpp/model.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp
18.08       creating build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
18.08       copying ./pywhispercpp/examples/recording.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
18.08       copying ./pywhispercpp/examples/assistant.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
18.08       copying ./pywhispercpp/examples/__init__.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
18.08       copying ./pywhispercpp/examples/main.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
18.08       copying ./pywhispercpp/examples/livestream.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
18.08       running egg_info
18.08       writing pywhispercpp.egg-info/PKG-INFO
18.08       writing dependency_links to pywhispercpp.egg-info/dependency_links.txt
18.08       writing entry points to pywhispercpp.egg-info/entry_points.txt
18.08       writing requirements to pywhispercpp.egg-info/requires.txt
18.08       writing top-level names to pywhispercpp.egg-info/top_level.txt
18.08       reading manifest template 'MANIFEST.in'
18.08       warning: no files found matching 'version.txt'
18.08       warning: no previously-included files found matching 'whisper.cpp/**/*.o'
18.08       warning: no previously-included files found matching 'whisper.cpp/**/*.so'
18.08       warning: no previously-included files found matching 'whisper.cpp/**/*.a'
18.08       warning: no previously-included files found matching 'whisper.cpp/**/*.dylib'
18.08       warning: no previously-included files found matching 'whisper.cpp/**/*.dll'
18.08       warning: no previously-included files found matching 'whisper.cpp/**/*.lib'
18.08       adding license file 'LICENSE'
18.08       writing manifest file 'pywhispercpp.egg-info/SOURCES.txt'
18.08       running build_ext
18.08       -- The C compiler identification is unknown
18.08       -- The CXX compiler identification is unknown
18.08       -- Detecting C compiler ABI info
18.08       -- Detecting C compiler ABI info - done
18.08       -- Check for working C compiler: /usr/bin/cc - skipped
18.08       -- Detecting CXX compiler ABI info
18.08       -- Detecting CXX compiler ABI info - done
18.08       -- Check for working CXX compiler: /usr/bin/c++ - skipped
18.08       CMake Deprecation Warning at pybind11/CMakeLists.txt:8 (cmake_minimum_required):
18.08         Compatibility with CMake < 3.10 will be removed from a future version of
18.08         CMake.
18.08       
18.08         Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
18.08         to tell CMake that the project requires at least <min> but has been updated
18.08         to work with policies introduced by <max> or earlier.
18.08       
18.08       
18.08       -- pybind11 v2.9.2
18.08       CMake Warning (dev) at pybind11/tools/FindPythonLibsNew.cmake:98 (find_package):
18.08         Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
18.08         are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
18.08         the cmake_policy command to set the policy and suppress this warning.
18.08       
18.08       Call Stack (most recent call first):
18.08         pybind11/tools/pybind11Tools.cmake:50 (find_package)
18.08         pybind11/tools/pybind11Common.cmake:206 (include)
18.08         pybind11/CMakeLists.txt:200 (include)
18.08       This warning is for project developers.  Use -Wno-dev to suppress it.
18.08       
18.08       -- Found PythonInterp: /usr/bin/python3 (found version "3.12.3")
18.08       -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.12.so
18.08       CMake Deprecation Warning at whisper.cpp/CMakeLists.txt:1 (cmake_minimum_required):
18.08         Compatibility with CMake < 3.10 will be removed from a future version of
18.08         CMake.
18.08       
18.08         Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
18.08         to tell CMake that the project requires at least <min> but has been updated
18.08         to work with policies introduced by <max> or earlier.
18.08       
18.08       
18.08       -- Found Git: /usr/bin/git (found version "2.43.0")
18.08       -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
18.08       -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
18.08       -- Found Threads: TRUE
18.08       CMake Error at whisper.cpp/ggml/src/CMakeLists.txt:934 (get_flags):
18.08         get_flags Function invoked with incorrect arguments for function named:
18.08         get_flags
18.08       
18.08       
18.08       -- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF
18.08       -- CMAKE_SYSTEM_PROCESSOR: x86_64
18.08       -- x86 detected
18.08       CMake Error at whisper.cpp/ggml/src/CMakeLists.txt:1311 (target_compile_features):
18.08         target_compile_features no known features for C compiler
18.08       
18.08         ""
18.08       
18.08         version .
18.08       
18.08       
18.08       CMake Error at whisper.cpp/src/CMakeLists.txt:125 (target_compile_features):
18.08         target_compile_features no known features for CXX compiler
18.08       
18.08         ""
18.08       
18.08         version .
18.08       
18.08       
18.08       -- Configuring incomplete, errors occurred!

And again, this is on both master and the release point v1.3.0.

@absadiki
Copy link
Owner

absadiki commented Jan 1, 2025

I think you're using a very old CMake version. That's probably the issue.
Please update it to at least version 3.22 or newer and see if that resolves the problem ?

@Brainiarc7
Copy link
Author

I installed cmake from both the package manager and from pip.
Will reinstall and verify.

@absadiki
Copy link
Owner

absadiki commented Jan 1, 2025

From the logs, it shows that you're using a version < 3.10.
You can check with cmake --version

@Brainiarc7
Copy link
Author

Understood, will install from source and report back.

@Brainiarc7
Copy link
Author

Hmm, we have a problem.

I installed cmake from source, using this tree, and can indeed confirm that the version returned is correct.

However, It seems that at some point, the build process is fetching it's own version of cmake, separate from what's installed from source:

0.175 Cloning into '/tmp/pywhispercpp'...
2.111 Note: switching to '0ee6d8d979c12df85524204a1b4921d5bec622ba'.
2.111 
2.111 You are in 'detached HEAD' state. You can look around, make experimental
2.111 changes and commit them, and you can discard any commits you make in this
2.111 state without impacting any branches by switching back to a branch.
2.111 
2.111 If you want to create a new branch to retain commits you create, you may
2.111 do so (now or later) by using -c with the switch command. Example:
2.111 
2.111   git switch -c <new-branch-name>
2.111 
2.111 Or undo this operation with:
2.111 
2.111   git switch -
2.111 
2.111 Turn off this advice by setting config variable advice.detachedHead to false
2.111 
2.152 Submodule 'whisper.cpp' (https://github.com/ggerganov/whisper.cpp.git) registered for path 'whisper.cpp'
2.155 Cloning into '/tmp/pywhispercpp/whisper.cpp'...
9.320 Submodule path 'whisper.cpp': checked out '9e3c5345cd46ea718209db53464e426c3fe7a25e'
9.650 Processing /tmp/pywhispercpp
9.652   Installing build dependencies: started
19.92   Installing build dependencies: finished with status 'done'
19.93   Getting requirements to build wheel: started
20.15   Getting requirements to build wheel: finished with status 'done'
20.15   Preparing metadata (pyproject.toml): started
20.34   Preparing metadata (pyproject.toml): finished with status 'done'
20.34 Requirement already satisfied: numpy in /usr/local/lib/python3.12/dist-packages (from pywhispercpp==1.3.0) (2.2.1)
20.62 Collecting requests (from pywhispercpp==1.3.0)
20.86   Downloading requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
21.05 Collecting tqdm (from pywhispercpp==1.3.0)
21.12   Downloading tqdm-4.67.1-py3-none-any.whl.metadata (57 kB)
21.23      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.7/57.7 kB 504.4 kB/s eta 0:00:00
21.32 Collecting platformdirs (from pywhispercpp==1.3.0)
21.39   Downloading platformdirs-4.3.6-py3-none-any.whl.metadata (11 kB)
21.61 Collecting charset-normalizer<4,>=2 (from requests->pywhispercpp==1.3.0)
21.68   Downloading charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (35 kB)
21.79 Collecting idna<4,>=2.5 (from requests->pywhispercpp==1.3.0)
21.86   Downloading idna-3.10-py3-none-any.whl.metadata (10 kB)
21.97 Collecting urllib3<3,>=1.21.1 (from requests->pywhispercpp==1.3.0)
22.04   Downloading urllib3-2.3.0-py3-none-any.whl.metadata (6.5 kB)
22.13 Collecting certifi>=2017.4.17 (from requests->pywhispercpp==1.3.0)
22.21   Downloading certifi-2024.12.14-py3-none-any.whl.metadata (2.3 kB)
22.30 Downloading platformdirs-4.3.6-py3-none-any.whl (18 kB)
22.38 Downloading requests-2.32.3-py3-none-any.whl (64 kB)
22.41    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.9/64.9 kB 2.5 MB/s eta 0:00:00
22.48 Downloading tqdm-4.67.1-py3-none-any.whl (78 kB)
22.51    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.5/78.5 kB 3.1 MB/s eta 0:00:00
22.58 Downloading certifi-2024.12.14-py3-none-any.whl (164 kB)
22.66    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 164.9/164.9 kB 2.1 MB/s eta 0:00:00
22.73 Downloading charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (145 kB)
22.75    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 145.3/145.3 kB 7.3 MB/s eta 0:00:00
22.83 Downloading idna-3.10-py3-none-any.whl (70 kB)
22.84    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 70.4/70.4 kB 5.3 MB/s eta 0:00:00
22.91 Downloading urllib3-2.3.0-py3-none-any.whl (128 kB)
22.93    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 128.4/128.4 kB 6.4 MB/s eta 0:00:00
22.94 Building wheels for collected packages: pywhispercpp
22.94   Building wheel for pywhispercpp (pyproject.toml): started
23.74   Building wheel for pywhispercpp (pyproject.toml): finished with status 'error'
23.75   error: subprocess-exited-with-error
23.75   
23.75   × Building wheel for pywhispercpp (pyproject.toml) did not run successfully.
23.75   │ exit code: 1
23.75   ╰─> [163 lines of output]
23.75       running bdist_wheel
23.75       running build
23.75       running build_py
23.75       creating build/lib.linux-x86_64-cpython-312/pywhispercpp
23.75       copying ./pywhispercpp/constants.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp
23.75       copying ./pywhispercpp/__init__.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp
23.75       copying ./pywhispercpp/utils.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp
23.75       copying ./pywhispercpp/model.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp
23.75       creating build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
23.75       copying ./pywhispercpp/examples/recording.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
23.75       copying ./pywhispercpp/examples/assistant.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
23.75       copying ./pywhispercpp/examples/__init__.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
23.75       copying ./pywhispercpp/examples/main.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
23.75       copying ./pywhispercpp/examples/livestream.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
23.75       running egg_info
23.75       writing pywhispercpp.egg-info/PKG-INFO
23.75       writing dependency_links to pywhispercpp.egg-info/dependency_links.txt
23.75       writing entry points to pywhispercpp.egg-info/entry_points.txt
23.75       writing requirements to pywhispercpp.egg-info/requires.txt
23.75       writing top-level names to pywhispercpp.egg-info/top_level.txt
23.75       reading manifest template 'MANIFEST.in'
23.75       warning: no files found matching 'version.txt'
23.75       warning: no previously-included files found matching 'whisper.cpp/**/*.o'
23.75       warning: no previously-included files found matching 'whisper.cpp/**/*.so'
23.75       warning: no previously-included files found matching 'whisper.cpp/**/*.a'
23.75       warning: no previously-included files found matching 'whisper.cpp/**/*.dylib'
23.75       warning: no previously-included files found matching 'whisper.cpp/**/*.dll'
23.75       warning: no previously-included files found matching 'whisper.cpp/**/*.lib'
23.75       adding license file 'LICENSE'
23.75       writing manifest file 'pywhispercpp.egg-info/SOURCES.txt'
23.75       running build_ext
23.75       -- The C compiler identification is unknown
23.75       -- The CXX compiler identification is unknown
23.75       -- Detecting C compiler ABI info
23.75       -- Detecting C compiler ABI info - done
23.75       -- Check for working C compiler: /usr/bin/cc - skipped
23.75       -- Detecting CXX compiler ABI info
23.75       -- Detecting CXX compiler ABI info - done
23.75       -- Check for working CXX compiler: /usr/bin/c++ - skipped
23.75       CMake Deprecation Warning at pybind11/CMakeLists.txt:8 (cmake_minimum_required):
23.75         Compatibility with CMake < 3.10 will be removed from a future version of
23.75         CMake.
23.75       
23.75         Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
23.75         to tell CMake that the project requires at least <min> but has been updated
23.75         to work with policies introduced by <max> or earlier.
23.75       
23.75       
23.75       -- pybind11 v2.9.2
23.75       CMake Warning (dev) at pybind11/tools/FindPythonLibsNew.cmake:98 (find_package):
23.75         Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
23.75         are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
23.75         the cmake_policy command to set the policy and suppress this warning.
23.75       
23.75       Call Stack (most recent call first):
23.75         pybind11/tools/pybind11Tools.cmake:50 (find_package)
23.75         pybind11/tools/pybind11Common.cmake:206 (include)
23.75         pybind11/CMakeLists.txt:200 (include)
23.75       This warning is for project developers.  Use -Wno-dev to suppress it.
23.75       
23.75       -- Found PythonInterp: /usr/bin/python3 (found version "3.12.3")
23.75       -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.12.so
23.75       CMake Deprecation Warning at whisper.cpp/CMakeLists.txt:1 (cmake_minimum_required):
23.75         Compatibility with CMake < 3.10 will be removed from a future version of
23.75         CMake.
23.75       
23.75         Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
23.75         to tell CMake that the project requires at least <min> but has been updated
23.75         to work with policies introduced by <max> or earlier.
23.75       
23.75       
23.75       -- Found Git: /usr/bin/git (found version "2.43.0")
23.75       -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
23.75       -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
23.75       -- Found Threads: TRUE
23.75       CMake Error at whisper.cpp/ggml/src/CMakeLists.txt:934 (get_flags):
23.75         get_flags Function invoked with incorrect arguments for function named:
23.75         get_flags
23.75       
23.75       
23.75       -- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF
23.75       -- CMAKE_SYSTEM_PROCESSOR: x86_64
23.75       -- x86 detected
23.75       CMake Error at whisper.cpp/ggml/src/CMakeLists.txt:1311 (target_compile_features):
23.75         target_compile_features no known features for C compiler
23.75       
23.75         ""
23.75       
23.75         version .
23.75       
23.75       
23.75       CMake Error at whisper.cpp/src/CMakeLists.txt:125 (target_compile_features):
23.75         target_compile_features no known features for CXX compiler
23.75       
23.75         ""
23.75       
23.75         version .
23.75       
23.75       
23.75       -- Configuring incomplete, errors occurred!

This is more clear when building the wheel via:

GGML_CUDA=1 GGML_VULKAN=1 python3 -m build --wheel .

In the source directory.
Logs:

2.094 Submodule 'whisper.cpp' (https://github.com/ggerganov/whisper.cpp.git) registered for path 'whisper.cpp'
2.096 Cloning into '/tmp/pywhispercpp/whisper.cpp'...
7.548 Submodule path 'whisper.cpp': checked out '9e3c5345cd46ea718209db53464e426c3fe7a25e'
7.598 * Creating isolated environment: venv+pip...
7.600 * Installing packages in isolated environment:
15.41   - cmake>=3.12
15.41   - ninja
15.41   - repairwheel
15.41   - setuptools-scm>=8
15.41   - setuptools>=42
15.41   - wheel
15.41 * Getting build dependencies for wheel...
15.66 running egg_info
15.66 creating pywhispercpp.egg-info
15.66 writing pywhispercpp.egg-info/PKG-INFO
15.66 writing dependency_links to pywhispercpp.egg-info/dependency_links.txt
15.66 writing entry points to pywhispercpp.egg-info/entry_points.txt
15.66 writing requirements to pywhispercpp.egg-info/requires.txt
15.66 writing top-level names to pywhispercpp.egg-info/top_level.txt
15.66 writing manifest file 'pywhispercpp.egg-info/SOURCES.txt'
15.70 reading manifest template 'MANIFEST.in'
15.70 warning: no files found matching 'version.txt'
15.72 warning: no previously-included files found matching 'whisper.cpp/**/*.o'
15.72 warning: no previously-included files found matching 'whisper.cpp/**/*.so'
15.72 warning: no previously-included files found matching 'whisper.cpp/**/*.a'
15.72 warning: no previously-included files found matching 'whisper.cpp/**/*.dylib'
15.72 warning: no previously-included files found matching 'whisper.cpp/**/*.dll'
15.72 adding license file 'LICENSE'
15.72 warning: no previously-included files found matching 'whisper.cpp/**/*.lib'
15.72 writing manifest file 'pywhispercpp.egg-info/SOURCES.txt'
15.73 * Building wheel...
15.84 running bdist_wheel
15.84 running build
15.84 running build_py
15.84 creating build/lib.linux-x86_64-cpython-312/pywhispercpp
15.84 copying ./pywhispercpp/constants.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp
15.84 copying ./pywhispercpp/__init__.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp
15.84 copying ./pywhispercpp/utils.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp
15.85 copying ./pywhispercpp/model.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp
15.85 creating build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
15.85 copying ./pywhispercpp/examples/recording.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
15.85 copying ./pywhispercpp/examples/assistant.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
15.85 copying ./pywhispercpp/examples/__init__.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
15.85 copying ./pywhispercpp/examples/main.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
15.85 copying ./pywhispercpp/examples/livestream.py -> build/lib.linux-x86_64-cpython-312/pywhispercpp/examples
15.85 running egg_info
15.85 writing pywhispercpp.egg-info/PKG-INFO
15.85 writing dependency_links to pywhispercpp.egg-info/dependency_links.txt
15.85 writing entry points to pywhispercpp.egg-info/entry_points.txt
15.85 writing requirements to pywhispercpp.egg-info/requires.txt
15.85 writing top-level names to pywhispercpp.egg-info/top_level.txt
15.87 reading manifest template 'MANIFEST.in'
15.87 warning: no files found matching 'version.txt'
15.89 warning: no previously-included files found matching 'whisper.cpp/**/*.o'
15.89 warning: no previously-included files found matching 'whisper.cpp/**/*.so'
15.89 warning: no previously-included files found matching 'whisper.cpp/**/*.a'
15.89 warning: no previously-included files found matching 'whisper.cpp/**/*.dylib'
15.89 warning: no previously-included files found matching 'whisper.cpp/**/*.dll'
15.89 adding license file 'LICENSE'
15.89 warning: no previously-included files found matching 'whisper.cpp/**/*.lib'
15.89 writing manifest file 'pywhispercpp.egg-info/SOURCES.txt'
15.89 running build_ext
16.11 -- The C compiler identification is unknown
16.24 -- The CXX compiler identification is unknown
16.24 -- Detecting C compiler ABI info
16.28 -- Detecting C compiler ABI info - done
16.28 -- Check for working C compiler: /usr/bin/cc - skipped
16.28 -- Detecting CXX compiler ABI info
16.33 -- Detecting CXX compiler ABI info - done
16.33 -- Check for working CXX compiler: /usr/bin/c++ - skipped
16.33 CMake Deprecation Warning at pybind11/CMakeLists.txt:8 (cmake_minimum_required):
16.33   Compatibility with CMake < 3.10 will be removed from a future version of
16.33   CMake.
16.33 
16.33   Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
16.33   to tell CMake that the project requires at least <min> but has been updated
16.33   to work with policies introduced by <max> or earlier.
16.33 
16.33 
16.33 -- pybind11 v2.9.2 
16.33 CMake Warning (dev) at pybind11/tools/FindPythonLibsNew.cmake:98 (find_package):
16.33   Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
16.33   are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
16.33   the cmake_policy command to set the policy and suppress this warning.
16.33 
16.33 Call Stack (most recent call first):
16.33   pybind11/tools/pybind11Tools.cmake:50 (find_package)
16.33   pybind11/tools/pybind11Common.cmake:206 (include)
16.33   pybind11/CMakeLists.txt:200 (include)
16.33 This warning is for project developers.  Use -Wno-dev to suppress it.
16.33 
16.34 -- Found PythonInterp: /tmp/build-env-z57yjyn2/bin/python (found version "3.12.3")
16.36 -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.12.so
16.36 CMake Deprecation Warning at whisper.cpp/CMakeLists.txt:1 (cmake_minimum_required):
16.36   Compatibility with CMake < 3.10 will be removed from a future version of
16.36   CMake.
16.36 
16.36   Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
16.36   to tell CMake that the project requires at least <min> but has been updated
16.36   to work with policies introduced by <max> or earlier.
16.36 
16.36 
16.36 -- Found Git: /usr/bin/git (found version "2.43.0")
16.38 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
16.41 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
16.41 -- Found Threads: TRUE
16.58 -- Found OpenMP_C: -fopenmp (found version "4.5")
16.58 CMake Error at /tmp/build-env-z57yjyn2/lib/python3.12/site-packages/cmake/data/share/cmake-3.31/Modules/FindOpenMP.cmake:644 (if):
16.58   if given arguments:
16.58 
16.58     "CMAKE_C_COMPILER_ID" "STREQUAL" "Fujitsu" "OR" "STREQUAL" "IntelLLVM"
16.58 
16.58   Unknown arguments specified
16.58 Call Stack (most recent call first):
16.58   whisper.cpp/ggml/src/CMakeLists.txt:154 (find_package)
16.58 
16.58 
16.58 -- Configuring incomplete, errors occurred!

@absadiki
Copy link
Owner

absadiki commented Jan 1, 2025

Oh, sorry. I thought the error was due to the CMake version, but that was just a warning.
The error is here:

CMake Error at whisper.cpp/ggml/src/CMakeLists.txt:934 (get_flags):
23.75         get_flags Function invoked with incorrect arguments for function named:
23.75         get_flags

What commit hash of whisper.cpp are you compiling against? Are you pulling the latest commit by any chance?
I just tested it locally with the commit hash from the repo, and it compiled successfully.
Have you tried compiling whisper.cpp on its own?

@Brainiarc7
Copy link
Author

Brainiarc7 commented Jan 1, 2025 via email

@Brainiarc7
Copy link
Author

The only build that works on my environment is by:

git clone --branch v1.2.0 --recursive https://github.com/absadiki/pywhispercpp.git 
cd pywhispercpp && \
git checkout eb22513c3524fe721e326665673395ad0a9d7cb7 
GGML_CUDA=1 GGML_VULKAN=1 python3 -m build --wheel . 
python3 -m pip install --break-system-packages dist/*.whl

This is on Ubuntu 24.04LTS.

@absadiki
Copy link
Owner

absadiki commented Jan 1, 2025

I pull / clone the pywhispercpp tree as-is. A trivial git clone --recursive invocation to fetch the code. I can also build whispercpp directly with no issues.

Now, that's weird! If you can compile whispercpp, then what could be wrong? The Python setup is just calling CMake under the hood.
The CI for the main branch on Ubuntu-latest was successful 3 days ago as well.

@Brainiarc7
Copy link
Author

Brainiarc7 commented Jan 1, 2025 via email

@absadiki
Copy link
Owner

absadiki commented Jan 1, 2025

Another thing probably you can try is to downgrade Python to 3.11.
Also make sure to create a separate virtual environnement from the system wide installation.

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

2 participants