Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

get Windows build working again #56

Open
wetmink opened this issue Oct 17, 2020 · 34 comments
Open

get Windows build working again #56

wetmink opened this issue Oct 17, 2020 · 34 comments
Labels
bug Something isn't working help wanted Extra attention is needed windows things specifically for windows
Milestone

Comments

@wetmink
Copy link

wetmink commented Oct 17, 2020

I haven't been able to build Redhand using Windows.

I have downloaded MSys2 as suggested and I ran the script build.sh. As you can see in the output I included below, it fails to run the commands pip, meson, and ninja, after successfully downloading and installing most of what it needs.

Here is my output when I try to build:
output1.txt

  • OS: Windows 10 Home
  • Version 10.0.18363 Build 18363
  • MSys2 runtime version 3.1.7-2
@wetmink wetmink added the bug Something isn't working label Oct 17, 2020
@noah1510
Copy link
Owner

could you install pip, meson, and ninja using choco or any other method that installs it on the system and try running the script again?

@noah1510 noah1510 added windows things specifically for windows help wanted Extra attention is needed labels Oct 17, 2020
@noah1510 noah1510 added this to the v1.0.0 milestone Oct 17, 2020
@noah1510 noah1510 changed the title Windows build get Windows build working again Oct 17, 2020
@noah1510
Copy link
Owner

As soon as meson is fully configured only a c++ compiler, meson, ninja and pip are needed as dependencies as the rest should be downloaded and compiled if they are not installed.
At the moment this is not the case for vips and glm (although glm will be added very soon).

@wetmink
Copy link
Author

wetmink commented Oct 21, 2020

Thanks. I seem to be having a problem getting pkg-config to work on Windows. Any help would be appreciated. My output is attached.

output2.txt

@wetmink
Copy link
Author

wetmink commented Oct 22, 2020

I got pkg-config configured correctly, but I'm having other problems building. I'll work on it more tomorrow.

@noah1510
Copy link
Owner

you can use choco to install pkg-configlite.

@noah1510
Copy link
Owner

glm is now part of the meson subprojects so it is no longer needed.

@wetmink
Copy link
Author

wetmink commented Oct 25, 2020

The problem that I now get while running the build script is:

Run-time dependency gl found: NO (tried pkgconfig and system)

meson.build:15:0: ERROR: Dependency "gl" not found, tried pkgconfig and system

Do I need to download OpenGL libraries for my system, or...?

Thanks!

@wetmink
Copy link
Author

wetmink commented Oct 27, 2020

I tried installing glm packages for mingw, but I still get the same error.

@noah1510
Copy link
Owner

Usually the opengl system libraries get installed together with the driver.
Try executing pacboy -S --noconfirm mesa:x in mingw and see if installing mesa satisfies the opengl dependency.

Installing glm is no longer needed since meson downloads if it is not installed on the system.

@wetmink
Copy link
Author

wetmink commented Oct 27, 2020

I installed mesa using pacboy as you suggested, but the build still gives the same result.

@noah1510
Copy link
Owner

could you install pip, meson, and ninja using choco or any other method that installs it on the system and try running the script again?

Have you tried that and ran the script using powershell or cmd?

@wetmink
Copy link
Author

wetmink commented Oct 27, 2020

When I try either one, it launches a separate cmd window that disappears again too quickly for me to tell what happened. I can see that it didn't create a build folder, though.

@noah1510
Copy link
Owner

Did you install your GPU Drivers?
On Windows those also provide the opengl headers.

Also can you try getting it running in your IDE?
Try following these instructions to get meson to work with visual studio.

@wetmink
Copy link
Author

wetmink commented Oct 28, 2020

When I follow the linked instructions, I type meson setup build and I get the error "'meson' is not recognized as an internal or external command, operable program or batch file." I can run meson in mingw with no problem.

@wetmink
Copy link
Author

wetmink commented Oct 29, 2020

Also, I've found instructions for running meson from cmd and the Visual Studio command prompt, but they refer to meson.py; this file doesn't seem to exist on my system.

@noah1510
Copy link
Owner

all programs installed in mingw (usually) only exist in the mingw shell.
To have those programs in a different shell a package manager like choco or conan can be used to install those dependencies.

I try to make some time next week to get this project working with conan to be able to install the dependencies independent of the operating system (this should also get macos builds working).
I also want it to work inside of WSL but that has to wait until the switch to conan from the native package managers.

@wetmink
Copy link
Author

wetmink commented Oct 31, 2020

After (apparently) successfully installing choco and meson, while attempting to build redhand and following the directions at https://mesonbuild.com/Using-with-Visual-Studio.html...

`meson.build:15:0: ERROR: Dependency "vips" not found, tried pkgconfig

A full log can be found at C:\Users\1matt\Documents\code\redhand\build\meson-logs\meson-log.txt`

Log attached. meson-log.txt

@wetmink
Copy link
Author

wetmink commented Nov 1, 2020

Note that because I was following the "Using with Visual Studio" directions, I was running in the Visual Studio Command Prompt, rather that in MSys2.

@noah1510
Copy link
Owner

noah1510 commented Nov 1, 2020

okay I just noticed there is no good way to automatically install vips as dependency, so I will soon switch the image library to something that can be installed using meson or choco.
I should be able to do that tomorrow morning so stay tuned, I will write a new comment when its done.

@noah1510
Copy link
Owner

noah1510 commented Nov 1, 2020

okay I switched back to stb from vips, so your local builds should work now.

@wetmink
Copy link
Author

wetmink commented Nov 2, 2020

Thanks for doing that!

OK, I'm still following the directions at https://mesonbuild.com/Using-with-Visual-Studio.html , so I'm still using the Visual Studio Command Prompt. When I run meson setup --backend vs build I get meson.build:15:0: ERROR: Dependency "openal" not found, tried pkgconfig I tried installing openal with choco, but it doesn't seem to make any difference.

@noah1510
Copy link
Owner

noah1510 commented Nov 5, 2020

can you try installing the core sdk for the official website?

@noah1510
Copy link
Owner

noah1510 commented Nov 5, 2020

openal is now optional since no code at the moment uses it, so the code should hopefully compile now

@wetmink
Copy link
Author

wetmink commented Nov 6, 2020

Now after pulling I get meson.build:22:0: ERROR: Unknown method "dependency" in object. I'll try to see what caused it myself, I'm hoping I'll be able to figure it out. Meson log attached.

meson-log.txt

@noah1510
Copy link
Owner

noah1510 commented Nov 7, 2020

I fixed the parts that where wrong in the latest commit removing that problem

@wetmink
Copy link
Author

wetmink commented Nov 8, 2020

Have you committed those changes? I still get the same problem.

@wetmink
Copy link
Author

wetmink commented Nov 8, 2020

Though I've just changed git clients, so it may be because of that change...

@wetmink
Copy link
Author

wetmink commented Nov 20, 2020

After doing a git pull, I still get this error. meson.build:22:0: ERROR: Unknown method "dependency" in object.

@noah1510
Copy link
Owner

you should also have a warning telling you that some python module is not found.
Try installing that module using python pip.

@wetmink
Copy link
Author

wetmink commented Dec 3, 2020

Update: I figured out that I had been getting errors because I had been experimenting in github by cloning redhand, and I accidentally had still been using that clone as my git origin.

Now that I'm using the right repository again, my problem is that I receive the error

Run-time dependency vulkan found: NO (tried pkgconfig and system)
Run-time dependency x11 found: NO (tried pkgconfig)
subprojects/glfw3/src/meson.build:159:4: ERROR: Dependency "x11" not found, tried pkgconfig

This is even after I tried to run python3 -m pip install x11

It doesn't find a module called x11, though python3 -m pip install vulkan succeeds.

@noah1510
Copy link
Owner

noah1510 commented Dec 3, 2020

Run-time dependency vulkan found: NO (tried pkgconfig and system)

vulkan is an optional dependency for the meson glfw build and is neither needed nor used.

subprojects/glfw3/src/meson.build:159:4: ERROR: Dependency "x11" not found, tried pkgconfig

This error is a bit weird. X11 is only a dependency on linux and bsd but not on windows. Are you building it using msys or visual studio?
If you use visual studio try installing glfw from the website.

@wetmink
Copy link
Author

wetmink commented Dec 10, 2020

Sorry, I should have explained that I tried building on a virtual Ubuntu machine just to see if I could get something working.

I'm back on just Windows, and when I run meson setup --backend vs build I get

Subprojects
glfw3: YES
glm: YES
stb: YES

Traceback (most recent call last):
File "mesonbuild\mesonmain.py", line 131, in run
File "mesonbuild\msetup.py", line 245, in run
File "mesonbuild\msetup.py", line 159, in generate
File "mesonbuild\msetup.py", line 215, in _generate
File "mesonbuild\backend\vs2010backend.py", line 186, in generate
File "mesonbuild\backend\vs2010backend.py", line 420, in generate_projects
File "mesonbuild\backend\vs2010backend.py", line 779, in gen_vcxproj
KeyError: 'b_vscrt'

@wetmink
Copy link
Author

wetmink commented Dec 10, 2020

When I just run the usual build script, the result is:

script running on windows
command
number of THREADS:9
buildname:lib
ninja: Entering directory `build'
ninja: error: loading 'build.ninja': No such file or directory
Could not compile redhand. Trying to reconfigure
Directory does not contain a valid build tree:
/c/Users/1matt/gitrepos/redhand/build
Could not setup build

@noah1510
Copy link
Owner

noah1510 commented Feb 9, 2021

I got the setup working in a VM using the following steps:

  • install python
  • typing py -m pip install meson ninja glad into (user) powershell
    • that command should give a warning that some folder is not in the path. Add the specified folder to the PATH environment variable
  • install the windows sdk (this is needed to compile programs at all, should come with every full visual studio installation)
  • install visual studio with c++ build tools
  • install git (in my case using choco)
  • use the following commands in a visual studio developer powershell:
    • git clone https://github.com/noah1510/redhand.git
    • cd redhand
    • meson setup build -Dbuild-testgame=true --backend=vs
    • open the solution with visual studio

I needed to make a few changes to the build system to get it working on windows.
Those changes will hopefully uploaded by tomorrow.
Those changes also raise the required meson version to 0.55 because newer features of the wrap format are needed.

There seem to be some problems when compiling the code, I look into what is needed to get it working.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed windows things specifically for windows
Projects
None yet
Development

No branches or pull requests

2 participants