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

Unable to build on linux #26

Closed
JLenzy opened this issue Feb 6, 2024 · 10 comments
Closed

Unable to build on linux #26

JLenzy opened this issue Feb 6, 2024 · 10 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@JLenzy
Copy link

JLenzy commented Feb 6, 2024

pip install symusic worked fine on my local system, but isn't building on a linux google VM.

Python:
Python 3.9.18

PyPy:
Python 3.7.10 (7.3.5+dfsg-2+deb11u2, Nov 01 2022, 20:16:36) [PyPy 7.3.5 with GCC 10.2.1 20210110

It seems to fail during the CMake build process. Pasting just the end of the error log:

tor<unsigned char, std::allocator<unsigned char> >]’
      /var/tmp/pip-install-bk3m82wb/symusic_80be9b57712b46c19076677986767473/src/io/zpp.cpp:130:1:   required from here
      /var/tmp/pip-install-bk3m82wb/symusic_80be9b57712b46c19076677986767473/3rdparty/zpp_bits/zpp_bits.h:80:30: 
error: ‘__builtin_bit_cast’ was not declared in this scope; did you mean ‘__builtin_strcat’?
         80 |     return __builtin_bit_cast(ToType, from);
            |            ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
            |            __builtin_strcat
      [6/63] Building CXX object CMakeFiles/symusic.dir/src/utils.cpp.o
      [7/63] Building CXX object CMakeFiles/symusic.dir/src/score.cpp.o
      [8/63] Building CXX object CMakeFiles/symusic.dir/src/io/midi.cpp.o
      [9/63] Building CXX object CMakeFiles/symusic.dir/src/conversion.cpp.o
      [10/63] Building CXX object CMakeFiles/symusic.dir/src/track.cpp.o
      ninja: build stopped: subcommand failed.
      
      *** CMake build failed

Any help would be greatly appreciated! This is also preventing me from updating my Miditok installation.

@JLenzy
Copy link
Author

JLenzy commented Feb 6, 2024

Small update, I just tried manually download a different PyPy build and installing it and I'm still getting the error. But here is my new PyPy version:

pypy --version
Python 3.9.18 (9c4f8ef178b6, Jan 14 2024, 11:28:13)
[PyPy 7.3.15 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)]

@Yikai-Liao
Copy link
Owner

Yikai-Liao commented Feb 6, 2024

It's because zpp_bits, serialization library we use, breaks compatibility with anything lower than C++20. And you should use at least gcc11.

@Yikai-Liao
Copy link
Owner

Yikai-Liao commented Feb 6, 2024

I remember that symusic do offer pre-compiled wheels for pypy. I don't quite get why you need to compile it manually.
Is there anything special on google VM? Or we just missed some versions?

@JLenzy
Copy link
Author

JLenzy commented Feb 6, 2024

Initially I haven't tried to compile anything manually. I just did pip install symusic which is what produced the initial error message you see at the top. This is Debian 11 FYI

@Yikai-Liao
Copy link
Owner

I understand. It's my fault. There is something wrong with the github actions, and it failed to upload all the pre-compiled wheels.

Sorry for that, and you could try pip install symusic==0.3.4 first. I will find a way to upload them as soon as possible.

image

@JLenzy
Copy link
Author

JLenzy commented Feb 6, 2024

Perfect - I just tried with 0.3.2 and it worked perfectly. Thank you for your prompt fix!

@Natooz
Copy link
Contributor

Natooz commented Feb 6, 2024

Hi 👋
@JLenzy just pinged me for this (@Yikai-Liao thanks for your reactivity as always! 💪)
Just wanted to add that we could maybe add the --prefer-binary flag somewhere in the install doc?
It is not enabled by default, and pip3.9 will install and build from source pypa/pip#9140

@Yikai-Liao
Copy link
Owner

Yikai-Liao commented Feb 6, 2024

Well, I think it is a temporary issue. --prefer-binary flag means you will install the lastest pre-compiled wheel, and we would pre-compile for almost all the supported platforms (except for windows arm). Therefore, for most of the time, you don't need to take of this flag.

This time, the cibuildwheel image of pypa used in the github acitons had an update that was not forward-compatible and in the runtime we got a warning that the upload-artifact v3 version was too low. So then, we switch to upload-artifact v4, which is still not forward-compatible.

Now it seems that we are not using upload-artifact v4 correctly, and we failed to upload the new pre-compiled wheels. Since for 0.3.5, only source code was successfully uploaded to pypi, any installation of this version will lead to local compilation.

@Yikai-Liao
Copy link
Owner

@JLenzy precompiled wheels for 0.3.5 have been successfully uploaded now🎉

Also thanks for the help of @lzqlzzq

@JLenzy
Copy link
Author

JLenzy commented Feb 6, 2024

Brilliant, thanks again for the prompt fix and excellent library

@JLenzy JLenzy closed this as completed Feb 6, 2024
@Yikai-Liao Yikai-Liao added bug Something isn't working good first issue Good for newcomers labels Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants