-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Refactor Autotools build #974
Conversation
Use non-recursive make.
DO NOT MERGE YET. This needs a review and testing of the Autotools build on all platforms including training tools and various |
@stweil, can you review and test it? |
@stweil, I asked you to test it, not to break it... :-) |
I'm sorry. That breakage was not intentional of course. With 16 files involved, chances for a conflict are not so low. As I am not an expert for autotools, I wonder what could be the advantage of a non-recursive make. Do you have some documentation or examples how projects like Tesseract should use autoconf / automake? |
The main advantage is that IMO it is much more readable and easier to understand in that way. Also, I fixed the non-working as intended debug-mode. |
All these am files now include only list of source files. The include here is like C/C++ It's possible to just put the list of source files in the top Makefile.am, or to include just one file that will contain the list of source files. |
So all compilations are now using the same compiler flags? That has some disadvantages (unnecessary long include paths, unclear dependencies) and breaks portability of the generated binaries: if all files are compiled with AVX support, the resulting code will crash on CPUs without AVX. |
All the library files are using the same flags. I see no problem with that.
I don't think so. The 'logic' of the build is in the top Makefile.am. The SIMD flags are still added conditionally. |
The condition is based on compiler support, so as soon as my compiler supports AVX or SSE 4.1, those flags are enabled, no matter what my CPU supports. Now they are used for each compilation. The compiler will generate code with AVX or SSE instructions. That code will crash on a host without AVX or SSE. I made a branch with your patch at https://github.com/stweil/tesseract/tree/nonrecursivemake and resolved the conflicts. |
I can confirm that the debug mode uses |
If what you say is true, there will be a crash with the current implementation too. |
An Alternative Approach to Subdirectories Include Non-recursive Automake http://karelzak.blogspot.co.il/2013/02/non-recursive-automake.html |
CC: @jbreiden (In your Debian/Ubuntu maintainer hat) |
@stweil , I'm sorry about the typo in your name in the commit message! |
@stweil, you seem to like the non-recursive (auto)make idea now. Should I send a new PR? The arch directory will still build an internal automake library that has the simd flags. This should fix the issue you raised here. |
Indeed, I now see the advantages of using non-recursive builds. Maybe you can start with a PR which eliminates a single subdirectory, for example I think that code like this:
is easier to maintain than
|
I'll do it. I'll choose the style you like, shown in your comment. |
There's another thing I want to ask you. Here are 4 ways I can organize this task.
In any case, arch, training and unittest will stay the same as they are now. All these options will have the same efficiency. All of them will be non-recursive. What's your preference? |
I prefer variant 1. The current files |
@amitdo, did you already start working on the non-recursive make, or should I send a pull request? |
I didn't, so you can send it. |
Use non-recursive make.