Hi Jeff & Samuel,
about the problems with linking, passing only the handle I can
recompile the .so, but I cannot initialize constants, at least on my
system.
So exporting handles works, it is having addressing directly of
external variables that have that type that is problematic, because
then the address is a constant, but the variable is checked by the
liker against its size. I have seen the trick with constant size
struct that you use in openmpi.
Adding functions that alloc & dealloc does not mean that the struct
has to be purely mallocated, I think it might be worthwhile to keep
something size+pointer so that if the size is small say less than
size_t the cpuset is stored where otherwise there is the pointer... or
something like that.
Indeed I would keep a minimal struct...
Fawzi