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

P/NPM install gl fails (gl is not compatible with GCC13) #271

Closed
SomeAspy opened this issue Dec 31, 2023 · 8 comments
Closed

P/NPM install gl fails (gl is not compatible with GCC13) #271

SomeAspy opened this issue Dec 31, 2023 · 8 comments

Comments

@SomeAspy
Copy link

SomeAspy commented Dec 31, 2023

I have re-read the readme section a few times, but I have been unable to get this to build.
I'm pretty sure this is something I am doing wrong.

❯ pnpm i gl
 WARN  1 deprecated subdependencies found: @npmcli/move-file@2.0.1
Packages: +111
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 302, reused 279, downloaded 0, added 0, done
node_modules/.pnpm/gl@6.0.2/node_modules/gl: Running install script, failed in 1.1s
.../.pnpm/gl@6.0.2/node_modules/gl install$ prebuild-install || node-gyp rebuild
│ prebuild-install warn install No prebuilt binaries found (target=21.5.0 runtime=node arch=x64 libc= platform=li…
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@9.4.1
│ gyp info using node@21.5.0 | linux | x64
│ gyp info find Python using Python version 3.11.6 found at "/usr/bin/python3"
│ gyp info spawn /usr/bin/python3
│ gyp info spawn args [
│ gyp info spawn args   '/home/aiden/Documents/repos/aocr/node_modules/.pnpm/node-gyp@9.4.1/node_modules/node-gyp…
│ gyp info spawn args   'binding.gyp',
│ gyp info spawn args   '-f',
│ gyp info spawn args   'make',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/home/aiden/Documents/repos/aocr/node_modules/.pnpm/gl@6.0.2/node_modules/gl/build/confi…
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/home/aiden/Documents/repos/aocr/node_modules/.pnpm/node-gyp@9.4.1/node_modules/node-gyp…
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/home/aiden/.cache/node-gyp/21.5.0/include/node/common.gypi',
│ gyp info spawn args   '-Dlibrary=shared_library',
│ gyp info spawn args   '-Dvisibility=default',
│ gyp info spawn args   '-Dnode_root_dir=/home/aiden/.cache/node-gyp/21.5.0',
│ gyp info spawn args   '-Dnode_gyp_dir=/home/aiden/Documents/repos/aocr/node_modules/.pnpm/node-gyp@9.4.1/node_m…
│ gyp info spawn args   '-Dnode_lib_file=/home/aiden/.cache/node-gyp/21.5.0/<(target_arch)/node.lib',
│ gyp info spawn args   '-Dmodule_root_dir=/home/aiden/Documents/repos/aocr/node_modules/.pnpm/gl@6.0.2/node_modu…
│ gyp info spawn args   '-Dnode_engine=v8',
│ gyp info spawn args   '--depth=.',
│ gyp info spawn args   '--no-parallel',
│ gyp info spawn args   '--generator-output',
│ gyp info spawn args   'build',
│ gyp info spawn args   '-Goutput_dir=.'
│ gyp info spawn args ]
│ gyp info spawn make
│ gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
│ make: Entering directory '/home/aiden/Documents/repos/aocr/node_modules/.pnpm/gl@6.0.2/node_modules/gl/build'
│   CXX(target) Release/obj.target/angle_common/angle/src/common/Float16ToFloat32.o
│ In file included from ../angle/src/common/debug.h:16,
│                  from ../angle/src/common/mathutil.h:12,
│                  from ../angle/src/common/Float16ToFloat32.cpp:9:
│ ../angle/src/common/angleutils.h:36:14: error: ‘uintptr_t’ does not name a type
│    36 | extern const uintptr_t DirtyPointer;
│       |              ^~~~~~~~~
│ ../angle/src/common/angleutils.h:21:1: note: ‘uintptr_t’ is defined in header ‘<cstdint>’; did you forget to ‘#…
│    20 | #include <vector>
│   +++ |+#include <cstdint>
│    21 | 
│ make: *** [angle/src/angle_common.target.mk:152: Release/obj.target/angle_common/angle/src/common/Float16ToFloa…
│ make: Leaving directory '/home/aiden/Documents/repos/aocr/node_modules/.pnpm/gl@6.0.2/node_modules/gl/build'
│ gyp ERR! build error 
│ gyp ERR! stack Error: `make` failed with exit code: 2
│ gyp ERR! stack     at ChildProcess.onExit (/home/aiden/Documents/repos/aocr/node_modules/.pnpm/node-gyp@9.4.1/n…
│ gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
│ gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
│ gyp ERR! System Linux 6.6.8-arch1-1
│ gyp ERR! command "/usr/bin/node" "/home/aiden/Documents/repos/aocr/node_modules/.pnpm/node-gyp@9.4.1/node_modul…
│ gyp ERR! cwd /home/aiden/Documents/repos/aocr/node_modules/.pnpm/gl@6.0.2/node_modules/gl
│ gyp ERR! node -v v21.5.0
│ gyp ERR! node-gyp -v v9.4.1
│ gyp ERR! not ok 
└─ Failed in 1.1s at /home/aiden/Documents/repos/aocr/node_modules/.pnpm/gl@6.0.2/node_modules/gl
 ELIFECYCLE  Command failed with exit code 1

I am on Arch Linux with Node 21.5.0

If I am missing any expected details, I apologize.

Possibly related to #270, however I don't have the python issue they have here:

npm ERR! /bin/sh: 1: python: not found
npm ERR! gyp: Call to 'python commit_id.py check ..' returned exit status 127 while in angle/src/angle.gyp. while loading dependencies of binding.gyp while trying to load binding.gyp
@coeing
Copy link

coeing commented Jan 3, 2024

@SomeAspy I found this issue gpujs/gpu.js#770 (comment) which points to GCC13 being the cause.

I was building the binary in a docker container with the docker image node:20.10-alpine3.19 (which uses GCC13) first and got the error ../angle/src/common/angleutils.h:36:14: error: ‘uintptr_t’ does not name a type as well. When switching to the docker image node:20.10-alpine3.18 (which uses GCC12), I was able to build the binary.

Of course it would be great if the binary could be built with GCC13 :)

@SomeAspy
Copy link
Author

SomeAspy commented Jan 5, 2024

After messing around with the dockerfile a bit I was able to get it to build.
It does indeed build with Node 20.10, but I ended up just using 21.5.0.
For anyone who ends up in this position, my dockerfile is as follows:

FROM node:21.5.0-alpine3.18

RUN apk add libxext-dev python3 pkgconf libxi-dev make g++ mesa-dev --no-cache

as you said, it would be nice to get this working with GCC13, so I don't have to spin up a docker container just to build.
I'm not sure if I should rename this issue, or open another one about GCC13 not working.

@SomeAspy SomeAspy changed the title P/NPM install gl fails P/NPM install gl fails (gl is not compatible with GCC13) Jan 7, 2024
@zFernand0
Copy link

I'm hitting this error even though I tried multiple versions of GCC. (13, 12, 11, and 10)

However, adding the required library (to angle/src/common/angleutils.h) just seemed to work (with GGC13)

Hey @dhritzkiv,
Please consider merging the PR below:

@linev
Copy link

linev commented Feb 26, 2024

We suffer from this problem for more than one year.
Finally I just fork repository and fix this annoying problem there.

https://github.com/linev/headless-gl

https://www.npmjs.com/package/jsroot-gl

I hope that such simple fix also can be applied here as well.

@ilijapuaca
Copy link

Hey @linev, thanks for putting up a fork and publishing the package with the fix. I wonder would it be possible to also upload the pre-built binaries like it's being done in this repo? It'd make the install process with the additional patch much easier to use, at least in our case

@linev
Copy link

linev commented Mar 1, 2024

@ilijapuaca That is procedure to upload pre-build binaries?

@ilijapuaca
Copy link

I am not quite sure, I assume that they get uploaded as part of the publish/release process

@dhritzkiv
Copy link
Member

Hi all. Sorry for the long wait.

The fix is merged in and available in v8.0.2

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

6 participants