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

No code optimization in Makefile #1999

Open
bol-van opened this issue Jan 2, 2024 · 7 comments
Open

No code optimization in Makefile #1999

bol-van opened this issue Jan 2, 2024 · 7 comments

Comments

@bol-van
Copy link

bol-van commented Jan 2, 2024

No -O2, -O3. 'make' produces unoptimized, big and slow code.

@Vort
Copy link
Contributor

Vort commented Jan 2, 2024

Use make DEBUG=no to produce binary with optimizations.

@bol-van
Copy link
Author

bol-van commented Jan 2, 2024

I don't think it's a good idea to make DEBUG by default.
In compile guide there's no indication that DEBUG=no is required for production builds.
https://i2pd.readthedocs.io/en/latest/devs/building/unix/
Following instruction a user gets bad binary

@Vort
Copy link
Contributor

Vort commented Jan 2, 2024

I agree that documentation should be improved.
By the way, it is located in repository nearby:
https://github.com/PurpleI2P/i2pd_docs_en

@r4sas
Copy link
Member

r4sas commented Jan 2, 2024

If user build binary himself, I assume that user do it not just for fun. That's why debug is enabled by default.

@bol-van
Copy link
Author

bol-van commented Jan 3, 2024

User can do it for many reasons. For example, I do it because I use debian sid (unstable) , you do not have builds for sid, and mainteiners do not update i2pd fast.

Most programs expect configure/make to build, that's what most users expect

@LLE8
Copy link

LLE8 commented Jan 3, 2024

Use debuild --no-tgz-check -us -uc -b as described in documentation for Debian/Ubuntu.
In my cases (Bullseye, Bookworm) was -O2:
g++ -g -O2 -ffile-prefix-map=/home/user1/i2pd=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -std=c++17 -fPIC -maes -MMD -MP -DUSE_UPNP -D__AES__ -DOPENSSL_SUPPRESS_DEPRECATED -DGITVER=2.50.1-7-g c5cab05a -Ilibi2pd -Ilibi2pd_client -Ii18n -c -o obj/libi2pd/api.o libi2pd/api.cpp

@bol-van
Copy link
Author

bol-van commented Jan 4, 2024

Sure, there're many ways to make it properly.
I just emphasized that standard build way does not produce expected result as it does in most other programs

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

4 participants