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

Problem Running Tests with Readline Library in C #593

Closed
rohan-mehta-1024 opened this issue Oct 6, 2021 · 4 comments
Closed

Problem Running Tests with Readline Library in C #593

rohan-mehta-1024 opened this issue Oct 6, 2021 · 4 comments

Comments

@rohan-mehta-1024
Copy link

Hello I am having an issue trying to run the first test (my implementation is in C). I have created the following makefile which works when I run "make" in the directory of my implementation:

program: step0_repl.c
gcc -ledit step0_repl.c

But when I try to run the first test, it gives this error (there is some problem with the readline library?):

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C impls/c step0_repl
cc step0_repl.c -o step0_repl
Undefined symbols for architecture x86_64:
"_readline", referenced from:
_main in step0_repl-dcb634.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [step0_repl] Error 1
make: *** [impls/c/step0_repl] Error 2

I am very new to C and so don't understand what's going on. Apologies if this is an obvious question.

@dubek
Copy link
Collaborator

dubek commented Oct 6, 2021

Hi @rohan-mehta-1024 , try adding -lreadline as another argument to your cc line.

@rohan-mehta-1024
Copy link
Author

Hello @dubek, unfortunately this returns the same error message. Also, that cc line is what is run internally by the "text^quux^step0_repl" command - is there any way for me to get it to work by just running this command with some other argument? The thing I find confusing is when I just run make in the implementation directory, it compiles fine, but it's not able to compile when I try to run the tests.

@rohan-mehta-1024
Copy link
Author

Actually, now if I compile it first by running make in the implementation directory and then trying to run make "text^quux^step0_repl" at the top level, I get this error:

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C impls/c step0_repl
make[1]: `step0_repl' is up to date.
(call STEP_TEST_FILES,c,step0): impls/tests/step0_repl.mal

Testing test^c^step0; step file: impls/c/step0_repl, test file: tests/step0_repl.mal
Running: env STEP=step0_repl MAL_IMPL=js ../../runtest.py --deferrable --optional ../tests/step0_repl.mal -- ../c/run
Traceback (most recent call last):
File "../../runtest.py", line 230, in
r = Runner(args.mal_cmd, no_pty=args.no_pty, line_break="\r\n" if args.crlf else "\n")
File "../../runtest.py", line 105, in init
env=env)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 394, in init
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
make: *** [test^c^step0] Error 1

Any ideas?

@rohan-mehta-1024
Copy link
Author

I have since fixed the issue, thanks! (I had to add executable permissions to my run script?)

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