vladholubiev / serverless-libreoffice

Run LibreOffice in AWS Lambda to create PDFs & convert documents
https://vladholubiev.com/serverless-libreoffice
510 stars 74 forks source link

libstdc++ is now newer #16

Open gritnix opened 5 years ago

gritnix commented 5 years ago

It appears that the gcc72-c++ package now has a NEWER version of libstdc than is really used in the lambda environment. The lambda environment has libstdc++.so.6.0.20 and the latest version of gcc72-c++ has .24. Your scripting worked well, but the resulting soffice.bin wouldn't run in lambda because of this. Easiest solution was to just take the .24 version of the library and plunk it into instdir/program and then creating a soft link in there as well called libstdc++.so.6 that points to that now-local .24 version. Might need to add that to the scripting. Other option would be to specify a hard version of gcc72-c++ since as of 3/8/19 it's using libstdc++72-7.2.1-2.59.amzn1.x86_64. A slightly older version there probably is what includes the .20 version of libstdc. Thanks for all the hard work.

pittcr3w commented 5 years ago

Hi @gritnix, using one of the methods you described above, were you able to successfully compile a new version of LibreOffice that works in lambda? When I compile libre it works fine on my local machine, but in lambda it results in this error: /tmp/instdir/program/oosplash: /var/lang/lib/libstdc++.so.6: versionCXXABI_1.3.9' not found (required by /tmp/instdir/program/libuno_sal.so.3) /tmp/instdir/program/oosplash: /var/lang/lib/libstdc++.so.6: version GLIBCXX_3.4.21' not found (required by /tmp/instdir/program/libuno_sal.so.3)

If you successfully compiled a newer version of LibreOffice, would you possibly be willing to share it?

gritnix commented 5 years ago

I was able to get it working, and the real trick was to create an EC2 instance using the same AMI that Lambda uses. Don't use your local machine to compile, create an EC2 instance just to compile it. Even still, you'll need to do that glibc thing I mention above. I might be able to just share it, let me see if I can find a place to put it, but start down that road of making an EC2 instance using that AMI. Pretty simple.

pittcr3w commented 5 years ago

@gritnix Thank you for the reply, I already compiled it with the EC2 instance, I meant just converting pdf's I tried both in the EC2 instance and locally and the program worked correctly. It's just when it's in lambda that it breaks. Could you elaborate a little more on what to do with the glibc thing? I'm not sure I understand the part about creating a soft link. If you're willing to share it, you could probably just upload it to google drive or something similar.