xstudio icon indicating copy to clipboard operation
xstudio copied to clipboard

Windows build problem

Open BrianHanke opened this issue 2 years ago • 36 comments

Howdy all, I made it fairly far trying to build xStudio on Windows 10, but media_reader_ffmpeg throws about 1000 errors in Visual Studio. Stuff like:

namespace "xstudio::utility" has no member "sys_time_point"

I installed ffmpeg using vcpkg and pointed FFMPEG_ROOT to C:\source\vcpkg\installed\x86-windows.

Any suggestions how to fix this? Thanks!

BrianHanke avatar Aug 21 '23 23:08 BrianHanke

@BrianHanke how did you get past the ALSA requirements ?

nyue avatar Aug 22 '23 19:08 nyue

@nyue I don't know what that is, so I'm not sure I did get past! I just followed the Windows build guide. I already have a VM set up with VS 2019, Qt and others, so it was pretty easy. All went well in CMake GUI, it's just building the solution in VS that fails on media_reader_ffmpeg.

BrianHanke avatar Aug 22 '23 20:08 BrianHanke

@BrianHanke Thanks for the breadcrumb. Are you able to share the URL to the Windows build guide ? The repo has build guides for Centos, Rocky but not Windows

nyue avatar Aug 22 '23 20:08 nyue

@nyue Sure, here you go:

Windows code: https://github.com/mpkepic/xstudio/tree/windows Build guide: https://github.com/mpkepic/xstudio/blob/windows/docs/build_guides/windows.md

BrianHanke avatar Aug 22 '23 20:08 BrianHanke

I followed all the steps and got the xstudio.exe debug file, with so many dll missing, evan after copying all dll, xstudio not showing up anything.

Any One got lucky to get build successfully.

A6i8 avatar Aug 24 '23 12:08 A6i8

visual studio can't build,many c++ error.

RdMaple avatar Sep 08 '23 06:09 RdMaple

I get the following opencolorio/vcpkg error, any idea ?

I know there is some minimum cmake version, is there some minimum git version required ?

-- VCPKG: install from manifest; using target triplet: x64-windows
error: failed to execute: "C:\Program Files\Git\cmd\git.exe" "--git-dir=C:\Users\yueni\projects\xstudio\build\vcpkg\.git" "--work-tree=C:\Users\yueni\projects\xstudio\build\vcpkg\buildtrees\versioning_\versions\opencolorio\9569944b76966b78bec5ef83672899acd7e4febe_544.tmp" -c core.autocrlf=false read-tree -m -u 9569944b76966b78bec5ef83672899acd7e4febe
error: git failed with exit code: (128).
fatal: failed to unpack tree object 9569944b76966b78bec5ef83672899acd7e4febe
note: while checking out port opencolorio with git tree 9569944b76966b78bec5ef83672899acd7e4febe
CMake Error at cmake/modules/vcpkg.cmake:477 (message):
  VCPKG: install from manifest failed
Call Stack (most recent call first):
  cmake/modules/vcpkg.cmake:236 (vcpkg_install_manifest)
  cmake/modules/vcpkg.cmake:614 (vcpkg_init)
  CMakeLists.txt:146 (include)


-- Configuring incomplete, errors occurred!

nyue avatar Sep 18 '23 21:09 nyue

I get the error: CMake Error at CMakeLists.txt:157 (message): Failed to ensurepip.

akiraendo1 avatar Oct 20 '23 15:10 akiraendo1

I have some naive questions.

  1. Why are we leveraging vcpkg, powershell (from the ASWF discussion, specific powershell version) ?
  2. Is it practical to build the individual dependencies e.g. ocio, separately and references them in xStudio build via CMake config i.e. OCIO_DIR ?

My concern is that if we use some high level packaging e.g. vcpkg, when things breaks e.g. hash mismatch, missing files, it is more challenging for contributors to dive in to help (in the ASWF discussion, someone suggested updating some JSON file to point to a different version of opencolorio because the packaging database has missing entries)

nyue avatar Oct 20 '23 17:10 nyue

hi, I'm also encountering issues with building the windows version. Whenever I try to configure cmake, it gives me this json issue. image What seems to the be problem? I already have evrything in my machine.

Oh btw, whenever you clone the repository, the scripts/setup folder is not there. Plus when executing the powershell script also gives errors on windows image

AlsonEntuna avatar Oct 27 '23 06:10 AlsonEntuna

Hi, I'm having trouble executing the compiled (with VS 2022) version (after some hours of tweaks!) I've launched the package_xstudio.bat to copy dependencies, but it looks that something's wrong with python install, the modules aren't found. I've been able to almost fix it by playing with PYTHONHOME/PYTHONPATH env vars, but I still can't open an image. I also compiled it on a Linux Box, it's far easier to build, but sandbox install doesn't work. I can run it from the cmake build dir, though. Best regards.

cedricp avatar Oct 27 '23 13:10 cedricp

xstudio Sucess build😁, but cann't play any video 😂! I will write how i build, please wait for a moment!

RdMaple avatar Nov 02 '23 10:11 RdMaple

I am having problems with : CMake Error at cmake/modules/vcpkg.cmake:477 (message): VCPKG: install from manifest failed Call Stack (most recent call first): cmake/modules/vcpkg.cmake:236 (vcpkg_install_manifest) cmake/modules/vcpkg.cmake:614 (vcpkg_init) CMakeLists.txt:146 (include)

any Idea?

ronnyascencio avatar Nov 02 '23 11:11 ronnyascencio

1,make sure you are use vs2019(vs2022 not work),and vs language change to english! 2,if you get cmake error,please see log info ,if you get version not found,please modify vcpkg.json in \xstudio. vcpkg

3,then you should build sucessful! 4,when you exec package_xstudio.bat,you also need copy \build_folder\src"all dll file " into \workspace\build\release
copy \build_folder\vcpkg_installed\x64-windows\bin"all dll file" into \workspace\build\release
copy \xstudio\extern\quickpromise\qml\QuickPromise to \workspace\build\release\QuickPromise copy \Qt\5.15.2\msvc2019_64\plugins into \workspace\build\release copy \build_folder\bin\Release\xstudio.exe" into \workspace\build\release 5,then you should can sucess start xstudio.exe!

RdMaple avatar Nov 03 '23 04:11 RdMaple

ok apparently I saw the issue on my side because it was on a different branch when you check it out from github.

now that I have the proper branch, I tried and now have this one failed to ensurepip thing. I have pip installed but don't know what's wrong with it

The system cannot find the file specified


CMake Error at CMakeLists.txt:157 (message):
  Failed to ensurepip.


Configuring incomplete, errors occurred!

AlsonEntuna avatar Nov 03 '23 07:11 AlsonEntuna

Ok, I installed VS2019, built the sources, launched the "package_xstudio.bat" and copied all dll files as you told me, but I'm still in trouble with python :

Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python'
  isolated = 0
  environment = 1
  user site = 0
  import site = 1
  sys._base_executable = 'C:\\Users\\cedric\\Documents\\workspace\\xstudio\\build\\bin\\Release\\xstudio.exe'
  sys.base_prefix = ''
  sys.base_exec_prefix = ''
  sys.platlibdir = 'lib'
  sys.executable = 'C:\\Users\\cedric\\Documents\\workspace\\xstudio\\build\\bin\\Release\\xstudio.exe'
  sys.prefix = ''
  sys.exec_prefix = ''
  sys.path = [
    'C:\\Users\\cedric\\Documents\\workspace\\xstudio\\build\\bin\\Release\\python310.zip',
    '.\\DLLs',
    '.\\lib',
    'C:\\Users\\cedric\\Documents\\workspace\\xstudio\\build\\bin\\Release',
  ]
[2023-11-06 09:58:32.451] [xstudio] [warning] void __cdecl xstudio::embedded_python::EmbeddedPython::setup(void) Failed to setup API : failed to get the Python codec of the filesystem encoding
AttributeError: module 'sys' has no attribute 'stdout'
[2023-11-06 09:58:32.451] [xstudio] [warning] bool __cdecl xstudio::embedded_python::EmbeddedPythonActor::act::<lambda_3>::operator ()(struct caf::connect_atom,const int) const Python error AttributeError: module 'sys' has no attribute 'stdout'
[2023-11-06 09:58:32.451] [xstudio] [warning] Connected failed false
[2023-11-06 09:58:35.536] [xstudio] [warning] void __cdecl xstudio::ui::viewport::Viewport::get_colour_pipeline(void) error("create_colour_pipeline failed, invalid colour pipeline name.")
[2023-11-06 09:58:35.543] [xstudio] [warning] void __cdecl xstudio::ui::viewport::Viewport::get_colour_pipeline(void) error("create_colour_pipeline failed, invalid colour pipeline name.")
[2023-11-06 09:58:37.916] [xstudio] [info] XStudio UI launched.

Something's still missing :(

cedricp avatar Nov 06 '23 09:11 cedricp

Hey @AlsonEntuna! :)

Oh btw, whenever you clone the repository, the scripts/setup folder is not there.

You need to turn it to the windows branch!

Plus when executing the powershell script also gives errors on windows

Yeah! I had the same issue when I just downloaded the .zip but after I cloned it and switched to windows branch it worked!

Now I'm having other issues 😅 ...

ewerybody avatar Nov 16 '23 16:11 ewerybody

@ewerybody yeah already got that figured out but the only issue that i have right now that's preventing me from compiling it is the ensurepip cmake macro. Everything else is fine already.

AlsonEntuna avatar Nov 16 '23 16:11 AlsonEntuna

Yeah I have that as well. I'm left with:

Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
no such file or directory

CMake Error at CMakeLists.txt:157 (message):
  Failed to ensurepip.


Configuring incomplete, errors occurred!

but eehhh WHAT directory?!?!? 🤷

ewerybody avatar Nov 16 '23 18:11 ewerybody

@ewerybody , I only have the ensure pip issue right now, I did check my python env and pip is also installed, but when I took a look at the cmake macro it doesn't point me to anything that's why I'm confused on how to solve this issue,

AlsonEntuna avatar Nov 17 '23 07:11 AlsonEntuna

hello,

So I already managed to compile and package the tool but when launching it, it gives me errors on QT platform initialization. Has any encountered this before?

qt_issue

Is there anything I need to configure first before running it?

AlsonEntuna avatar Nov 19 '23 09:11 AlsonEntuna

hello,

So I already managed to compile and package the tool but when launching it, it gives me errors on QT platform initialization. Has any encountered this before?

qt_issue

Is there anything I need to configure first before running it?

nvm, I already solved it. All good on my end now!

AlsonEntuna avatar Nov 19 '23 15:11 AlsonEntuna

how did you solve it?

ewerybody avatar Nov 20 '23 14:11 ewerybody

I got the same problem as @AlsonEntuna and i have figure out by copying the 'platforms' folder from my qt installation: C:\Qt\5.15.2\msvc2019_64\plugins and paste it beside my binary, so here in my case D:\xstudio\prefix_install\bin\Release

Maybe a better solution exist, maybe an evironment variable that we can set to QT install folder, i don't know but for now it works with the platforms folder and i can go forward to the next error !

OlivierArgentieri avatar Nov 20 '23 19:11 OlivierArgentieri

also, the .bat file doesn't really copy the necessary .dll files. I had to write a simple python script to copy the dlls that the exe needs

AlsonEntuna avatar Nov 21 '23 09:11 AlsonEntuna

Yes, i needed also to copy all dll files manually, same for qt dependencies

But are you able to read some exr or jpg sequence ? or like me you got errors in debug and nothing can't be read in xstudio ?

OlivierArgentieri avatar Nov 21 '23 12:11 OlivierArgentieri

"C:\xstudioBuild\\build\src" does not exist.

"C:\xstudioBuild\\build\bin\Debug\xstudio.exe" does not exist.

"C:\xstudioBuild\\build\bin\Release\xstudio.exe" does not exist.

"C:\xstudioBuild\\build\src" does not exist.

DLL files from "Debug" folders copied to "C:\xstudioBuild\\build\bin\Debug"
DLL files from "Release" folders copied to "C:\xstudioBuild\\build\bin\Release"
Press any key to continue . . .

xstudio.exe not created.. after Visual studio 2019 -> build solution.- so many errors.

apanner avatar Nov 25 '23 08:11 apanner

I got the build to work with a ffmpeg 6.1 binary, I haven't tried the vcpkg ffmpeg yet. But same as a previous comment, the player is blank and will not show any video/image. Has anyone succesfully built and does your build load media?

scottmcdonnell avatar Nov 30 '23 09:11 scottmcdonnell

The cmake install is not complete windows, you will have to copy some dependencies to bin/ or set PATH (qt, opencolorio lib) Copy python packages to ${XSTUDIO_ROOT}/lib/python Move ${XSTUDIO_ROOT}/lib/python/xstudio/core/Release/__pybind_xstudio.cp39-win_amd64.pyd to ${XSTUDIO_ROOT}/lib/python/xstudio/core/__pybind_xstudio.pyd Move xstudio plugin dlls to:

${XSTUDIO_ROOT}/share/xstudio/plugin/
annotations_tool.dll        
colour_pipeline_ocio.dll  
image_boundary_hud.dll      
media_metadata_openexr.dll  
media_reader_ffmpeg.dll   
media_reader_ppm.dll 
basic_viewport_masking.dll  
exr_data_window.dll       
media_metadata_ffprobe.dll  
media_reader_blank.dll      
media_reader_openexr.dll  
pixel_probe_hud.dll

Depending on how you plan to launch xstudio, you might have to tweak the launcher script. ex I did this, created a xstudio.bat:

set XSTUDIO_ROOT=%~dp0\\..\\share\xstudio
set PATH=%~dp0\\..\\bin;%PATH%
set PYTHONPATH=%~dp0\\..\\lib\\python
call xstudio.exe %*

I tried updating build to use ffmpeg 6.1 but got a deprecated define in xstudio ffmpeg source. Easy to fix but just a heads up.

Looks like there are issues how uri conversion is done on Windows and how it splits on ":".

fjallraven avatar Apr 04 '24 09:04 fjallraven

Just wanted to follow up and point everyone to the latest commit of the windows PR;, the build system improvements addresses a lot of the comments found here; cmake install is now complete and the install script that used to be there is gone. Plugins and xstudio_root paths get set properly so the plugins that allow you to actually load media (as well as others) can be found etc.

It can now use Ninja and Visual Studio 2022; and comes with presets and a reworked build instructions to make everything super easy.

We've removed the choco script, as we've been able to get the manual build dependencies down to just a couple.

If you are still interested, I implore you to try the latest commit.

https://github.com/AcademySoftwareFoundation/xstudio/pull/50

Thanks!

mpkepic avatar Jun 06 '24 15:06 mpkepic