-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Doubts while using -s USE_SDL=2 #24394
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
Comments
Problem : While building locally through macos, we see this And everything works fine and we get the output as expected But while building on linux, we see this Importantly
i) in the ci, you can the sdl2 port being put to use ( https://github.com/compiler-research/xeus-cpp/actions/runs/15154294457/job/42606024480#step:5:139 ) ii) The cmakelists.txt done nothing different for macos or ubuntu (https://github.com/compiler-research/xeus-cpp/blob/main/CMakeLists.txt#L439) iii) As a hack around on linux machine, while building locally we see that it might just a timing issue.
|
I fail to understand what's going wrong here. |
I am seeing the same issue in a different guise. We use the docker image and cmake. During the cmake configure I get
Cause is the same as @anutosh491's problem, the SDL headers and lib are not installed. This problem started in either 4.0.8 or 4.0.9. 4.0.7 worked fine. I tried changing I have not yet managed to find the release notes to see if there is any mention there of a change to how to use SDL. |
@anutosh491 please edit the issue description to say that SDL2 is missing. |
I found them, |
Hey @MarkCallow I forgot to mention a very important point above. Which is that I am using emscripten 3.1.73 And to be fair, I don't know if "SDL2 is missing" is the issue ! Cause as I said, If I do the same build on macos (using the same flag) I can access SDL2 but on linux what I see it, I need to put the flag to use before the build (not sure how this matters or activates relevant ports) but once i do this
I can get it working locally ! So for now my problems ends up being more about how do I get this through my deployment
|
It doesn't work for a MacOS Github runner too. See compiler-research/xeus-cpp#301 (comment) |
Okay which means this works locally but when we try using this through the Ci something goes off ? |
My guess is that something exists on your local machine, but not on the Github runners. If you look here https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md you can see what is installed on the Github runner for Ubuntu. |
For me it is broken both locally (macOS) and in GitHub CI (Linux runner). Both cases use the Docker |
Ohh so you tried building xeus-cpp-lite as per what the docs said and tried including SDL2/SDL.h ?
Can try a fresh build soon but I am quite positive this shouldn't be the error ! |
The Github runners will likely be using the latest version of Emscripten while you may have an older version locally. As I said building with SDL2 was working fine in 4.0.7 but is broken in 4.0.9. |
No. I am building my own project which uses SDL2. It worked for years until 4.0.9 came along. |
This is the weirdest of all issues I have come across in a while
for any macos/ubuntu anything. We are obviously generating the port in our CI too (https://github.com/compiler-research/xeus-cpp/actions/runs/15187142069/job/42710203495#step:5:140) |
Ah yes, this looks like it was likely caused by #24306 which was released in 4.0.9. I certainly should have mentioned that in the changelog. Basically SDL2 (and SDL3) are installed on demand either by running an The This upshort is that cmake will not longer detect the presence of SDL2 until you take some step to install it. Although this is slighly less convenient I think it makes sense overall that cmake only report libraries that are actually installed. I will add this to changelog. |
Well my issue turns out to be on emsdk 3.1.73 so I am not sure we both had the same issues 😕 |
Yup sounds like a different issue then. |
When you run clang in the notebook I suppose that you not actually running emcc, but clang directly? If so, then you cannot use the |
Updated ChangeLog: #24395 |
Hey @sbc100, thanks for this comment #24394 (comment) I could find this as a workaround #24394 (comment) Do you think the workaround works due to the what you mentioned above (not having automatic access to SDL2 ?) |
I think the issue of cmake not detecting SDL2 is completely separate and unrelated. For your issue, where you are running clang directly, (and not via emcc) it is up to you to make sure that SDL2 is installed in sysroot / filesystem before running clang. |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I am trying to run the "smallpt: Global Illumination in 99 lines of C++" by Kevin Beason https://www.kevinbeason.com/smallpt/ in xeus-cpp-lite
I think I might have shared the link for running C++ completely in the browser through Jupyterlite previously https://compiler-research.org/xeus-cpp/lab/index.html
Context :
The text was updated successfully, but these errors were encountered: