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

Compiler is unable to compile samples #3

Open
Soupertonic opened this issue May 8, 2023 · 3 comments
Open

Compiler is unable to compile samples #3

Soupertonic opened this issue May 8, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@Soupertonic
Copy link

Soupertonic commented May 8, 2023

Platform

  • ISA: ARM64
  • CPU: Apple M1 Pro
  • OS: Ventura 13.1 (22C65)
  • LLVM: 14.0.6_1

Description

When attempting to compile the samples, the compiler would spit outCan't create output file Undefined error: 0 for all files it's trying to compile. It seems like it is unable to write to output.o for some reason. (Message is generated here: amun_compiler.cpp, line 72; this commit's file tree 85457f4)

Unsuccessful attempts to fix the issue

  • Replaced OF_None with OF_Append
  • Replaced OpenFlags with FileAccess value of FA_Write
  • chmod'd Amun compiler binary (777)
  • chmod'd Amun compiler directory (777, recursively)

Reproduction

  • Clone Amun repository
git clone https://github.com/amrdeveloper/amun.git
  • Follow build instructions
cd amun
mkdir build
cd build
cmake ..
make
  • Try compiling samples
python scripts/compile_samples.py
@AmrDeveloper
Copy link
Owner

Hello @Soupertonic,

This issue happened on M1,

Can you please try to compile to IR

cd bin
./amun compile-ir ../samples/Hello.amun

to run it using lli

lli output.ll

then we can try to link manually to detect the issue and solve it soon

@AmrDeveloper AmrDeveloper added the bug Something isn't working label May 8, 2023
@Soupertonic
Copy link
Author

Soupertonic commented May 8, 2023

I'm afraid that doesn't work. When trying to compile to IR I get the same error message.

$ ./amun emit-ir ../samples/Hello.amun
Can't create output file Undefined error: 0

It creates the output.ll file but its size is 0 bytes.

@AmrDeveloper
Copy link
Owner

That means the problem is not trom external linker or creating files, it comes from emit object or ll code oj M1,

I will try to found the reason for that and solve it soon, also i will provide a docker file to be useful in this temporary cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants