Skip to content
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

Fixing compilation issues with external example #2013

Merged
merged 6 commits into from Mar 6, 2016
Merged

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented Mar 4, 2016

- also: fix documentation (remove stubs)
@hkaiser hkaiser added this to the 0.9.12 milestone Mar 4, 2016
@hkaiser
Copy link
Member Author

hkaiser commented Mar 4, 2016

@satyaki3794: Could you please verify whether this fixes your problem?

@satyaki3794
Copy link
Contributor

The directory hpx/examples/hello_world_component has hello.sh which contains the commands needed to build and run this example. I am not sure about this but I think some of the commands in that file are incorrect/incomplete. Compilation fails at the first step, while generating the .so file, which can be fixed by adding the -fPIC flag.

After that has been fixed, when I run ./hello.sh, I get the following compilation errors. http://pastebin.com/crgQsFwy.

Maybe, like this issue (#2009), the pkgconfig order in the .pc file is incorrect here too. I tried permuting the order of binaries like zao had done in the above case but to no avail.

@hkaiser
Copy link
Member Author

hkaiser commented Mar 4, 2016

Compilation fails at the first step, while generating the .so file, which can be fixed by adding the -fPIC flag.

I now added the -fPIC to the pkgcfg options. I also tried to compile it again, seems to work now.

@hkaiser hkaiser changed the title This fixes compilation issues with external example Fixing compilation issues with external example Mar 6, 2016
@satyaki3794
Copy link
Contributor

I built the 'fixing_2011' branch and ran hello.sh in hpx/examples/hello_world_component. I got the same compilation errors yet again (http://pastebin.com/C5HeFxtB). As the errors were regarding undefined references (to hpx::cout, write_async() etc.), I searched online and found a similar issue (#268).

The c++ command to run hello_world_client.cpp after generating the .so file, has the -lhpx_iostreams flag, and my LD_LIBRARY_PATH environment variable points to $HPX_INSTALL_LOCATION/lib. I am on Ubuntu 14.04 with gcc 4.8.2.
I tried moving around the -lhpx_iostreams flag in the command but wasn't able to resolve it.

@hkaiser
Copy link
Member Author

hkaiser commented Mar 6, 2016

@satyaki3794 I changed the pkgcfg files such that the HPX libraries are referenced by full file name. As outlined in #2009, this should at least fix that first issue you reported. I'm still not clear why you see those hpx::cout et.al. as missing symbols. They should be defined in libhpx_iostreams.so (could you verify whether they are defined there?).

@satyaki3794
Copy link
Contributor

Please move the -lhpx_iostreams flag to the end of the command while compiling hello_world_client.cpp. It resolves the compilation errors.

@satyaki3794
Copy link
Contributor

I built and tested the changes. Everything is working as expected.

hkaiser added a commit that referenced this pull request Mar 6, 2016
Fixing compilation issues with external example
@hkaiser hkaiser merged commit 04fa126 into master Mar 6, 2016
@hkaiser hkaiser deleted the fixing_2011 branch March 6, 2016 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compilation error while running sample hello_world_component code
2 participants