GaijinEntertainment / DagorEngine

Dagor Engine and Tools source code from Gaijin Games KFT
Other
2.15k stars 268 forks source link

Failed to build CDK #4

Closed JustMinna closed 9 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?

FlareFlo commented 10 months ago

It appears you have not installed the Jam build-tool

JustMinna commented 10 months ago

I have no clue how to install it, it seems ancient (literally an MS-DOS application file) and there's not much documentation regarding installation...

nikitakrutoy 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.

OshidaBCF commented 10 months ago

@nikitakrutoy thanks a lot for the link to the fork

it instantly work but now it say that i don't have FMOD Studio SDK installed, i installed both the "studio" and "API" i found on the website, is the SDK something else ?

nikitakrutoy commented 10 months ago

@OshidaBCF Have you run make_devtools.py?

JustMinna commented 10 months ago

@nikitakrutoy Yeah and I experience the same issue Jam worked perfectly though, thanks for the link!

OshidaBCF commented 10 months ago

Yes i did, i tried to "delete" the folders and redo it after installing both

I may be missing something but it created a lot of folderlinks and all of them have something inside image

nikitakrutoy commented 10 months ago

@OshidaBCF I do not have fmod on my machine, so I can only suggest deleting fmod-studio-2.xx.xx folder and commenting out if pathlib.Path(fmod_src_folder).exists(): branch in make_devtools.py.

OshidaBCF commented 10 months ago

Make_devtools isn't the one having the error

it's when i do build_all.cmd image

JustMinna commented 10 months ago

image image Everything related to the FMOD SDK is just empty folders

OshidaBCF commented 10 months ago

you need to delete the fmod-studio-2.xx.xx folder and do make_dev.py again

for me those folders and filled with .h, hpp and cpp files

JustMinna commented 10 months ago

I did, they are still all empty

nikitakrutoy commented 10 months ago

@OshidaBCF I believe you are getting this error because fmod-studio-2.xx.xx is not empty, actually. This is probably a bug. For now, you can solve this by deleting fmod and running make_devtools.py again. Or comment out the code that I described in prev post. This way, the build script will assume that you do not have fmod and would not try to resolve SDK location.

OshidaBCF commented 10 months ago

Just tried, doesn't change anything, it's jam that seems to be causing problem

in build_dagor3_cdk_mini.cdk is there is a few lines that are like this

jam -s Root=../.. -s Platform=win64 -f "path_to_jamfile

All of them fail with the same error "FMOD Studio SDK not found in please update.

So you think that my jam maybe not be working properly ?

I downloaded the pre built exe from the fork you shared, maybe it's that ?

JustMinna commented 10 months ago

When running the build cmd: image

When running the py makedev: image (note, I manually installed the appropriate FMOD SDK)

OshidaBCF commented 10 months ago

I managed to make build.vc.cmd start

The two arguments are the folder links that the make_dev.py file created

for me it was build.vc.cmd C:\WTDHAutomaticEdition\DagorEngine\Build\vc2019_16.10.3 C:\WTDHAutomaticEdition\DagorEngine\Build\win.sdk.100

Now it cannot find "fcntl.h", it exist in visual inclulde folder, but i don't know how to tell the script "look there if it doesn't have it somehow", then it need std lib which need another ect ect, so i can't just copy all the .h

nikitakrutoy commented 10 months ago

@OshidaBCF I had the same issue. That is why is used cmake instead. I tried setting msvc include directories flags in build.vc.cmd at first, but i am not very familiar with msvc, so did not get any results with that.

I doubt that the problem is in jam pre-build executable though. It should work fine too.

OshidaBCF commented 10 months ago

Yeah i doubt it's the pre built too it would be weird for it to "half work"

i know basically nothing about cmake, only that it is a pain to work with.

i'll try to see more tomorrow, i just hope that gaijin will provide "some kind" of docs for the engine

OshidaBCF commented 10 months ago

Found 1 problem :

in prog\_jBuild\default.jam : l224

the regex pattern is supposed to return 1 slash + the build fault, but it fail if the passed _DEVTOOL variable is only a word, like "Build" in my case

Replacing MATCH "([^\\\/]*)([\\\/])(.*)" into MATCH "([^\\\/]*)(.*)" now show me a better error than before

Before : image

After : image

now it make a little more sense, i'm still searching for the rest of the problem

OshidaBCF commented 10 months ago

Found another problem :

in in prog\_jBuild\jBuild.jam : l130

glob isn't given the root folder, so it cannot find the FmodIncPath given Also the variable point to the element 1 of the array, but the 1 is "core" while 2 is studio It doesn't really matter because this line is just to see if there is anything in the includes folders

changing [ GLOB $(FmodIncPath[1]) : * ] to [ GLOB $(Root)/$(FmodIncPath[1]) : * ] Changed the error once again

before : image

after : image

OshidaBCF commented 10 months ago

Forget my two previous changes

I found a "more generic" one

In prog/platform.jam, _DEVTOOL is defined by what value you passed to make_devtool.py

Changing _DEVTOOL = Build ; to _DEVTOOL = $(Root)/Build ; Fixes a lot of things and it seems to actually be trying to compile the tool

But it's getting a lot of errors now, but seems unrelated to jam, and all of them seems way outside of my capabilities

I edited make_devtool.py at the end so that it would write the new string fd.write('_DEVTOOL = {0} ;\n'.format(dest_dir)) -> fd.write('_DEVTOOL = $(Root)/{0} ;\n'.format(dest_dir))

NicSavichev commented 10 months ago

Destination for Devtools folder expected to be absolute path, _DEVTOOL = X:/devtools-gh ; for me. I will add proper check to make_devtools.py script.

OshidaBCF commented 10 months ago

Oh i seee, i gave it a relatif path so it can't work

I should have checked that, but even with the change, i still get a very very large amount of errors log.txt

it seems to be related to cl.exe but i don't know what this exe is supposed to do, seems to be building some .obj

OshidaBCF commented 10 months ago

Updated log.txt because i noticed it was asking for oodle.dll

cl.exe is still making all the errors

NicSavichev commented 10 months ago

do you have MSVC properly installed and have C:\Users\swann\source\repos\DagorEngine\Build\vc2019_16.10.3\bin\Hostx64\x64\cl.exe EXE here? OODLE is not relevant (unless you have OODLE license you can build engine and tools without OODLE support, just use ZSTD for packing game resources)

NicSavichev commented 10 months ago

cl.exe is still making all the errors

Did you use jam.exe from https://github.com/GaijinEntertainment/jam-G8/releases/tag/2.5-G8-1.2-2023%2F05%2F04 ?

OshidaBCF commented 10 months ago

I'm not sure to have MSVC installed, i have VC2019

I use the jam.exe from the fork and it works no problem

I just checked and C:\Users\swann\source\repos\DagorEngine\Build\vc2019_16.10.3\bin doesn't even exist

OshidaBCF commented 10 months ago

I tried to run the py script again and it say that the simlink is created image

it linked to C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC but there is no "bin" folder inside, so i don't have MSVC installed

I think i found it image

i'll see after if i need any of the other two

NicSavichev commented 10 months ago

2019, x64/x86 maybe 2015 is also needed (since it stay default now), but you have to use previous buildtools installer)

OshidaBCF commented 10 months ago

Ah oups...

NicSavichev commented 10 months ago

also be warned to use english locale for VC (or it will cannot manage dependencies) I'm currently working on update (to handle any locale, not english one) but latest version on github requires this

OshidaBCF commented 10 months ago

i installed MSVC and now it's building

that is a lot of includes

NicSavichev commented 10 months ago

that is a lot of includes

something "note: including ..." in non-english locale? it is wrong behaviour, output filter should capture these lines and redirect to deps files if you see these lines it failed to capture

OshidaBCF commented 10 months ago

i see i was wondering what you meant by "use english locale for VC"

do i need to change the language of VS ?

NicSavichev commented 10 months ago

do i need to change the language of VS ?

I think yes, please

OshidaBCF commented 10 months ago

I tried changing Visual Studio's language to "english", and it is in english, but i still get the "note including..."

OshidaBCF commented 10 months ago

i can try to uninstall the french language pack

OshidaBCF commented 10 months ago

Ah it's "working"

i get less errors, but no "note including"

OshidaBCF commented 10 months ago

while my cpu is screaming building the cdk, i can't stop wondering why the build couldn't work in french, it's not like it was a different platform right ?

OshidaBCF commented 10 months ago

log.txt

i didn't excpeted to have that little errors

NicSavichev commented 10 months ago

I think it is not compiler we used to use do you compile with VC2022? C:\Users\swann\source\repos\DagorEngine\prog\dagorInclude\math/dag_Point3.h(31): error C2220: the following warning is treated as an error C:\Users\swann\source\repos\DagorEngine\prog\dagorInclude\math/dag_Point3.h(31): warning C5267: definition of implicit assignment operator for 'Point3' is deprecated because it has a user-provided copy constructor C:\Users\swann\source\repos\DagorEngine\prog\dagorInclude\math/dag_Point3.h(31): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings

NicSavichev commented 10 months ago

try adding locally

+++ b/prog/_jBuild/win64/vc16-sets.jam
@@ -26,4 +26,5 @@ local _DEF_C_CMDLINE =
   /c /nologo /Zc:forScope /Zp8 /J
   /Zc:inline /bigobj
+  /Wv:18
 ;

to X:\github\DagorEngine.git\prog_jBuild\win64\vc16-sets.jam

OshidaBCF commented 10 months ago

Frankly i have no idea, what i have should be Visual Studio Community 2022 image

The versioning of visual tools is hard to keep up with

OshidaBCF commented 10 months ago

It seems to be buildign everything that didn't build before without issue

Also i switched the VS Installer language to english, so it should be easier to know what module i really need

OshidaBCF commented 10 months ago

log.txt

Got way less errors, but still some

Should i have deleted the _output folder to rebuild everything ?

NicSavichev commented 10 months ago

how come you get ....\prog\engine\ioSys\oodleIo.cpp(7): fatal error C1083: Cannot open include file: 'oodle2.h': No such file or directory instead of OODLE is missing, ignored ? did you added empty folder to devtools manually? remove it then

OshidaBCF commented 10 months ago

i added a "oodle.2.7" folder with the dll inside to remove the error from before

i forgot that i didn't really needed it, i removed it and rerun the build without deleting the _output folder, tell me if i should delete it before rebuilding. log.txt

OshidaBCF commented 10 months ago

Also i disabled the rerun of the build script if it failed, should i enable it back ?

OshidaBCF commented 10 months ago

log.txt

re tried with deleteing the folder, it seems i only got errors about "atomic" and dav1d's lib

NicSavichev commented 10 months ago

log.txt

re tried with deleteing the folder, it seems i only got errors about "atomic" and dav1d's lib

I'm rechecking on clean machine (with just installed VC tools) Are you sure script made proper symlinks to vc2019? It was reported that it may symlink to vc2022 instead if it is available I will recheck now whether code is buildable with recent vc2019 (last installed was 19.20.30148 this spring)