-
Notifications
You must be signed in to change notification settings - Fork 22
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
How to multiple paths with header dependency #41
Comments
The example in the README is for libraries that have to be compiled into your project. You appear to link existing objects to your binary so the entire static section can be removed. Also if you pass import futhark
importc:
sysPath "/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/include"
path "/usr/include/elementary-1/"
path "/usr/include/eina-1/"
"Elementary.h"
"Efl_Config.h" With a build command like the one you used. |
Ok after adding all the dependencies are received this error now: nim c -d:release --passL: "$(pkg-config --cflags --libs elementary)" enim.nim Is this a memory issue? Here is my code:
|
Nah, it's just the Nim compiler not allowing the parser to parse such a large JSON object, it believes it has reached an infinite loop. Just increase the max iteration loop count with |
Ok that worked I now have a 123K executable file. Thank you now on to calling those functions and see if I can do something with them. Ok so I should be able to call this binary from nim , do you have documentation for that ? Also is there a way to actually see the functions ? Right now I'm running Futhark again and tee out a log. |
Call which binary from Nim? You import functions that you should then just call like normal Nim functions. You can see the functions in the generated Futhark cache file, or by |
Hello,
I am trying to create wrappers for efl libaries starting with Elementary https://git.enlightenment.org/enlightenment/efl/src/branch/master/src/lib/elementary
The only problem I am having is that when I want to wrap Elementary.h there is multiple dependencies in other directories
Here is my code:
`import futhark
importc:
sysPath "/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/include"
path "/usr/include/elementary-1/Elementary.h"
path "/usr/include/eina-1/Efl_Config.h"
static:
writeFile("enim.c", """
#define ELEMENTARY_IMPLEMENTATION
#include "/usr/include/elementary-1/Elementary.h"
#include "/usr/include/eina-1/Efl_Config.h"
""")
{.compile: "enim.c".}
`
Here is my error:
nim c -d:Debug --passL: "$(pkg-config --cflags --libs elementary)" enim.nim
Hint: used config file '/home/nixfreak/.choosenim/toolchains/nim-#devel/config/nim.cfg' [Conf]
Hint: used config file '/home/nixfreak/.choosenim/toolchains/nim-#devel/config/config.nims' [Conf]
................................................................................................................
/home/nixfreak/.nimble/pkgs/futhark-0.6.1/futhark.nim(521, 12) Hint: Running: opir -I/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/include -I/usr/include/elementary-1/Elementary.h -I/usr/include/eina-1/Efl_Config.h /home/nixfreak/.cache/nim/enim_d/futhark-includes.h [User]
/home/nixfreak/.nimble/pkgs/futhark-0.6.1/futhark.nim(528, 8) Hint: Parsing Opir output [User]
/home/nixfreak/.nimble/pkgs/futhark-0.6.1/futhark.nim(539, 10) Hint: Caching Opir output in /home/nixfreak/.cache/nim/enim_d/opir_CF17E89EA8CA239C.json [User]
/home/nixfreak/.nimble/pkgs/futhark-0.6.1/futhark.nim(542, 8) Hint: Generating Futhark output [User]
/home/nixfreak/.nimble/pkgs/futhark-0.6.1/futhark.nim(689, 8) Hint: Caching Futhark output in /home/nixfreak/.cache/nim/enim_d/futhark_F54D6D299808F288.nim [User]
/home/nixfreak/.nimble/pkgs/futhark-0.6.1/futhark.nim(647, 10) Warning: imported and not used: 'macros' [UnusedImport]
CC: enim
In file included from /home/nixfreak/build/enim.c:2:
/usr/include/elementary-1/Elementary.h:59:10: fatal error: Efl_Config.h: No such file or directory
59 | #include "Efl_Config.h"
| ^~~~~~~~~~~~~~
compilation terminated.
Error: execution of an external compiler program 'gcc -c -w -fmax-errors=3 -pthread -I'/home/nixfreak/.choosenim/toolchains/nim-#devel/lib' -I/home/nixfreak/build -o /home/nixfreak/.cache/nim/enim_d/enim.c.o /home/nixfreak/build/enim.c' failed with exit code: 1
The text was updated successfully, but these errors were encountered: