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

CMAKE_ARGS should contain -DCMAKE_BUILD_TYPE=None, else builds picks up -O3 instead -O2 #1859

Open
1 task done
jschueller opened this issue Dec 5, 2022 · 1 comment
Open
1 task done
Labels

Comments

@jschueller
Copy link
Contributor

jschueller commented Dec 5, 2022

Conda-forge documentation

  • I could not solve my problem using the conda-forge documentation.

Installed packages

latest builds on conda-forge:

eg https://dev.azure.com/conda-forge/84710dde-1620-425b-80d0-4cf5baca359d/_apis/build/builds/623322/logs/69

Environment info

linux/mac

Issue

in every package that use cmake for C/C++, C/CXXFLAGS look like that and want -O2 on linux/mac:

CFLAGS=-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem $PREFIX/include -fdebug-prefix-map=... -fdebug-prefix-map=...
CXXFLAGS=-fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=... -fdebug-prefix-map=...

but some cmake projects might default their CMAKE_BUILD_TYPE to Release and pick up
the default CMAKE_CXX_FLAGS_RELEASE="-O3 -DNDEBUG" which are appended conda forge's CXXFLAGS, and so override the -O2
(or Debug and pickup -g flag)

one solution is to add -DCMAKE_BUILD_TYPE=None, like Debian does

@jschueller jschueller added the bug label Dec 5, 2022
jschueller added a commit to jschueller/ctng-compiler-activation-feedstock that referenced this issue Dec 21, 2022
@isuruf
Copy link
Member

isuruf commented Dec 25, 2022

What's the issue with builds picking up -O3?

There are packages that don't support CMAKE_BUILD_TYPE=None, and this would break them. Also the clang conda compilers in macOS sets CMAKE_BUILD_TYPE=Release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants