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

CppInterOp doesn't find stddef.h #1

Closed
maleadt opened this issue May 30, 2024 · 5 comments
Closed

CppInterOp doesn't find stddef.h #1

maleadt opened this issue May 30, 2024 · 5 comments

Comments

@maleadt
Copy link

maleadt commented May 30, 2024

It may be a little early for filing issues, so stop me if I should just wait, but I encountered the following when testing the basic example:

julia> Cpp.Declare("""
       #include <iostream>
       #include <vector>
       """)
In file included from <<< inputs >>>:1:
In file included from input_line_2:1:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/iostream:41:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/ostream:40:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/ios:40:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/iosfwd:42:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/postypes.h:40:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/cwchar:44:
/usr/include/wchar.h:35:10: fatal error: 'stddef.h' file not found
   35 | #include <stddef.h>
      |          ^~~~~~~~~~

Relevant copies of stddef.h on my system (Arch Linux) are in:

/usr/include/linux/stddef.h
/usr/lib/clang/17/include/stddef.h
/usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/stddef.h
@Gnimuc
Copy link
Owner

Gnimuc commented Jun 1, 2024

Configuring a JLL-compatible-binary-build environment is tricky(see how we did in Clang.jl). I'm still working on it.

If you want to play with it a bit, you can pass -v to Cpp.CreateInterpreter(["-v"]) to get the list of wrong search paths the compiler used.

@Gnimuc
Copy link
Owner

Gnimuc commented Jun 4, 2024

@maleadt This should be fixed now. But the Linux CI keeps failing...

https://github.com/Gnimuc/CppInterOp.jl/actions/runs/9367490416/job/25787279012#step:9:141

@maleadt
Copy link
Author

maleadt commented Jun 5, 2024

Thanks, I'll try this out.

I guess the goal would be do redistribute necessary headers as a JLL instead of picking them up from the system? Especially for use on Windows.

@maleadt
Copy link
Author

maleadt commented Jun 5, 2024

But the Linux CI keeps failing...

https://github.com/Gnimuc/CppInterOp.jl/actions/runs/9367490416/job/25787279012#step:9:141

Symbols not found: [ llvm_orc_registerEHFrameSectionWrapper ]

That's LLVM being broken: llvm/llvm-project#74671
Also see maleadt/LLVM.jl#405. I haven't found a workaround...

@maleadt
Copy link
Author

maleadt commented Jun 21, 2024

Thanks, the issue reported here is fixed. It "just" triggers the ORC bug now:

julia> Cpp.Declare("#include <iostream>")
Failed to execute via ::process:Symbols not found: [ llvm_orc_registerEHFrameSectionWrapper ]
1

julia> Cpp.Process("""std::cout << 42 << std::endl;""")
Failed to execute via ::process:Symbols not found: [ llvm_orc_registerEHFrameSectionWrapper ]
1

@maleadt maleadt closed this as completed Jun 21, 2024
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