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

ld: library not found for -lhon.framework/Versions/3.5/Pyt #2

Closed
Addisonbean opened this issue Jan 7, 2017 · 21 comments
Closed

ld: library not found for -lhon.framework/Versions/3.5/Pyt #2

Addisonbean opened this issue Jan 7, 2017 · 21 comments

Comments

@Addisonbean
Copy link

Addisonbean commented Jan 7, 2017

I am trying to compile kitty with Python 3.5.2 using python3 setup.y build, but it fails on this command:

gcc -Wall -O3 -pthread -shared /Users/addisonbean/misc/software/kitty/build/fast_data_types-charsets.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-colors.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-cursor.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-data-types.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-freetype.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-glfw.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-history.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-line-buf.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-line.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-parser.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-screen.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-sprites.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-tracker.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-parser_dump.c.o -L/Users/addisonbean/.pyenv/versions/3.5.2/lib -lhon.framework/Versions/3.5/Pyt -L/usr/local/Cellar/glew/2.0.0/lib -lGLEW -L/usr/local/opt/freetype/lib -lfreetype -L/usr/local/lib -lglfw3 -o /Users/addisonbean/misc/software/kitty/kitty/fast_data_types.so

I am getting this error:

clang: warning: argument unused during compilation: '-pthread'
ld: library not found for -lhon.framework/Versions/3.5/Pyt
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It looks like one of the options got truncated somehow. Any idea why this is happening? Thanks!

@kovidgoyal
Copy link
Owner

Are you doing this on OSX? kitty does not currently support OS X, although it should be relatively easy to port. This particular error occurs because of line 73 in setup.py It probably needs to be adjusted for OS X.

@kovidgoyal
Copy link
Owner

What does

python3 -c "import sysconfig; print(sysconfig.get_config_var('LDLIBRARY'))"

output

@samet
Copy link

samet commented Jan 7, 2017

I have the same issue. @kovidgoyal the output is:

Python.framework/Versions/3.5/Python

@kovidgoyal
Copy link
Owner

Hmm, so we need some way to get the full path to the python framework on OS X. Can somebody post the output of

python3 -m sysconfig

on OS X? That should hopefully have enough info to get the full path.

@samet
Copy link

samet commented Jan 7, 2017

@kovidgoyal I put sysconfig output here: http://samet.asopy.com/sysconfig.txt

@kovidgoyal
Copy link
Owner

I have made a commit that should fix this, although I currently dont have access to an OSX machine to test on

@Addisonbean
Copy link
Author

After that commit, I am now getting this error from python:

Traceback (most recent call last):
  File "setup.py", line 161, in <module>
    main()
  File "setup.py", line 154, in main
    init_env(args.debug, args.asan)
  File "setup.py", line 76, in init_env
    fd = fd[:fd.index('/Python.framework')]
ValueError: substring not found

@kovidgoyal
Copy link
Owner

Post the output of

python3 -m sysconfig

on your machine

@Addisonbean
Copy link
Author

Here is it: http://pastebin.com/X7M79WZm

@kovidgoyal kovidgoyal mentioned this issue Jan 8, 2017
@kovidgoyal
Copy link
Owner

Ah you are running under pyenv -- I added some code for that, try it again.

@Addisonbean
Copy link
Author

It seems closer, now I got this error:

ld: framework not found Python.framework

That was on this command:

gcc -Wall -O3 -shared /Users/addisonbean/misc/software/kitty/build/fast_data_types-glfw.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-charsets.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-colors.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-cursor.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-data-types.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-freetype.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-history.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-line-buf.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-line.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-parser.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-screen.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-sprites.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-tracker.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-parser_dump.c.o -F /Users/addisonbean/.pyenv/versions/3.5.2 -framework Python.framework -L/usr/local/Cellar/glew/2.0.0/lib -lGLEW -L/usr/local/opt/freetype/lib -lfreetype -L/usr/local/lib -lglfw3 -o /Users/addisonbean/misc/software/kitty/kitty/fast_data_types.so

@kovidgoyal
Copy link
Owner

Does Python.framework not exist in /Users/addisonbean/.pyenv/versions/3.5.2?

@kovidgoyal
Copy link
Owner

This commit might also make a difference 0cd0a9f

@Addisonbean
Copy link
Author

That last commit now gives me this error: http://pastebin.com/BCmibFGY

@kovidgoyal
Copy link
Owner

Ah looks like one more missing -framework arguments in the linker command. These should have been returned by pkg_config('glfw3', '--libs'). What does

pkg-config --libs glfw3

return on your system?

@Addisonbean
Copy link
Author

It returns -L/usr/local/lib -lglfw3.

@kovidgoyal
Copy link
Owner

This should do the trick: 192ce1d

@Addisonbean
Copy link
Author

Addisonbean commented Jan 10, 2017

That's closer, now I got this error:

Undefined symbols for architecture x86_64:
"_glBindTexture", referenced from:
_BindTexture in fast_data_types-data-types.c.o
"_glBlendFunc", referenced from:
_BlendFunc in fast_data_types-data-types.c.o
"_glClear", referenced from:
_Clear in fast_data_types-data-types.c.o
"_glClearColor", referenced from:
_ClearColor in fast_data_types-data-types.c.o
"_glDeleteTextures", referenced from:
_DeleteTexture in fast_data_types-data-types.c.o
"_glDisable", referenced from:
_Disable in fast_data_types-data-types.c.o
"_glDrawArrays", referenced from:
_DrawArrays in fast_data_types-data-types.c.o
"_glEnable", referenced from:
_Enable in fast_data_types-data-types.c.o
"_glGenTextures", referenced from:
_GenTextures in fast_data_types-data-types.c.o
"_glGetError", referenced from:
_Viewport in fast_data_types-data-types.c.o
_CheckError in fast_data_types-data-types.c.o
_ClearColor in fast_data_types-data-types.c.o
_GetProgramiv in fast_data_types-data-types.c.o
_GetShaderiv in fast_data_types-data-types.c.o
_Uniform2ui in fast_data_types-data-types.c.o
_Uniform1i in fast_data_types-data-types.c.o
...
"_glGetIntegerv", referenced from:
_GetIntegerv in fast_data_types-data-types.c.o
"_glGetString", referenced from:
_GetString in fast_data_types-data-types.c.o
"_glPixelStorei", referenced from:
_PixelStorei in fast_data_types-data-types.c.o
"_glTexParameteri", referenced from:
_TexParameteri in fast_data_types-data-types.c.o
"_glViewport", referenced from:
_Viewport in fast_data_types-data-types.c.o

@kovidgoyal
Copy link
Owner

That means the OpenGL libraries are not linked against. UNfortunately, I have no experience with OpenGL on OSX, so trying to figure out that the link flags for it should be is going to take some experimentation/googling.

@kovidgoyal
Copy link
Owner

Maybe try: -framework OpenGL

@kovidgoyal
Copy link
Owner

I have now got kitty building on OS X see #5 for details. Now to actually make it work :)

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

3 participants