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

I need to statically compile the geos and package it into my project. How can I set it up? #142

Open
allenlu2008 opened this issue Dec 7, 2023 · 4 comments

Comments

@allenlu2008
Copy link

I can use dynamic compilation to implement functions after installing libgeos on Ubuntu, but after the program is sent to other environments, if other machines do not have lib Geo, static compilation is required. I have already configured gcc, cmake, etc. on my machine, but I still don't know how to implement static compilation. What are the specific steps for static compilation?

I have been engaged in GIS development, but I am a novice in Rust. I hope to receive more detailed step-by-step instructions. Thank you.

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Dec 7, 2023

I'm not sure either as I never needed to do it. I suppose if you provide a statically compiled libgeos, it should just work?

EDIT: By that I meant not a .so in short, but maybe I'm completely wrong.

@allenlu2008
Copy link
Author

I see you write in the readme that if you need static compilation, you can use --feature static. I would like to know how to use this... I'm mainly a Rust novice。

If not, it's fine. You can directly set the system environment variable for Geos during deployment, but it's a bit more cumbersome.

@kylebarron
Copy link
Member

kylebarron commented Dec 7, 2023

Just a note that people often shy away from statically linking to GEOS because then you probably have to open up your own code under the LGPL license. E.g. shapely, which is Python bindings to GEOS, ships its own dynamically linked copy of GEOS with its Python bindings when distributing. You might consider shipping a copy of GEOS (dynamically linked) with your rust binary?

@allenlu2008
Copy link
Author

Yes, in some cases, we need to distribute copies of GeoS directly in the software, because many users do not have IT-related knowledge. For them, how to run the software as quickly as possible is what we need to consider. Therefore, static distribution has become a specifically emphasized requirement of customers. As for the LGPL, it is originally an academic project and is open source.

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