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

Building on Linux #104

Closed
Rayfoundry opened this issue May 29, 2018 · 14 comments
Closed

Building on Linux #104

Rayfoundry opened this issue May 29, 2018 · 14 comments

Comments

@Rayfoundry
Copy link

Rayfoundry commented May 29, 2018

Hi,

running into a situation where the binary created with the instructions provided in the readme do not work on CentOS and AmazonLinux system.

/lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found
/lib64/libstdc++.so.6: version CXXABI_1.3.8' not found /lib64/libstdc++.so.6: version GLIBCXX_3.4.21' not found`

The required version of libstdc++ is not easily availabe. Would it be possible to create a make configuration that statically includes the required libs? Having to be dependent on a specific gcc environment (for development) on the linux machines running fbx2gltf seems odd.

P.S.: Am I getting it all wrong?

EDIT: Some context: Had to use the instructions from https://www.matbra.com/2017/12/07/install-cmake-on-aws-linux.html in the first way to get the build process running.

@zellski
Copy link
Contributor

zellski commented May 29, 2018

At first I thought this was a duplicate of #65, but in that one I conclude that compiling from source on the target machine is the most realistic way. From your experience, it appears that that, too, is difficult.

I will see if I can spin up an AWS instance with a CentOS build of sufficient ancientness. Could you tell me precisely which version I should try to match? Also if you were able to find out (perhaps just using 'ldd') what exactly is demanding this GCC/ABI version? I don't think it's the FBX SDK, but I could be wrong.

@zellski zellski added this to the 1.0 milestone May 29, 2018
@Rayfoundry
Copy link
Author

Rayfoundry commented May 29, 2018

Hi Pär,

it's not really a AWS think. I think any CentOS 6 based distribution will do. Do you do Docker? Would it help if I provide you a Dockerfile (e.g. from Docker Hub)? This could also greatly help others wanting to build from the dev branch. Give me a sec, I'll create one and post it to Docker Hub.

Running will be like: docker run -v -it --rm -v <host_directory>/Repos/fbx2gltf-docker/bin:/root/bin fbx2gltf:centos6

Give me an hour or so...

EDIT: Just realized that I can't bundle fbxsdk. I have a solution though.

@zellski
Copy link
Contributor

zellski commented May 29, 2018

It looks like AmazonLinux is much more than just CentOS 6; it has upgrades to a lot of the packages that are not in even e.g. version 6.9 of vanilla CentOS. I've duplicated the setup now with CMake 3.2 and GCC 4.8 and I'll see what I can find out.

@Rayfoundry
Copy link
Author

Centos6 gave me some headache because gcc was too old...

But I created a Repo with a Dockerfile at https://github.com/Rayfoundry/fbx2gltf-docker. Current state is that it cannot build completely because of some draco sources in your cmake process. The repo has some instructions how to build the dockerfile. When you run the container it automatically tries to build FBX2glTF.

If you find a solution, please let me know, so I can update the Dockerfile accordingly. Maybe it would be nice to have more easy way to build from source?

Daniel

@zellski
Copy link
Contributor

zellski commented May 29, 2018

I just ran into the Draco problem as well (both with the 4.8 GCC and with 4.9.2 which I literally compiled from scratch in order to try.)

I'm not sure it's feasible for me to try to debug Draco source, and it's possible they absolutely require a more modern GCC. However, I will at the very least post an issue with them and see if that helps, and I can dig in a little bit. Maybe it's something trivial.

Sorry for calling you Max earlier, I got my email/github streams crossed. :)

@zellski
Copy link
Contributor

zellski commented May 30, 2018

It looks to me, tentatively, like a binary compiled with 4.9.2 on one of these AmazonLinux distributions will run on any vanilla AmazonLinux distribution. Unfortunately, GCC 4.9.2 has to be compiled from scratch for that distribution. Luckily, this is quite doable, and as you pointed out the magic of Docker will help users dramatically.

I still want to repeat the steps I took using your Docker base, and make sure the binary runs on a completely virginal distribution. But right now it looks positive.

@Rayfoundry
Copy link
Author

Rayfoundry commented May 30, 2018

I had some success with CentOS7 (https://github.com/Rayfoundry/fbx2gltf-docker/tree/centos7) which I was able to build with when enabling devtoolset-7 (which gives a pretty recent gcc). Currently confirming everything works and then I'll try to do the same on CentOS6 & amazonlinux and provide a Dockerfile for that one too.

The Docker container is configured to write back the binary into the directory the container has been run (which should be the cloned repo) and it sources in the fbxsdk via a mounted volume so it should be OK regarding the license.

@zellski
Copy link
Contributor

zellski commented May 30, 2018

I could not find any functioning pre-built toolchain package for AmazonLinux based on CentOS 6 with a recent enough GCC, but I don't remember seeing "devtoolset-7" so maybe I just missed that! Worst case, if you can't find one either, we can just include 4.9.2 built from source in the Docker image.

There is one more complication on the horizon, which is that as soon as it's feasible, I want to switch to C++14. I am not really much of a C/C++ programmer and I am definitely not very interested in Boost libraries or other complicated ways to get powerful cross-platform features. But as soon as C++14 is truly available on all three platforms, I am switching -- and it seems plausible that'll leave 4.9.2 in the dust as well (it looks like 4.9.2 actually does support 14, but maybe not so completely? Anyway, just something to keep in mind.)

@zellski
Copy link
Contributor

zellski commented May 30, 2018

Until now, I have been using the dockcross cross-compilation images at https://hub.docker.com/u/dockcross/ to create the Linux build. What you are putting together would almost certainly replace that. In an ideal world, there's a Windows one too (but I guess it'd have to run on a Windows host -- or VM.)

@Rayfoundry
Copy link
Author

Rayfoundry commented May 31, 2018

From amazonlinux 2017.09 on there is a package gcc64 which can be easily installed. cmake is still 2.8 though and needs to be build from source. That's where I have a problem: cmake doesn't regonize gcc64 and says there's no C++ compiler available. Any idea?

Error when bootstrapping CMake: Cannot find a C++ compiler supporting C++11 on this system. Please specify one using environment variable CXX.

@Rayfoundry
Copy link
Author

Rayfoundry commented May 31, 2018

Solved. Currently supported distros are: CentOS6, CentOS7, Amazon Linux 1 & Amazon Linux 2.

Check instructions on: https://github.com/Rayfoundry/fbx2gltf-docker

@Rayfoundry
Copy link
Author

There's now also a DockerHub with the images supporting some additional distros such as nvidia/cudagl.

https://hub.docker.com/r/rayfoundry/fbx2gltf-docker/

P.S.: My problem is solved now. If you'd like to incorporate the docker based process and have some requirements, please let me know.

@zellski
Copy link
Contributor

zellski commented May 31, 2018

This is really exciting. I just successfully got result/FBX2glTF using the amazonlinux1 branch.

One question, though, as I run out the door: have you tested to see if that resulting binary actually runs on your original target platform? Or: do you figure that the target runtime environment would always be a similarly updated variants of CentOS/AmazonLinux?

@Rayfoundry
Copy link
Author

I think so, but I only just tested with the cudagl target (building binary for CentOS7 used in the nvidia/cudagl docker containers) and it works when I run the generated binary within our nvidia/cudagl based docker container. 😸

@zellski zellski closed this as completed Sep 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants