Compiling for Linux on Windows
This page describes how to compile Met.3D cross-platform on Windows. It builds directly on Compile Met.3D from source code: Windows.
Prerequisites
A working development environment on Windows for Met.3D.
Visual Studio 2026 with the ‘Linux, Mac, and embedded development’ toolset installed.
A Windows subsystem for Linux (WSL 2) installation.
Installing WSL 2
Cross-platform development on Windows requires WSL 2. It allows us to run Linux applications on Windows.
Open the Windows Terminal or Powershell and run:
wsl --install Ubuntu-26.04
This will install Ubuntu-26.04 as a WSL distribution.
Setting up WSL for cross-platform development
This follows the same steps as Compile Met.3D from source code: Linux (vcpkg). The following steps have to be completed inside the WSL instance. Make sure you are in your home directory first. WSL opens in your Windows user folder by default!
As you noticed, this installs another vcpkg instance. This is important, as you cannot re-use the same instance you installed on Windows inside the WSL instance.
Important
VCPKG_ROOT has to be set inside ~/.bash_profile.
Otherwise, our CMake profiles will not find the vcpkg instance.
Compiling for Linux with Visual Studio
Open Met.3D as a project in Visual Studio, if you haven’t already. The exact steps are outlined in Visual Studio.
You should be able to select the “machine” you want to compile Met.3D for. It should currently say Local machine at the top of the window, where your build configuration is. You will be able to select WSL: Ubuntu-26.04.
If everything worked correctly, you should see two build configurations:
Linux x64 Debug: For debug builds.
Linux x64 Release: For release builds.
Important
If the build configuration only says Linux Debug something went wrong.
This usually means, that VCPKG_ROOT is not set in your WSL instance.
Add the environment variable to your ~/.bash_profile.
You can now build Met.3D on your WSL instance.
This will copy your Met.3D source code to WSL via rsync.
Afterwards, all dependencies will be built by vcpkg.
Note
Compiling dependencies via vcpkg for the first time can take upward of 4 hours, depending on your hardware. In our experience, storage speed is the largest bottleneck, so having your vcpkg directory on an SSD might improve compile times significantly.
Error
If you get any CMake error during the vcpkg step, read the log. The cause is often a missing dependency or download failures. The log usually contains the error directly or specifies a log file that contains a build error.
If everything succeeds, you can run Met.3D from WSL directly in Visual Studio.
Important
WSL might not support all GPU features a native graphics driver does.
For example, at the time of this writing, GL_ARB_bindless_texture is unsupported.
Also, the extension to read GPU memory is not supported.
Tip
You might want to set the environment variable GALLIUM_DRIVER to d3d12.
This enables WSL to use your dedicated graphics card.
It will not support all OpenGL extensions your GPU supports, but it will enable hardware acceleration.
Add it to your ~/.bash_profile to permanently set it.
Troubleshooting
vcpkg does not compile all dependencies
This can happen for multiple reasons:
You have a missing build dependency. This usually happens during the configure stage of a package and is stated in one of the log files for the package build.
You have an outdated vcpkg repository. Update it with:
1git pull
2./bootstrap-vcpkg.sh
You have a conflicting vcpkg install. Check
VCPKG_ROOTenvironment variable in your development environment.A package is broken. This can sometimes happen. If you are sure it is not one of the above, check the vcpkg repository and whether the port was updated or already has an issue related to the build failure. You can also create an issue in the Met.3D repository or contact us.