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

Can't Build #8

Closed
KingJigglypuff opened this issue Sep 20, 2022 · 7 comments
Closed

Can't Build #8

KingJigglypuff opened this issue Sep 20, 2022 · 7 comments

Comments

@KingJigglypuff
Copy link

KingJigglypuff commented Sep 20, 2022

I'm trying to build from source, as I'm assuming the current release is outdated, but I'm running into an issue during the ninja build procedure.

It fails to build, and gives me this:

[1/2] Compiling C object src/nvml.so.p/nvml_unixlib.c.o
FAILED: src/nvml.so.p/nvml_unixlib.c.o 
cc -Isrc/nvml.so.p -Isrc -I../src -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -g -fPIC -MD -MQ src/nvml.so.p/nvml_unixlib.c.o -MF src/nvml.so.p/nvml_unixlib.c.o.d -o src/nvml.so.p/nvml_unixlib.c.o -c ../src/nvml_unixlib.c
../src/nvml_unixlib.c:8:10: fatal error: winternl.h: No such file or directory
    8 | #include "winternl.h"
      |          ^~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.

These are the steps I took to try to build everything:

1.) Navigate to the src folder, and open the Terminal in there.
2.) Execute ./make_nvml
3.) Navigate to the root folder (wine-nvml-master), and open the Terminal in there.
4.) Execute meson setup --cross-file <cross-{mingw,wine}{64,32}.txt> build-{mingw,wine}{64,32}> (replacing what's between the arrows with the respective txt file). Though trying with the wine-32 variant gives me this: meson.build:12:4: ERROR: C shared or static library 'dl' not found
5.) Navigate to any of the build folders, and open the Terminal in there.
6.) Execute ninja

@Saancreed
Copy link
Owner

Hi. What distro are you trying to build this on?

fatal error: winternl.h: No such file or directory

This header file is shipped both by Wine itself and Mingw. On Arch it looks like this:

$ pacman -F winternl.h
community/mingw-w64-headers 10.0.0-1 (mingw-w64-toolchain mingw-w64) [installed]
    usr/i686-w64-mingw32/include/winternl.h
    usr/x86_64-w64-mingw32/include/winternl.h
community/zig 0.9.1-2
    usr/lib/zig/libc/include/any-windows-any/winternl.h
multilib/wine 7.17-1
    usr/include/wine/windows/winternl.h
multilib/wine-staging 7.17-1
    usr/include/wine/windows/winternl.h

But, depending on your distro, it might have been packaged in some separate package which for some reason is not installed. For example, on Ubuntu you will probably need some mix of libwine-dev, mingw-w64-common, mingw-w64-x86-64-dev and/or mingw-w64-i686-dev, see here for details.

Actually, Wine packaged in Ubuntu repos might be too old to build this, so Ubuntu users will probably need to install wine-devel-dev from WineHQ repos instead and make sure that package's headers are found by winegcc.

Though trying with the wine-32 variant gives me this: meson.build:12:4: ERROR: C shared or static library 'dl' not found

This is usually a sign of missing development files for 32-bit glibc. Again, Ubuntu users might need a separate package to satisfy this dependency, like libc6-dev-i386 and/or libc6-i386-cross.

Also, can you give me the full output of the problematic call to meson? Having that plus the knowledge of distro are you trying to build this on should allow me to figure out exact dependencies.

@KingJigglypuff
Copy link
Author

My distro is Mint Cinnamon, and my current wine version is 7.13 (staging).

As for the meson output, here's the log file for when the wine32 version failed.
meson-log.txt

@Saancreed
Copy link
Owner

My distro is Mint Cinnamon

That's… a bit annoying because Mint doesn't seem to maintain any sort of official OCI/Docker image I could use to figure this out on my machine. Disappointing, but maybe we will be able to resolve this anyway.

I see that the latest release of Mint is based on Ubuntu 22.04, does it mean that you have full access to packages from Ubuntu repositories? The C compiler for the build machine: cc (gcc 11.2.0 "cc (Ubuntu 11.2.0-19ubuntu1) 11.2.0") line seems to suggest that some packages indeed come directly from Ubuntu. If so, I could try to prepare a list of dependencies needed to build wine-nvml on Ubuntu 22.04 and you should be able to install them on your Mint machine for the build to succeed.

and my current wine version is 7.13 (staging)

According to Mint's package list, the newest Wine available in the repos is 5.0.x, while Ubuntu has 6.0.x and WineHQ already provides 7.17 Where have you installed that 7.13 staging from?

meson-log.txt

The line of interest seems to be /usr/bin/ld: cannot find crti.o: No such file or directory, and crti.o for x86 arch on Ubuntu seems to be in packages like libc6-dev-i386, libc6-dev-i386-cross and libc6-dev-i386-amd64-cross. You could try them in that order and see if it resolved this error.

@Saancreed
Copy link
Owner

Assuming that Mint can indeed use packages from Ubuntu 22.04 repo and that you wouldn't mind replacing your Wine with the latest Wine Staging from WineHQ (currently 7.17) that's known to work, the following list of commands should be everything you need to setup a working build environment from minimal system install (run all of them as root):

apt update
apt install -y wget
wget -O /usr/share/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
dpkg --add-architecture i386
apt update
apt -y install gcc-multilib meson mingw-w64 ninja-build wine-staging-amd64 wine-staging-i386 wine-staging-dev winehq-staging

@KingJigglypuff
Copy link
Author

I'm having trouble with wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources I ran it as root (sudo), and I got this in the terminal:

Resolving dl.winehq.org (dl.winehq.org)... 151.101.6.217
Connecting to dl.winehq.org (dl.winehq.org)|151.101.6.217|:443... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘/etc/apt/sources.list.d/winehq-jammy.sources’ not modified on server. Omitting download.```This would assume it's already up to date, right?

Regardless, doing this entire process isn't updating my wine staging. It's still 7.13.

In terms on how I installed it, I think I remember doing `sudo apt install --install-recommends winehq-staging` at the time.

@Saancreed
Copy link
Owner

This would assume it's already up to date, right?

Yes, this shouldn't be a problem.

Regardless, doing this entire process isn't updating my wine staging. It's still 7.13.

This might need a separate apt upgrade unless Mint holds/pins some packages that prevent this upgrade. But that's also not a problem if your package comes from WineHQ, as long as it's 7.0 or later you should be good to go (and as long as you can install wine-staging-dev that's compatible with this version, let's just hope APT can resolve this correctly).

Make sure you have gcc-multilib wine-staging-i386 wine-staging-dev and try building the project again.

@KingJigglypuff
Copy link
Author

KingJigglypuff commented Sep 21, 2022

I went ahead and tried building everything again just now, and I was finally able to build everything successfully. Thank you for putting up with my shenanigans.

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