GaijinEntertainment / DagorEngine

Dagor Engine and Tools source code from Gaijin Games KFT
Other
2.16k stars 271 forks source link

Failed to build CDK #4

Closed JustMinna closed 10 months ago

JustMinna commented 10 months ago

Been trying to build the CDK tools but I keep getting an error image

Am I doing something wrong or am I missing something?

OshidaBCF commented 10 months ago

image i created a random file in the bin inside the simlink to find where it was, and it seem to use vc2022

the py code that make link open the path Program Files (x86)\Microsoft Visual Studio\2022\BuildTools so it make sense that i would take 22 no ?

Am i mixing up names again ?

NicSavichev commented 10 months ago

image i created a random file in the bin inside the simlink to find where it was, and it seem to use vc2022

the py code that make link open the path Program Files (x86)\Microsoft Visual Studio\2022\BuildTools so it make sense that i would take 22 no ?

Am i mixing up names again ?

Yes, change symlink manually to 2019. We will fix script later to avoid this bug

OshidaBCF commented 10 months ago

i don't have any "2019" folder next to the 2022, i guess i would need to install VS 2019

I'm not sure how to edit symlink, should i just modify the pyscript, and run it again after deleting the folder ?

OshidaBCF commented 10 months ago

log.txt

I got some external help to install VCR2019, after redoing the symlink, this is what the build did.

It seems to have managed to build Dav1d's lib

Now it's having some error on what looks to be previously build files, so i guess i should rebuild from scratch

NicSavichev commented 10 months ago

Now it's having some error on what looks to be previously build files, so i guess i should rebuild from scratch

Yes, this is true. jam tries to check dependences as much as possible but it doesn't handle case when changing compiler for the same output PDB will likely fail

OshidaBCF commented 10 months ago

I mean that does make some sense, if the file is already there it's a good guess that it was just already built before

Right now i'm recompiling and it seems to have no error... yet

OshidaBCF commented 10 months ago

After 2 hours, building finally finished, how long does it usually take you ? log.txt

i think i got a few errors about "shaders", but otherwise everything should be alright

NicSavichev commented 10 months ago

After 2 hours, building finally finished, how long does it usually take you ? [log.txt]

compilation takes 30 min (but I use 36-cores i9 and SSD)

OshidaBCF commented 10 months ago

Yeah i have a 8 core R7

sadly this didn't helped me fix my problem mentioned in #2

I couldn't find in the files a reason why oodle wouldn't open

NicSavichev commented 10 months ago

I couldn't find in the files a reason why oodle wouldn't open

what Oodle do you have? we use 2.9.2 for runtime (game and unpack) and 2.7.6 for packing in tools (hold older version to avoid updating 50Gb of texture packs) if Oodle is linked then tools should be able to unpack them did you try ddsx2dds with -dump option to see header's dump?

OshidaBCF commented 10 months ago

-dump works and -check:OODLE also work

As for the Oodle version, i have no idea the only thing i have is the name, oo2core_6_win64.dll

it works with the previous tool i had so it should work with this one

how do i link the dll ?

NicSavichev commented 10 months ago

how do i link the dll ?

I don't think it is possible since we use static libs case win32 : AddLibs += $(oodle_dir)/static_lib/oo2core_win32.lib ; case win64 : AddLibs += $(oodle_dir)/static_lib/oo2core_win64.lib ; If you do have license for OODLE then you have these headers and libs C:\devtools\oodle.2.9\include\oodle2.h C:\devtools\oodle.2.9\include\oodle2base.h C:\devtools\oodle.2.9\include\oodle2x.h C:\devtools\oodle.2.9\static_lib\oo2core_win32.lib C:\devtools\oodle.2.9\static_lib\oo2core_win32_debug.lib C:\devtools\oodle.2.9\static_lib\oo2core_win64.lib C:\devtools\oodle.2.9\static_lib\oo2core_win64_debug.lib and import libs must be located here C:\devtools\oodle.2.9\lib\oo2core_win32.lib C:\devtools\oodle.2.9\lib\oo2core_win64.lib but you should change prog/engine/ioSys/jamfile too in order to link import libs instead of static ones

OshidaBCF commented 10 months ago

right now i only have the dll, but i'll try to aquire the lib.

if i can get the lib, do i just put in a folder in the "build folder" ?

like Build/oodle.2.7.oo2core_win_64.lib ?

NicSavichev commented 10 months ago

As for the Oodle version, i have no idea the only thing i have is the name, oo2core_6_win64.dll also I suspect this name means Oodle ver 2.6.x and it may be just incompatible with 2.7.6 that we use for packing you need newer lib anyway

OshidaBCF commented 10 months ago

i see....

well if i can find a lib i can probably find newer

NicSavichev commented 10 months ago

well if i can find a lib i can probably find newer

I need lib anyway, static one or import one you cannot use DLL without any lib (import libs loads that DLL and resolves symbols)

OshidaBCF commented 10 months ago

oh god... it's starting to get quite complicated

OshidaBCF commented 10 months ago

i found a lib, that was easier than expected, 3 month old so it should be fine no ?

OshidaBCF commented 10 months ago

case win64 : AddLibs += $(oodle_dir)/static_lib/oo2core_win64.lib ;

Do i just have to do that an rebuild the tool ? image

NicSavichev commented 10 months ago

Do i just have to do that an rebuild the tool ? ![image](https://user-images.githubusercontent.com/61458287/278892235- yes, run X:\github\DagorEngine.git\prog\tools\build_dagor3_cdk_mini.cmd or jam in X:\github\DagorEngine.git\prog\tools\converters\ddsx2dds\

OshidaBCF commented 10 months ago

Oh yeah i guess that now that it can find the lib it'll build it

OshidaBCF commented 10 months ago

log.txt

It build some new files but still failed because it couldn't find all the headers and things (i forgot to log the first build)

NicSavichev commented 10 months ago

log.txt

It build some new files but still failed because it couldn't find all the headers and things (i forgot to log the first build)

you need ...\build\oodle.2.7\include\oodle2.h to compile

NicSavichev commented 10 months ago

also you can use jam -dx to see actual commandline (so you know what folders are added for includes, etc.)

OshidaBCF commented 10 months ago

IT WORKEDDDDDDDDDDDDDDDDDDDD

HAHAHAHAHAHAHA

OshidaBCF commented 10 months ago

Thanks a lot <3

NicSavichev commented 10 months ago

@JustMinna You need to build Gaijin fork of jam build.vc.cmd was not working for me for some reason. I used generated cmake to build it. Check the VC_DIR and WINKIT_DIR before running.

You don't need to build 'jam' at all, get EXE from releases https://github.com/GaijinEntertainment/jam-G8/releases/download/2.5-G8-1.2-2023%2F05%2F04/jam-win64.zip just unpack it to any folder that exists in PATHs

JustMinna commented 10 months ago

Alrighty, thanks

JustMinna commented 10 months ago

image Did you find a fix for this issue?

It has been fixed

JustMinna commented 10 months ago

image However I'm having another issue... I can probably download this dll from somewhere though... I assume

NicSavichev commented 10 months ago

image However I'm having another issue... I can probably download this dll from somewhere though... I assume

This DLL (as well as many other important files) are located in tools-base.7z (downloadable from releases) and that these files must be unpacked to repo folder before building and using built tools

OshidaBCF commented 10 months ago

I had it downloaded and copied the PVRTexLib, it could launch but then crashed because of shaders not being compiled

now i understand why i should have merged the two folder, the building override the exes right ?

NicSavichev commented 10 months ago

now i understand why i should have merged the two folder, the building override the exes right ? Yes, initially we combine GIT repo + 2 unpacked base archives (refer to newly added README.md for details). Then we build tools (build_dagor3_cdk_mini.cmd) and samples (EXE with jam, shaders with compileshaders*.bat and game resources with dabuild.cmd; sometimes we need to build pre-rasterized fonts). After building these (it is development pipeline) we can run samples.

Instead of building tools you can download and unpack tools-prebuilt.7z Instead of building samples you can download prebuilt data and EXE samples-prebuilt-game.7z Rebuilding EXE is easiest part of build pipeline.

OshidaBCF commented 10 months ago

I see that a lot of files changed

Should i delete everything and redo everything from 0 ?

NicSavichev commented 10 months ago

Should i delete everything and redo everything from 0 ?

No, just update, run make_devtools.py once more (it will download missing pre-requisites) and build code incrementally with jam. It was essentially what I did when tested changes in repo before pushing. _Output can be removed/cleaned at any time to force clean build but this will take much time to rebuild everything from scratch. Also you could jam only tool you need (instead of building everything with batch script), I think you need this folder DagorEngine.git\prog\tools\converters\ddsx2dds\

OshidaBCF commented 10 months ago

Well i was curious and have time to spend, so i just redid everything from scratch

The py script seems to have removed a couple of elements from my Path variable, a few programs (jam included) couldn't be called anymore

NicSavichev commented 10 months ago

The py script seems to have removed a couple of elements from my Path variable, a few programs (jam included) couldn't be called anymore

Really strange, when I tested it script downloaded jam to root of devtools folder and asked to add devtools folder to the paths (but I never tried to confirm adding)

OshidaBCF commented 10 months ago

i had jam.exe on my pc from yesterday, the py script didn't download jam at all

Maybe it checked if i had jam and noticed i did ?

NicSavichev commented 10 months ago

Maybe it checked if i had jam and noticed i did ?

it searches jam.exe in PATH folders and skips installing if found

OshidaBCF commented 10 months ago

then perhaps it found it and overwrote everything after it + a few lines before.

When i opened the path, the last line onlt had "C:/P" inside probably the start of C:/Program x86

NicSavichev commented 10 months ago

When i opened the path, the last line onlt had "C:/P" inside probably the start of C:/Program x86

Don't use folders with spaces in name when dealing with jam. This wil cause awful headache

OshidaBCF commented 10 months ago

it's just the translation, iirc the actual folder doesn't have spaces.

OshidaBCF commented 10 months ago

Well i was curious and have time to spend, so i just redid everything from scratch

The py script seems to have removed a couple of elements from my Path variable, a few programs (jam included) couldn't be called anymore

It seems that this was actually caused by my global Path variable being too long, after starting my computer this morning, a few lines have been removed again

NicSavichev commented 10 months ago

It seems that this was actually caused by my global Path variable being too long, after starting my computer this morning, a few lines have been removed again

fixed script