-
Notifications
You must be signed in to change notification settings - Fork 1
Boss typedef header #378
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
base: master
Are you sure you want to change the base?
Boss typedef header #378
Conversation
…OSS now writing typedefs to separate file
|
I'll perform some tests to see how this affects ditching the BOSSed backends. Update to follow. |
|
OK, test results are in. Just moving the typedefs out of the frontend header isn't enough to completely solve the issue of ditching BOSSed backends -- we can still have an issue with the factory functions defined via the LOAD_LIBRARY macro. (See gm2calc test results below.) But moving the typedefs to a separate header is anyway a step in the right direction (seems to do the trick for Vevacious), and anyway worth doing just for code clarity. I've tested with the branches First tests where I ditch gm2calc:
We get exactly the same issue on the new branch:
Then tests with ditching Vevacious:
But on the new branch this now seems to work:
It's not clear to me why we only get the factory linking issue for gm2calc and not Vevacious --- presumably it's about differences in how gm2calc and Vevacious are being used in GAMBIT, or about the fact that we define some BE_FUNCTIONs for gm2calc... My suggestion would anyway be that we merge this simple PR as an independent BOSS improvement, and then take the deeper discussion of how to ditch BOSSed backends back in #359. Or perhaps even start a new issue with gm2calc as our test case. What do you think, @tegonzalo? (Happy to keep working on the issue here if you prefer.) |
|
This is off the top of my head, so it could be wrong. When you ditch a backend, then the type harvester ignores it's frontend when collecting types. That is why you end up with undefined references. I honestly don't know what's up with vevacious, it's always given me an undefined reference error, never segfault. In any case, if my suspicion is correct, you should still get the same error in your branch without ditching the backends, because now you've moved the types to another file that the harvester doesn't know. My recommendation is that you just add the typedefs files to the list of searchable files for the harvester. These will always be there even if the backend is ditched, so the harvester will find them always. |
…d backend and includes it in backend_types_rollcall.hpp modified: Backends/scripts/backend_harvester.py modified: Utils/scripts/harvesting_tools.py
|
Finally had another look at this. I've updated the backend harvester script to harvest the new I think this is anyway sensible, but it doesn't solve the undefined reference problem for factory functions of ditched backends, like the case for gm2calc above. The reason is the same as before: the factory function is defined by the So perhaps we should just now finally ditch backend ditching and say that all frontend headers always will be compiled? We can discuss it in the Core meeting tomorrow. |
|
Quick update after our discussion today: A first test of extracting the But currently I'm just getting some A funfact I learned today: Even when ditching all modules except ExampleBit_*, the fully expanded code for gambit.cpp is around 450k lines... :D |
As discussed in PR #359:
The typedefs that used to go into the frontend header are now written to a separate file
backend_types/typedefs.hpp. This is included in the frontend header and inbackend_types/loaded_types.hpp.