Make sharedmemory api a compile time option