-
Notifications
You must be signed in to change notification settings - Fork 86
png/zlib related error while running cmake on "Installing USD_FROM_GLTF" step #22
Comments
That is strange. We are using CMake, which is supposed to handle finding and linking in libraries appropriately. If you look in: Before: Can you add: That will at least tell you where CMake thinks your Zlib libraries are. Perhaps for some reason the install was incomplete since it appears to be finding the headers and a directory where it thinks zlib lives. (Otherwise it exists on the first line of that CMake file) Thanks, and sorry for the trouble! |
Thanks for the quick reply @C0DED00D, so I made the following edit:
This is the last bit of the log:
So from what I understood,
Which should CMake be looking for -- |
I believe it should be looking for the .so files. The zlib header seems to be defined, but at the linking stage, it can't find the symbol, which means the compiler is not loading the so for some reason. Are you using a 64 bit version of Ubuntu? This is a bit of a stretch, but is it possible that the .so is 64 bit and usd_from_gltf is 32 bit or something like that? |
I'm on a 64 bit machine: On another note, some people suggest adding List of "some people" |
I should note, I'm a complete newb to CMake so I don't even know what I'm talking about right now. Appreciate your patience! |
I am not a CMake expert either. -lz should tell it to link in zlib (which CMake should already take care of), but it seems worth a shot. I believe if you add the following lines: It'll add zlib explicitly to the command line. Can you give that a shot? |
I wasn't sure where to put the line so I tried putting it here and there but with no luck. |
I think at the top of the file would be the best - although I imagine it should work anywhere... |
Tried it and wasn't lucky this time either. |
Sorry for the slow response. Have you tried building zlib from scratch and then changing the Cmake file to point to the version you built directly? To do that, I'd delete this: and then set ZLIB_LIBRARIES to the directory of the zlib you built: |
Good news! It worked! For future reference if anyone stumbles upon this thread: I compiled zlib from source and replaced the However, this wasn't enough to solve the issue. I also had to make the following change:
I'm guessing it's because the PNG library depends on zlib so zlib had to be placed after the PNG library. Not sure why it wasn't a problem on my macOS though. I'll submit a PR that fixes the library order in |
I'm so glad that worked for you! It'd be worth trying to download zlib as a dependency, but it seems strange that the CMake check for zlib was executing successfully in your case but it would fail to link. |
Making these changes gives me the follow error still, assuming it can't find Zlib. Any help would be really appreciated @C0DED00D @simonseo!
|
@kowsheek I’m not sure what the problem might be, but it would be helpful if you provide these information: Which OS are you on? Can you post how your usd_from_gltf/process/CMakeLists.txt looks like right now? Also, where did you place your libz.so file? |
Thanks for responding @simonseo! My CMakeLists.txt file. I'm on Ubuntu:18.04. |
@kowsheek I think CMake tries to set |
It's the strangest thing, installing |
Hmmm.. This is a bummer that zlib keeps causing issues. From the perspective of CMake, it appears we are doing the right thing, but it's not working out for everyone. Do you have any suggestions on how to improve this? Thanks! |
@C0DED00D thanks for responding! As you mentioned previously, the process could be smoothed over by including it in the installation process. |
I hacked around this same problem on windows as follows:
Not the cleanest or most elegant but it works. |
Thanks for the info. I think we should try to download zlib as part of the python script and link against a local copy since it seems like this is problematic for a lot of folks. We'll add that to our backlog! Thanks for all of the investigations! |
Hi all, thanks for investigating this - I believe this commit should fix these problems going into the future. I'll close this as most of you have already solved your issues, but feel free to reopen if I broke the build for anyone or it still hasn't been resolved. |
Hi all,
Thanks for the great program. I'm trying to install ufg on a fresh Ubuntu 14.04 machine on AWS EC2. (I was running into too many problems on Ubuntu 18.04 so I downgraded to the same OS that USD's Travis CI uses)
I'm getting the following error and I would appreciate any help!
As I understand it, it seems that the png library cannot find zlib.
So far I've tried installing
zlib1g
andzlib1g-dev
via apt and installing from source (http://zlib.net/zlib-1.2.11.tar.gz
).I added the most obvious directories to PATH:
Here are all the zlib/libz related files I could find:
I'm not sure what LIBRARY_PATH and LD_LIBRARY_PATH variables do so I haven't really touched those.
Again, any pointers would be appreciated!
Thanks.
The text was updated successfully, but these errors were encountered: