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

Add Bindings section in Readme #310

Closed
wants to merge 1 commit into from
Closed

Conversation

realitix
Copy link
Contributor

@realitix realitix commented Mar 6, 2017

It's a good idea to reference shaderc binding in this Readme.
What do you think about that ?

It's a good idea to reference shaderc binding in this Readme.
@dneto0
Copy link
Collaborator

dneto0 commented Mar 7, 2017

Yes, I'm willing to add your binding to the readme once I can make it work.

I tried to do "pip install pyshaderc". But it failed.
Do I have to put libshader_combined.a in a special place for it to be found?

@realitix
Copy link
Contributor Author

realitix commented Mar 7, 2017

Thanks @dneto0 for your interest. I have updated the packaging, can you try again ? If there is an error, can you paste the error. It should work as is.

@dneto0
Copy link
Collaborator

dneto0 commented Mar 7, 2017

I've taken a closer look. I used "pip install --no-clean pyshaderc" to try to install but also avoid cleaning up its build files.

This is how it fails:

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_pyshaderc.o -L/tmp/pip_build_foo/pyshaderc/_cffi_build -lshaderc_combined -lstdc++ -o build/lib.linux-x86_64-2.7/pyshaderc/_pyshaderc.so

/usr/bin/ld: /tmp/pip_build_foo/pyshaderc/_cffi_build/libshaderc_combined.a(shaderc.cc.o): unrecognized relocation (0x2a) in section `.text'

/usr/bin/ld: final link failed: Bad value

I see that you have a copy of libshaderc_combined.a in the _cffi_build subdirectory.
I moved that aside and placed my own copy of libshaderc_combined.a there. Then the above step passes.

If this discussion goes on much longer, maybe it should move to an issue on your repo. :-)

@realitix
Copy link
Contributor Author

realitix commented Mar 7, 2017

I have created an issue in my repo: realitix/pyshaderc#1

@antiagainst
Copy link
Contributor

I used to have a hard time to compile shaderc and use it via FFI in Rust. I end up feeding CMake with extra configuration to make it work, especially for Windows.

Here is the build script: https://github.com/google/shaderc-rs/blob/master/build/build.rs. Hope it is useful in some sense.

@realitix
Copy link
Contributor Author

realitix commented Mar 7, 2017

Thanks @antiagainst !
I'm wondering about something. I ship libshaderc_combined.a but I have compiled it on my machine (linux 64 bits), it can't work on a 32 bit machine I think. I should put a static library for each environment and detect it during the pip install. What do you think about that @dneto0 ?

@dneto0
Copy link
Collaborator

dneto0 commented Mar 7, 2017

realitix@: I would just ship a 32-bit version. Hopefully we don't get shader compilation that requires more than a couple of gigabytes of memory!

@realitix
Copy link
Contributor Author

realitix commented Mar 8, 2017

@dneto0 I will not provide the static library, I am going to do like @antiagainst , i will compile the library during the install.

@realitix
Copy link
Contributor Author

realitix commented Mar 8, 2017

@dneto0 Can you try again, pyshaderc 1.0.9 should work everywhere now since it compiles shaderc on the fly.

Copy link
Collaborator

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a followup commit to clarify that bindings are maintained by 3rd parties.

@realitix
Copy link
Contributor Author

realitix commented Mar 9, 2017

Maybe you could add the @antiagainst rust binding too.

@dneto0
Copy link
Collaborator

dneto0 commented Mar 9, 2017

Yes, it would be good to add the rust binding as well. Let's do that as part of a separate PR.

FYI. I've been maintaining a known-good branch in shaderc that has a JSON file listing what commits from various projects work together. There's also a simple Python script to read that file and check out the right sources in the right configuration. That can be used to avoid guesswork about what should work with what, and might be helpful to people maintaining 3rd party bindings. I need to describe this in the README

@realitix
Copy link
Contributor Author

realitix commented Mar 9, 2017

@dneto0 Good to know the know-good branch! I will add that information in my readme too

@realitix
Copy link
Contributor Author

realitix commented Mar 9, 2017

This pull request is ok since you have added manually the content. Thanks

@realitix realitix closed this Mar 9, 2017
@realitix realitix deleted the add_binding branch March 9, 2017 15:39
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

Successfully merging this pull request may close these issues.

None yet

3 participants