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

'NN_ALLOC_PAGEALIGN' undeclared (first use in this function) #3

Open
salmr0 opened this issue Nov 9, 2016 · 7 comments
Open

'NN_ALLOC_PAGEALIGN' undeclared (first use in this function) #3

salmr0 opened this issue Nov 9, 2016 · 7 comments

Comments

@salmr0
Copy link

salmr0 commented Nov 9, 2016

Hi,

I understand that this is still under active development and I just wanted to give this a try and possibly help test. I am hoping you can point me to the right versions of things so that I can get a build.

I am working with a fresh clone of https://github.com/wavesoft/nanomsg/ to which I apply patch-nanomsg.sh script succesfully.

After running config with the OFI options I get this error message(see attached file):
err.txt

I can get by the src/transports/ofi/sofi.c:158:18: error: array type has incomplete element type
error fixed by adding the #include <sys/uio.h> header file to sofi.c

However I can not find where NN_ALLOC_PAGEALIGN is defined to fix that error message.
Any pointers would help. Thanks

@wavesoft
Copy link
Owner

wavesoft commented Nov 9, 2016

Hello @salmr0 , yes, this requires a particular feature in nanomsg not yet included. I was hoping for my PR on nanomsg to be merged by now (nanomsg/nanomsg#620), but apparently it didn't got the attention required.

You can try my fork of nanomsg here: https://github.com/wavesoft/nanomsg/tree/pull-pagealign (the branch pull-pagealign) - note that it might be a bit outdated.

@wavesoft
Copy link
Owner

wavesoft commented Nov 9, 2016

Also, perhaps have a look on the devel-ofiw branch, that it has a bit more optimised version (and an a bit newer readme) https://github.com/wavesoft/nanomsg-transport-ofi/tree/devel-ofiw

@salmr0
Copy link
Author

salmr0 commented Nov 9, 2016

hi,

Thanks for the update. I tried the pull-pagealign branch and got a bit further. Now its failing at the link stage with this message:

CCLD nanocat
./.libs/libnanomsg.so: undefined reference to 'nn_chunk_reset'
./.libs/libnanomsg.so: undefined reference to 'nn_chunk_deref'
collect2: error: ld returned 1 exit status
make: *** [nanocat] Error 1

@wavesoft
Copy link
Owner

wavesoft commented Nov 9, 2016

Hello @salmr0 , try to add this to the beginning of sofi.c.

extern void* nn_chunk_reset(void *p, size_t size);
extern void *nn_chunk_deref ( void *p);

These were supposed to be private to nanomsg, yet accessible by the linker. (They are defined here https://github.com/wavesoft/nanomsg/blob/pull-nn_allocmsg_ptr/src/utils/chunk.c#L360)

@salmr0
Copy link
Author

salmr0 commented Nov 9, 2016

I think I see the problem. I am working with the pull-pagealign branch as suggested. That one seems to be based on autoconf tools and the patches and script work fine there.

The chunk.c file on that branch does not have nn_chunk_reset or nn_chunk_deref defined
https://github.com/wavesoft/nanomsg/blob/pull-pagealign/src/utils/chunk.c

The chunk.c file you pointed me to is from the pull-nn_allocmsg_ptr branch. That one seems to be based on Cmake and no longer uses autoconf and the patches from nanomsg-transport-ofi no longer work.

Do you have a set of patches from nanomsg-transport-ofi that are a bit more updated and work with the later Cmake based versions of nanomsg?

@wavesoft
Copy link
Owner

wavesoft commented Nov 9, 2016

Damn. You are right, I stopped working on this project the moment nanomsg decided to swich to CMake and I didn't have time to complete the migration.

You could try the other way around, and use this commit from the pull-nn_allocmsg_ptr branch: wavesoft/nanomsg@cdecf18

That's the last one of my changes before I merged the CMake changes from nanomsg upstream.

Sorry for all this trouble 😞

@salmr0
Copy link
Author

salmr0 commented Nov 10, 2016

hum. Patch fails there as well trying to get applied to src/core/global.c.

Thanks for trying to help. If you find a combination that works let me know and I would be happy to try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants