-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
cuttlefish: add arm64 build #51956
cuttlefish: add arm64 build #51956
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,24 +1,25 @@ | ||||||||||||||||||||||||||
#!/bin/bash | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
mkdir build | ||||||||||||||||||||||||||
cd build | ||||||||||||||||||||||||||
export INCLUDES="-I${PREFIX}/include" | ||||||||||||||||||||||||||
export LIBPATH="-L${PREFIX}/lib" | ||||||||||||||||||||||||||
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib" | ||||||||||||||||||||||||||
export CXXFLAGS="${CXXFLAGS} -O3 -fcommon -I${PREFIX}/include" | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
unamestr=`uname` | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
if [ "$unamestr" == 'Darwin' ]; | ||||||||||||||||||||||||||
then | ||||||||||||||||||||||||||
export MACOSX_DEPLOYMENT_TARGET=10.15 | ||||||||||||||||||||||||||
export CFLAGS="${CFLAGS} -fcommon -D_LIBCPP_DISABLE_AVAILABILITY" | ||||||||||||||||||||||||||
export CXXFLAGS="${CXXFLAGS} -fcommon -D_LIBCPP_DISABLE_AVAILABILITY" | ||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||
# It's dumb and absurd that the KMC build can't find the bzip2 header <bzlib.h> | ||||||||||||||||||||||||||
export C_INCLUDE_PATH="$PREFIX/include" | ||||||||||||||||||||||||||
export CPLUS_INCLUDE_PATH="$PREFIX/include" | ||||||||||||||||||||||||||
if [[ `uname` == 'Darwin' ]]; then | ||||||||||||||||||||||||||
export MACOSX_DEPLOYMENT_TARGET=10.11 | ||||||||||||||||||||||||||
export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" | ||||||||||||||||||||||||||
export CONFIG_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_FIND_APPBUNDLE=NEVER" | ||||||||||||||||||||||||||
Comment on lines
+8
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Review macOS deployment target for ARM64 compatibility Setting if [[ `uname` == 'Darwin' ]]; then
- export MACOSX_DEPLOYMENT_TARGET=10.11
+ if [[ "${target_platform}" == "osx-arm64" ]]; then
+ export MACOSX_DEPLOYMENT_TARGET=11.0
+ else
+ export MACOSX_DEPLOYMENT_TARGET=10.11
+ fi 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||
# It's dumb and absurd that the KMC build can't find the bzip2 header <bzlib.h> | ||||||||||||||||||||||||||
export C_INCLUDE_PATH="$PREFIX/include" | ||||||||||||||||||||||||||
export CPLUS_INCLUDE_PATH="$PREFIX/include" | ||||||||||||||||||||||||||
export CONFIG_ARGS="" | ||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
cmake \ | ||||||||||||||||||||||||||
-DINSTANCE_COUNT=64 \ | ||||||||||||||||||||||||||
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \ | ||||||||||||||||||||||||||
-DCONDA_BUILD=ON \ | ||||||||||||||||||||||||||
.. | ||||||||||||||||||||||||||
make install | ||||||||||||||||||||||||||
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ | ||||||||||||||||||||||||||
-DCMAKE_CXX_COMPILER="${CXX}" \ | ||||||||||||||||||||||||||
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \ | ||||||||||||||||||||||||||
-DINSTANCE_COUNT=64 \ | ||||||||||||||||||||||||||
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \ | ||||||||||||||||||||||||||
"${CONFIG_ARGS}" | ||||||||||||||||||||||||||
cmake --build build/ --target install -j "${CPU_COUNT}" -v |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Optimize environment variable configuration
Several suggestions to improve the build configuration:
INCLUDES
andLIBPATH
appear redundant as they're already covered byCXXFLAGS
andLDFLAGS
-fcommon
flag suggests potential symbol collision issues. Consider fixing the multiple symbol definitions instead📝 Committable suggestion