New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dependencies and tbprobe #2660
Comments
Yes, this is annoying isn't it. Maybe there is a more generic way, but this patch appears to fix the problem: master...xoto10:make1 |
@xoto10 yes that fixes it, but leaves the incorrect auto-generated dependencies (.depend file) still around, and moves from auto-generated to hand-maintained dependencies. I would prefer to either fix our auto-generation procedure (but didn't figure out how to do that cleanly), or move tbprobe in the main src directory, which would allow the current dependency generation to do the right thing. |
How about master...xoto10:make2 ? |
Changes: - All .o object files now reside in the src directory itself. - Instead of a single .depend file there now is a .dep directory containing individual .d dependency files for every generated object file. - The src directory is added to the include path so source and header files in subdirectories (like syzygy) can include header files in the src directory directly (without the "../" prefix). No functional change.
Here's my attempt. It doesn't require any manual processing of dependencies but there are some structural changes (see the first commit message): master...gvreuls:syzygy_dep |
@gvreuls thanks, one more option :-). Will this also work for the MSVC setup (e.g. our CI) ? |
@vondele I can't test for MSVC but I could do a pull request to find out. Placing the syzygy/ object files in src/ is necessary to get rid of the "syzygy/../someheader.h" references that break the dependency checks. The obvious solution would be to put the syzygy/ source files in src/ itself but since it's a fairly separate project I think it's better to put the syzygy/ directory in the make VPATH so it will be searched for tbprobe.cpp when it isn't found in src/ |
feel free to do a WIP PR to figure out. |
@vondele I need to add src/ to the MSVC include path so I have to add either a |
Stockfish/appveyor.yml contains the setup.... but I don't know the details of it. |
Ah, seeing that idea helped me :) Perhaps we're combining several ideas here. The smallest change to compile in the current dir seems to be: d931b46 Using |
@xoto10 If you do a PR you might want to add this Appveyor change to make the MSVC CI work. It adds the src directory to the MSVC include path. |
I'm actually thinking that having the explicit path in the includes is a good thing, otherwise we have to add additional compiler flags to find them (and so might people reading the code). So maybe d931b46 is best ? (still need to figure out what that does exactly ;-) ) |
:) |
@xoto10 ... but now recompiles happen always even if up-to-date |
Ah, that's not good - let me look ... |
You're writing the tbprobe.o object file to a different location from where |
Yes, I tried VPATH, but then the .depend build doesn't work because it can't find tbprobe.cpp (because it's syzygy/tbprobe.cpp). |
I've reduced my solution to the minimum too, it just changes the Makefile and doesn't add the src/ directory to the include path any longer. It still generates separate dependency files for each object file in the (hidden) .dep directory because this is more efficient (it saves a compiler run to generate the dependency file). See PR #2663 |
I see all the make manuals seem to suggest creating a separate .d file for each source so it may make sense to go that way. I just tried to get the minimum change with the method we have now. Either way, it looks like we have some progress :) |
just to track (this is an old issue), the current Makefile/dependencies/etc are not correct for tbprobe.o i.e. if for example types.h is modified, tbprobe.cpp is not recompiled, potentially leading to bugs:
make clean
or implicitlymake profile-build
can be used as a workaround.The text was updated successfully, but these errors were encountered: