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

Attempting to wrap CRoaring - maybe stdatomics related problem. #132

Open
Asc2011 opened this issue Nov 25, 2024 · 0 comments
Open

Attempting to wrap CRoaring - maybe stdatomics related problem. #132

Asc2011 opened this issue Nov 25, 2024 · 0 comments

Comments

@Asc2011
Copy link

Asc2011 commented Nov 25, 2024

Hi Peter,

i'm trying to wrap CRoaring. Cmake created libroaring.dylib. I work from ./CRoaring which contains roaring.c, roaring.h and roaring.hh. The roaring-header references e.g. <stdlib.h>, <stdint.h>, thats why i had to add the macOS-frameworks path.

import futhark
{.passL: "./libroaring.dylib".}

importc:
  #outputPath "./generated.nim" # throws an error ?
  syspath "/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include"
  path "./" 
  "roaring.h"

nim r --maxLoopIterationsVM:30000000 wrapper.nim yields

... many more ...
/Volumes/backup/Downloads/qemu/cc/CRoaring/wrapper.nim(5, 1) template/generic instantiation of `importc` from here
/Users/asc/.nimble/pkgs/futhark-0.7.4/futhark.nim(503, 14) template/generic instantiation of `importcImpl` from here
/Users/asc/.nimble/pkgs/futhark-0.7.4/futhark.nim(624, 11) Warning: Anonymous global: {"kind":"import","file":"/Volumes/backup/Downloads/qemu/cc/CRoaring/roaring.h","position":{"column":1,"line":2371},"import":"/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/stdint.h"} [User]
stack trace: (most recent call last)
/Users/asc/.nimble/pkgs/futhark-0.7.4/futhark.nim(619, 19) importcImpl
/Users/asc/.nimble/pkgs/futhark-0.7.4/futhark.nim(140, 29) addUsings
/Users/asc/.nimble/pkgs/futhark-0.7.4/futhark.nim(111, 10) findAlias
/Volumes/backup/Downloads/qemu/cc/CRoaring/wrapper.nim(5, 1) template/generic instantiation of `importc` from here
/Users/asc/.nimble/pkgs/futhark-0.7.4/futhark.nim(503, 14) template/generic instantiation of `importcImpl` from here
/Users/asc/.nimble/pkgs/futhark-0.7.4/futhark.nim(111, 10) Error: Unknown kind in findAlias: {"kind":"atomic","base":{"kind":"base","value":"uint32"}}
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

1 participant