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
#include <hpx/hpx_main.hpp> does not work #943
Comments
The correct prototype is:
if you use that, it works. |
Ok, I just checked the Standard. You're right, |
Those two function signatures are actually the same. There might be something else going on here. |
Eric, if this does not fix the issue (as it might not), please give us the preprocessed output from your file containing main. |
This did not fix the issue. Also, could you tell me how to re-open an issue? |
Re-openeing as it's not fixed. This should definitely work:
and indeed it does work in many places. So something else is going on. Let me explain how it's supposed to work.
Further, the static library What could be wrong? Some ideas:
What else could be wrong? |
This is my link command:
These are the options used by Cactus, augmented from the HPX options gathered via pkg-config. This is an Ubuntu system. |
Which module referenced from the linker command above has the |
Thanks for the explanation. In Cactus, all thorns are linked into static libraries, which are then passed to the linker. This includes the main routine. In other words, the Cactus main routine (which is now hpx::user_main) is not linked unconditionally, but is searched in the static libraries passed to the linker. I assume that hpx_init.a is a random-access static library, so that its hpx::user_main will be preferred over the one defined in libthorn_Cactus.a. I don't know how to correct this with link order. Since I have a work-around and we understand the problem, you could just document this and close this issue. |
Ahh, so the problem is that the correct |
I tried to used #include <hpx/hpx_main.hpp> to wrap my main function. My code looked approximately like this:
This builds fine, but aborts at run time with an error stating that no hpx_main or hpx_main_user is defined:
This is incorrect:
I assume the problem is that there are two functions hpx_main, one defined in my executable, the other defined in an HPX shared library. At run time, the version in the shared library is used, leading to this error.
This work-around works for me:
If the problem is indeed as I described above, then you could implement my work-around in HPX.
The text was updated successfully, but these errors were encountered: