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

[GEOS] Remove -g options to compilers to reduce size #235

Merged
merged 1 commit into from
Nov 27, 2019

Conversation

giordano
Copy link
Member

configure is generating a Makefile with

CFLAGS = -g -O2
CXXFLAGS = -g -O2

Here we just set

CFLAGS=-O2
CXXFLAGS=-O2

These are the sizes of the resulting libraries for x86_64-w64-mingw32:

% ls -lh GEOS.v3.8.0.x86_64-w64-mingw32/bin 
total 3.8M
-r-xr-xr-x 1 mose mose 1.3K Nov 26 02:21 geos-config
-r-xr-xr-x 1 mose mose 3.0M Nov 26 02:21 libgeos-3-8-0.dll
-r-xr-xr-x 1 mose mose 815K Nov 26 02:21 libgeos_c-1.dll

I think this is a good improvement compared to the current situation, without doing any magic. Ref #234. CC: @jaakkor2 @visr

@giordano giordano added the Science 👩‍🔬 Builder of scientific libraries label Nov 26, 2019
@giordano
Copy link
Member Author

giordano commented Nov 26, 2019

If I further manually run strip on the libraries I get

% ls -lh GEOS.v3.8.0.x86_64-w64-mingw32/bin
total 1.7M
-r-xr-xr-x 1 mose mose 1.3K Nov 26 02:21 geos-config
-r-xr-xr-x 1 mose mose 1.5M Nov 26 02:35 libgeos-3-8-0.dll
-r-xr-xr-x 1 mose mose 220K Nov 26 02:35 libgeos_c-1.dll

@jaakkor2
Copy link
Contributor

Great!

If I strip the Linux libraries from the installed version (on Julia v1.3.0-rc5, LIbGEOS#artifact), I get

ERROR: InitError: could not load library "/home/jaakkor2/.julia/artifacts/7e3b40b7bb49e6ecd2ba78970ab38051a518acce/lib/libgeos_c.so"
/home/jaakkor2/.julia/artifacts/7e3b40b7bb49e6ecd2ba78970ab38051a518acce/lib/libgeos_c.so: ELF load command address/offset not properly aligned

🤔

@visr
Copy link
Contributor

visr commented Nov 26, 2019

Thanks Mosè, this looks like a good improvement to me.

@staticfloat
Copy link
Member

Yeah, let's try not to use strip; it does things that patchelf finds unpalatable.

@giordano giordano merged commit ccc21f7 into JuliaPackaging:master Nov 27, 2019
@giordano giordano deleted the geos-no-debug branch November 27, 2019 01:46
@giordano
Copy link
Member Author

giordano commented Nov 27, 2019

Pending pull request for the registry: JuliaRegistries/General#5907. Binaries are at GEOS-v3.8.0+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Science 👩‍🔬 Builder of scientific libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants