Skip to content

[enhancement](build-be) Support customizing extra compile flags#11444

Merged
yiguolei merged 1 commit intoapache:masterfrom
adonis0147:build
Aug 3, 2022
Merged

[enhancement](build-be) Support customizing extra compile flags#11444
yiguolei merged 1 commit intoapache:masterfrom
adonis0147:build

Conversation

@adonis0147
Copy link
Contributor

@adonis0147 adonis0147 commented Aug 2, 2022

Proposed changes

Add an environment variable EXTRA_CXX_FLAGS to customize the extra compile flags.

Problem summary

In our daily work, someones may want to change the compile flags to satisfy their requirements. This pr introduces a way to customize extra compile flags.

E.g.

Change the optimization level:

  1. Change it once.
BUILD_TYPE=ASAN EXTRA_CXX_FLAGS=-O3 ./build.sh --be
  1. Change it during login.
export EXTRA_CXX_FLAGS=-O3
BUILD_TYPE=ASAN ./build.sh --be
  1. Store it in file.
echo EXTRA_CXX_FLAGS=-O3 >> custom_env.sh
BUILD_TYPE=ASAN ./build.sh --be

Reference:

If you use multiple -O options, with or without level numbers, the last such option is the one that is effective.

Optimize-Options

Checklist(Required)

  1. Does it affect the original behavior:
    • Yes
    • No
    • I don't know
  2. Has unit tests been added:
    • Yes
    • No
    • No Need
  3. Has document been added or modified:
    • Yes
    • No
    • No Need
  4. Does it need to update dependencies:
    • Yes
    • No
  5. Are there any changes that cannot be rolled back:
    • Yes (If Yes, please explain WHY)
    • No

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@adonis0147 adonis0147 changed the title [enhancement](build) Support customizing extra compile flags [enhancement](build-be) Support customizing extra compile flags Aug 2, 2022
@jacktengg
Copy link
Contributor

LGTM

Copy link
Contributor

@yiguolei yiguolei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yiguolei yiguolei merged commit 573ebf2 into apache:master Aug 3, 2022
@adonis0147 adonis0147 deleted the build branch August 3, 2022 06:09
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

Successfully merging this pull request may close these issues.

3 participants