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

Installation Error with miditok #155

Closed
LiuZH-19 opened this issue Mar 25, 2024 · 14 comments
Closed

Installation Error with miditok #155

LiuZH-19 opened this issue Mar 25, 2024 · 14 comments
Labels
stale Inactive since 30 days or more

Comments

@LiuZH-19
Copy link

First of all, I would like to express my gratitude for your amazing work. I've been attempting to install miditok, but I encountered an error during the installation process. Unfortunately, I'm not sure how to resolve this issue. Below is the error message I received:

Building wheels for collected packages: symusic
  Building wheel for symusic (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for symusic (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [148 lines of output]
      WARNING: Use cmake.version instead of cmake.minimum-version with scikit-build-core >= 0.8
      WARNING: Use ninja.version instead of ninja.minimum-version with scikit-build-core >= 0.8
      *** scikit-build-core 0.8.2 using CMake 3.28.4 (wheel)
      *** Configuring CMake...
      2024-03-25 18:39:06,821 - scikit_build_core - WARNING - libdir/ldlibrary: xxx/anaconda3/envs/song/lib/libpython3.9.a is not a real file!
      2024-03-25 18:39:06,821 - scikit_build_core - WARNING - Can't find a Python library, got libdir=xxx/anaconda3/envs/song/lib, ldlibrary=libpython3.9.a, multiarch=x86_64-linux-gnu, masd=None
      loading initial cache file /tmp/tmpm8i3h6ds/build/CMakeInit.txt
      -- The C compiler identification is GNU 11.2.0
      -- The CXX compiler identification is GNU 11.2.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /mnt/petrelfs/share/gcc/gcc-11.2.0/bin/gcc - 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: /mnt/petrelfs/share/gcc/gcc-11.2.0/bin/g++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Version: 10.2.2
      -- Build type: Release
      CMake Deprecation Warning at 3rdparty/prestosynth/3rdparty/libsamplerate/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.
      
      
      -- Looking for stdbool.h
      -- Looking for stdbool.h - found
      -- Looking for unistd.h
      -- Looking for unistd.h - found
      -- Looking for immintrin.h
      -- Looking for immintrin.h - found
      -- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.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
      -- Performing Test standard_math_library_linked_to_automatically
      -- Performing Test standard_math_library_linked_to_automatically - Success
      -- Standard libraries to link to explicitly: none
      -- Performing Test COMPILER_SUPPORT_WERROR
      -- Performing Test COMPILER_SUPPORT_WERROR - Success
      -- Performing Test COMPILER_SUPPORT_pedantic
      -- Performing Test COMPILER_SUPPORT_pedantic - Success
      -- Performing Test COMPILER_SUPPORT_Wall
      -- Performing Test COMPILER_SUPPORT_Wall - Success
      -- Performing Test COMPILER_SUPPORT_Wextra
      -- Performing Test COMPILER_SUPPORT_Wextra - Success
      -- Performing Test COMPILER_SUPPORT_Wundef
      -- Performing Test COMPILER_SUPPORT_Wundef - Success
      -- Performing Test COMPILER_SUPPORT_Wcastalign
      -- Performing Test COMPILER_SUPPORT_Wcastalign - Success
      -- Performing Test COMPILER_SUPPORT_Wcharsubscripts
      -- Performing Test COMPILER_SUPPORT_Wcharsubscripts - Success
      -- Performing Test COMPILER_SUPPORT_Wnonvirtualdtor
      -- Performing Test COMPILER_SUPPORT_Wnonvirtualdtor - Success
      -- Performing Test COMPILER_SUPPORT_Wunusedlocaltypedefs
      -- Performing Test COMPILER_SUPPORT_Wunusedlocaltypedefs - Success
      -- Performing Test COMPILER_SUPPORT_Wpointerarith
      -- Performing Test COMPILER_SUPPORT_Wpointerarith - Success
      -- Performing Test COMPILER_SUPPORT_Wwritestrings
      -- Performing Test COMPILER_SUPPORT_Wwritestrings - Success
      -- Performing Test COMPILER_SUPPORT_Wformatsecurity
      -- Performing Test COMPILER_SUPPORT_Wformatsecurity - Success
      -- Performing Test COMPILER_SUPPORT_Wshorten64to32
      -- Performing Test COMPILER_SUPPORT_Wshorten64to32 - Failed
      -- Performing Test COMPILER_SUPPORT_Wlogicalop
      -- Performing Test COMPILER_SUPPORT_Wlogicalop - Success
      -- Performing Test COMPILER_SUPPORT_Wenumconversion
      -- Performing Test COMPILER_SUPPORT_Wenumconversion - Success
      -- Performing Test COMPILER_SUPPORT_Wcpp11extensions
      -- Performing Test COMPILER_SUPPORT_Wcpp11extensions - Failed
      -- Performing Test COMPILER_SUPPORT_Wdoublepromotion
      -- Performing Test COMPILER_SUPPORT_Wdoublepromotion - Success
      -- Performing Test COMPILER_SUPPORT_Wshadow
      -- Performing Test COMPILER_SUPPORT_Wshadow - Success
      -- Performing Test COMPILER_SUPPORT_Wnopsabi
      -- Performing Test COMPILER_SUPPORT_Wnopsabi - Success
      -- Performing Test COMPILER_SUPPORT_Wnovariadicmacros
      -- Performing Test COMPILER_SUPPORT_Wnovariadicmacros - Success
      -- Performing Test COMPILER_SUPPORT_Wnolonglong
      -- Performing Test COMPILER_SUPPORT_Wnolonglong - Success
      -- Performing Test COMPILER_SUPPORT_fnochecknew
      -- Performing Test COMPILER_SUPPORT_fnochecknew - Success
      -- Performing Test COMPILER_SUPPORT_fnocommon
      -- Performing Test COMPILER_SUPPORT_fnocommon - Success
      -- Performing Test COMPILER_SUPPORT_fstrictaliasing
      -- Performing Test COMPILER_SUPPORT_fstrictaliasing - Success
      -- Performing Test COMPILER_SUPPORT_wd981
      -- Performing Test COMPILER_SUPPORT_wd981 - Failed
      -- Performing Test COMPILER_SUPPORT_wd2304
      -- Performing Test COMPILER_SUPPORT_wd2304 - Failed
      -- Performing Test COMPILER_SUPPORT_OPENMP
      -- Performing Test COMPILER_SUPPORT_OPENMP - Success
      -- The Fortran compiler identification is GNU 4.8.5
      -- Found unsuitable Qt version "" from NOTFOUND
      -- Qt4 not found, so disabling the mandelbrot and opengl demos
      CMake Error: File /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/3rdparty/prestosynth/3rdparty/eigen/scripts/buildtests.in does not exist.
      CMake Error at 3rdparty/prestosynth/3rdparty/eigen/scripts/CMakeLists.txt:2 (configure_file):
        configure_file Problem configuring file
      
      
      -- Could NOT find CLANG_FORMAT: Found unsuitable version "0.0", but required is exact version "9" (found CLANG_FORMAT_EXECUTABLE-NOTFOUND)
      --
      -- Configured Eigen 3.4.90
      --
      CMake Deprecation Warning at 3rdparty/prestosynth/3rdparty/gcem/CMakeLists.txt:21 (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.
      
      
      -- GCE-Math version 1.17.0
      -- Performing Test COMPILER_SUPPORTS_CXX11
      -- Performing Test COMPILER_SUPPORTS_CXX11 - Success
      -- The compiler /mnt/petrelfs/share/gcc/gcc-11.2.0/bin/g++ has C++11 support.
      -- prestosynth_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/3rdparty/prestosynth/src/envelope.cpp
      -- prestosynth_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/3rdparty/prestosynth/src/filter.cpp
      -- prestosynth_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/3rdparty/prestosynth/src/lfo.cpp
      -- prestosynth_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/3rdparty/prestosynth/src/soundfont.cpp
      -- prestosynth_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/3rdparty/prestosynth/src/soundfont_internal.cpp
      -- prestosynth_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/3rdparty/prestosynth/src/synthesizer.cpp
      -- symusic_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/src/conversion.cpp
      -- symusic_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/src/event.cpp
      -- symusic_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/src/io/common.cpp
      -- symusic_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/src/io/midi.cpp
      -- symusic_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/src/io/zpp.cpp
      -- symusic_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/src/pianoroll.cpp
      -- symusic_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/src/repr.cpp
      -- symusic_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/src/score.cpp
      -- symusic_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/src/synth.cpp
      -- symusic_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/src/track.cpp
      -- symusic_src: /tmp/pip-install-of9mdylx/symusic_9f927797aabd45ee8ffabab7e2374807/src/utils.cpp
      Building python binding.
      -- Found Python: xxx/bin/python (found version "3.9.17") found components: Interpreter Development.Module
      -- Link-time optimization (LTO) enabled
      -- Configuring incomplete, errors occurred!
      
      *** CMake configuration failed
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for symusic
Failed to build symusic
ERROR: Could not build wheels for symusic, which is required to install pyproject.toml-based projects

Could you please guide me on how to resolve this error? Any help or suggestions would be greatly appreciated.

Thank you for your time and assistance.

@Natooz
Copy link
Owner

Natooz commented Mar 25, 2024

@LiuZH-19 , thank you for your kind message!

It seems that the problem arises when installing symusic, which is the library used in miditok to read, write and manipulate MIDIs files.
Symusic is written in C++, with Python bindings. As such it needs to be compiled to be installed. Normally, pre-compiled binaries are uploaded on pypi so that you do not need to do it.

On which system (OS + cpu arch) are you installing it?
Also, are you installing it with pip and specific flags?

@LiuZH-19
Copy link
Author

I'm trying to install it on Linux with an x86_64 CPU using pip install miditok, without any special flags. What should I do next? Thanks for your help.

@Natooz
Copy link
Owner

Natooz commented Mar 25, 2024

I assume from the logs your Python version is 3.9. It seems that pip cannot find a matching pre-compiled dist for your specific environment.
Could you try to manually download the pre-compiled wheel of symusic and install with pip?

If you have a glibc linux distribution:

wget https://files.pythonhosted.org/packages/f1/6f/af35401ec528326ffd79f30ab58626ab24f5a6bc4a23b55a35b0f5dfda42/symusic-0.4.2-cp39-cp39-manylinux_2_28_x86_64.manylinux_2_27_x86_64.whl
pip install symusic-0.4.2-cp39-cp39-manylinux_2_28_x86_64.manylinux_2_27_x86_64.whl

Otherwise a musl linux distribution:

wget https://files.pythonhosted.org/packages/c4/06/46bbeb91ca1d83f6dc6e0b9b2c49d78d91ff17ada9044ee86e71936871d4/symusic-0.4.2-cp39-cp39-musllinux_1_2_x86_64.whl
pip install symusic-0.4.2-cp39-cp39-musllinux_1_2_x86_64.whl

@LiuZH-19
Copy link
Author

Thank you very much for your patient response. I tried the methods you suggested above, but without success. Ultimately, I managed to install symusic by compiling it from the source code, which also led to the successful installation of miditok. Thank you once again!

git clone --recursive https://github.com/Yikai-Liao/symusic
pip install ./symusic

@xavriley
Copy link

I ran into this as well on a Centos 7 machine with an older version of GLIBC. In my case I didn't manage the server, so I had to install a recent version of gcc using conda:

conda install conda-forge::gcc conda-forge::gxx

and then install symusic with this gcc version (remember to change the paths to point to your conda install):

CC=/homes/jxr01/.conda/envs/mrq/bin/gcc CXX=/homes/jxr01/.conda/envs/mrq/bin/g++ pip install --forcec symusic

This was with python=3.11.5. I found that clang-14 wasn't able to compile symusic, nor were older versions of gcc. Took a while to figure this out!

@Natooz
Copy link
Owner

Natooz commented Mar 29, 2024

Thank you @xavriley for all these details!

Pinging @Yikai-Liao as these info might help to tweak the deployment compilations for the next versions.

Also clang 14.0.0 compiles it with no issue on macOS, but I think 14 is the minimum required version.

@Yikai-Liao
Copy link

Thank you very much for your patient response. I tried the methods you suggested above, but without success. Ultimately, I managed to install symusic by compiling it from the source code, which also led to the successful installation of miditok. Thank you once again!

git clone --recursive https://github.com/Yikai-Liao/symusic
pip install ./symusic

@LiuZH-19 It's strange. Theoretically, if pip falls back to compiling from source, this should works the same as installing symusic manually from github. I'll try to find out what's wrong with the source distribution.

And could you please show me you glibc version by ldd --version? Same as @xavriley, I also suspect that it's the glibc version that causes the pre-compiled version match to fail

@LiuZH-19
Copy link
Author

@Yikai-Liao, thank you very much. My glibc version is ldd (GNU libc) 2.17. It seems that the glibc version is indeed causing the mismatch with the pre-compiled version.

@Yikai-Liao
Copy link

@LiuZH-19 Yes. The pre-compiled version requires glibc 2.27+. And this is something limited by the ubuntu 22.04 build platform in github actions.

@lzqlzzq
Copy link

lzqlzzq commented Mar 30, 2024

@Yikai-Liao, thank you very much. My glibc version is ldd (GNU libc) 2.17. It seems that the glibc version is indeed causing the mismatch with the pre-compiled version.

Also version of glibc in github actions Ubuntu 20.04 runners is fairly new. We will try to deal with the compatibility problem.
image
image

@Yikai-Liao
Copy link

The compilation error in source distribution has been fixed in symusic 0.4.4 🎉

@lzqlzzq
Copy link

lzqlzzq commented Apr 5, 2024

Seems we would stuck on build from source if not compatible for a while:
actions/runner-images#9593

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Inactive since 30 days or more label Apr 27, 2024
Copy link

github-actions bot commented May 5, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Inactive since 30 days or more
Projects
None yet
Development

No branches or pull requests

5 participants