Skip to content

Commit

Permalink
My defaults + adapt to arch
Browse files Browse the repository at this point in the history
  • Loading branch information
wiechula committed Feb 20, 2024
1 parent 11b6b98 commit f40d6a7
Show file tree
Hide file tree
Showing 31 changed files with 149 additions and 21 deletions.
3 changes: 3 additions & 0 deletions aegis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ source: https://github.com/AliceO2Group/AEGIS.git
prepend_path:
LD_LIBRARY_PATH: "$AEGIS_ROOT/lib"
ROOT_INCLUDE_PATH: "$AEGIS_ROOT/include"
valid_defaults:
- o2
- jw
---
#!/bin/bash -e
FVERSION=`gfortran --version | grep -i fortran | sed -e 's/.* //' | cut -d. -f1`
Expand Down
6 changes: 6 additions & 0 deletions apmon-cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ rsync -a --exclude='**/.git' --delete --delete-excluded \
$SOURCEDIR/ ./
autoreconf -ivf

case $ARCHITECTURE in
arch*)
LIBTIRPC_ROOT=/usr
;;
esac

if [[ -n ${LIBTIRPC_ROOT} ]];
then
export CXXFLAGS="${CXXFLAGS} -I${LIBTIRPC_ROOT}/include/tirpc"
Expand Down
19 changes: 18 additions & 1 deletion arrow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
---
#!/bin/bash -e
mkdir -p "$INSTALLROOT"
SONAME=so
case $ARCHITECTURE in
osx*)
# If we preferred system tools, we need to make sure we can pick them up.
Expand All @@ -43,9 +44,17 @@ __ZNK4llvm*
EOF
CMAKE_SHARED_LINKER_FLAGS="-Wl,-unexported_symbols_list,$PWD/no-llvm-symbols.txt"
;;
arch*)
#[[ ! $RE2_ROOT ]] && RE2_ROOT=/usr
[[ ! $LZ4_ROOT ]] && LZ4_ROOT=$(dirname $(dirname $(which lz4)))
[[ ! $RAPIDJSON_ROOT ]] && RAPIDJSON_ROOT=/usr
CLANG_EXECUTABLE=/usr/bin/clang++
[[ ! $CLANG_VERSION ]] && CLANG_VERSION=$($CLANG_EXECUTABLE --version | grep version | sed 's|.*version ||')
;;
*) SONAME=so ;;
esac

echo "CLANG_VERSION: $CLANG_VERSION"
# Downloaded by CMake, built, and linked statically (not needed at runtime):
# zlib, lz4, brotli
#
Expand All @@ -57,18 +66,25 @@ esac

mkdir -p ./src_tmp
rsync -a --exclude='**/.git' --delete --delete-excluded "$SOURCEDIR/" ./src_tmp/
CLANG_VERSION_SHORT=`echo $CLANG_VERSION | sed "s/\.[0-9]*\$//" | sed "s/^v//"`
CLANG_VERSION_MAIN=`echo $CLANG_VERSION | sed "s/\(\.[0-9]\)*\$//" | sed "s/^v//"`
sed -i.deleteme -e "s/set(ARROW_LLVM_VERSION \".*\")/set(ARROW_LLVM_VERSION \"$CLANG_VERSION_SHORT\")/" "./src_tmp/cpp/CMakeLists.txt" || true
sed -i.deleteme -e "s/set(ARROW_LLVM_VERSIONS \".*\")/set(ARROW_LLVM_VERSIONS \"$CLANG_VERSION_SHORT\")/" "./src_tmp/cpp/CMakeLists.txt" || true
sed -i.deleteme -e "s/set(ARROW_LLVM_VERSIONS/set(ARROW_LLVM_VERSIONS\n \"$CLANG_VERSION_SHORT\"/" "./src_tmp/cpp/CMakeLists.txt" || true

case $ARCHITECTURE in
osx*)
CLANG_EXECUTABLE=/usr/bin/clang
;;
*)
CLANG_EXECUTABLE=${CLANG_ROOT}/bin-safe/clang
# CLANG_EXECUTABLE=${CLANG_ROOT}/bin-safe/clang
# this patches version script to hide llvm symbols in gandiva library
sed -i.deleteme '/^[[:space:]]*extern/ a \ \ \ \ \ \ llvm*; LLVM*;' "./src_tmp/cpp/src/gandiva/symbols.map"
;;
esac

export LDFLAGS=-lpthread

cmake ./src_tmp/cpp \
${CMAKE_SHARED_LINKER_FLAGS:+-DCMAKE_SHARED_LINKER_FLAGS="$CMAKE_SHARED_LINKER_FLAGS"} \
-DARROW_DEPENDENCY_SOURCE=SYSTEM \
Expand Down Expand Up @@ -111,6 +127,7 @@ cmake ./src_tmp/cpp
-DARROW_COMPUTE=ON \
-DARROW_BUILD_STATIC=OFF \
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
-DARROW_LLVM_VERSIONS=$CLANG_VERSION_SHORT \
-DCLANG_EXECUTABLE="$CLANG_EXECUTABLE"

make ${JOBS:+-j $JOBS}
Expand Down
3 changes: 3 additions & 0 deletions clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ build_requires:
- ninja
env:
LLVM_ROOT: "$CLANG_ROOT" # needed by LLVMAlt
prefer_system: .*
prefer_system_check: |
true
---
#!/bin/bash -e

Expand Down
6 changes: 4 additions & 2 deletions cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ build_requires:
- alibuild-recipe-tools
prefer_system: .*
prefer_system_check: |
verge() { [[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]]; }
type cmake && verge 3.28.1 `cmake --version | sed -e 's/.* //' | cut -d. -f1,2,3`
true

# verge() { [[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]]; }
# type cmake && verge 3.28.1 `cmake --version | sed -e 's/.* //' | cut -d. -f1,2,3`
---
#!/bin/bash -e

Expand Down
2 changes: 1 addition & 1 deletion common-o2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ esac

cmake $SOURCEDIR \
-DCMAKE_INSTALL_PREFIX=$INSTALLROOT \
${BOOST_ROOT:+-DBOOST_ROOT=$BOOST_ROOT} \
${BOOST_ROOT:+-DBOOST_ROOT=$BOOST_ROOT -DBoost_NO_BOOST_CMAKE=ON} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON

cp ${BUILDDIR}/compile_commands.json ${INSTALLROOT}
Expand Down
3 changes: 3 additions & 0 deletions curl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ build_requires:
- "OpenSSL:(?!osx)"
- CMake
- alibuild-recipe-tools
prefer_system: .*
prefer_system_check: |
true
---
#!/bin/bash -e

Expand Down
5 changes: 5 additions & 0 deletions debuggui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ case $ARCHITECTURE in
EXTRA_LIBS="-framework CoreFoundation -framework AppKit"
DEFINES="-DNO_PARALLEL_SORT"
;;
arch*)
DEFINES="-DIMGUI_IMPL_OPENGL_LOADER_GL3W -DTRACY_NO_FILESELECTOR"
EXTRA_LIBS="-lGL -ltbb"
[[ ! $FREETYPE_ROOT ]] && FREETYPE_ROOT="/usr"
;;
*)
DEFINES="-DIMGUI_IMPL_OPENGL_LOADER_GL3W -DTRACY_NO_FILESELECTOR -DNO_PARALLEL_SORT"
EXTRA_LIBS="-lGL"
Expand Down
42 changes: 42 additions & 0 deletions defaults-jw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
env:
CFLAGS: -fPIC -O2 -I/usr/include/tirpc
CMAKE_BUILD_TYPE: RELWITHDEBINFO
CXXFLAGS: -fPIC -O2 -std=c++17 -I/usr/include/tirpc
CXXSTD: '17'
ENABLE_VMC: 'ON'
GEANT4_BUILD_MULTITHREADED: 'ON'
overrides:
AliPhysics:
version: '%(commit_hash)s_O2'
AliRoot:
requires:
- ROOT
- fastjet:(?!.*ppc64)
- GEANT3
- GEANT4_VMC
- Vc
- ZeroMQ
- JAliEn-ROOT
version: '%(commit_hash)s_O2'
cgal:
version: 4.12.2
fastjet:
tag: v3.4.0_1.045-alice1
pythia:
requires:
- lhapdf
- boost
tag: v8304
O2-customization:
env:
ENABLE_UPGRADES: OFF # Disable detector upgrades in O2

Check failure on line 32 in defaults-jw.sh

View workflow job for this annotation

GitHub Actions / alidistlint

overrides.O2-customization.env.ENABLE_UPGRADES: must be of string type [ali:schema]

Check failure on line 32 in defaults-jw.sh

View workflow job for this annotation

GitHub Actions / alidistlint

truthy value should be one of [false, true] [yl:truthy]
BUILD_ANALYSIS: OFF # Disable analysis in O2

Check failure on line 33 in defaults-jw.sh

View workflow job for this annotation

GitHub Actions / alidistlint

overrides.O2-customization.env.BUILD_ANALYSIS: must be of string type [ali:schema]

Check failure on line 33 in defaults-jw.sh

View workflow job for this annotation

GitHub Actions / alidistlint

truthy value should be one of [false, true] [yl:truthy]
BUILD_EXAMPLES: OFF # Disable examples in O2

Check failure on line 34 in defaults-jw.sh

View workflow job for this annotation

GitHub Actions / alidistlint

overrides.O2-customization.env.BUILD_EXAMPLES: must be of string type [ali:schema]

Check failure on line 34 in defaults-jw.sh

View workflow job for this annotation

GitHub Actions / alidistlint

truthy value should be one of [false, true] [yl:truthy]
ALIBUILD_ENABLE_CUDA: ON

Check failure on line 35 in defaults-jw.sh

View workflow job for this annotation

GitHub Actions / alidistlint

overrides.O2-customization.env.ALIBUILD_ENABLE_CUDA: must be of string type [ali:schema]

Check failure on line 35 in defaults-jw.sh

View workflow job for this annotation

GitHub Actions / alidistlint

truthy value should be one of [false, true] [yl:truthy]
package: defaults-jw
version: v1

Check failure on line 38 in defaults-jw.sh

View workflow job for this annotation

GitHub Actions / alidistlint

too many blank lines (1 > 0) [yl:empty-lines]
---
# This file is included in any build recipe and it's only used to set
# environment variables. Which file to actually include can be defined by the
# "--defaults" option of alibuild.
3 changes: 3 additions & 0 deletions double-conversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ source: https://github.com/google/double-conversion
build_requires:
- CMake
- "GCC-Toolchain:(?!osx)"
prefer_system: .*
prefer_system_check: |
true
---

mkdir -p $INSTALLROOT
Expand Down
1 change: 1 addition & 0 deletions flatbuffers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ build_requires:
cmake "$SOURCEDIR" \
-G 'Unix Makefiles' \
-DFLATBUFFERS_BUILD_TESTS=OFF \
-DFLATBUFFERS_BUILD_CPP17=ON \
-DCMAKE_INSTALL_PREFIX="$INSTALLROOT" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS -Wno-unknown-warning -Wno-unknown-warning-option -Wno-error=unused-but-set-variable"
# LLVM 15 requires -Wno-error=unused-but-set-variable to compile
Expand Down
3 changes: 3 additions & 0 deletions googletest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ source: https://github.com/google/googletest
build_requires:
- "GCC-Toolchain:(?!osx)"
- CMake
prefer_system: .*
prefer_system_check: |
true
---
#!/bin/sh
cmake $SOURCEDIR \
Expand Down
3 changes: 3 additions & 0 deletions jalien-root.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ case $ARCHITECTURE in
SONAME=dylib
[[ ! $OPENSSL_ROOT ]] && OPENSSL_ROOT=$(brew --prefix openssl@3)
[[ ! $LIBWEBSOCKETS_ROOT ]] && LIBWEBSOCKETS_ROOT=$(brew --prefix libwebsockets)
;;
arch*)
[[ ! JSON_C_ROOT ]] && JSON_C_ROOT=/usr

Check failure on line 29 in jalien-root.sh

View workflow job for this annotation

GitHub Actions / alidistlint

This expression is constant. Did you forget a $ somewhere? [SC2078]
;;
esac

Expand Down
2 changes: 1 addition & 1 deletion jdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build_requires:
- curl
prefer_system: .*
prefer_system_check: |
[[ $(uname) == Darwin ]] && /usr/libexec/java_home || exit 1; X=$(mktemp -d); cd $X && printf "public class verAliBuild { public static void main(String[] args) { if (Integer.parseInt((System.getProperty(\"java.version\")+\".\").split(\"\\\\\.\")[0]) < 10) System.exit(42); } }" > verAliBuild.java && javac verAliBuild.java && java verAliBuild && rm -rf $X
true
env:
JAVA_HOME: "$JDK_ROOT/$(cd $JDK_ROOT; ls -1d jdk*/Contents/Home)"
prepend_path:
Expand Down
3 changes: 3 additions & 0 deletions json-c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ source: https://github.com/json-c/json-c
build_requires:
- "autotools:(slc6|slc7)"
- "GCC-Toolchain:(?!osx)"
prefer_system: .*
prefer_system_check: |
true
---
#!/bin/bash -e
rsync -a --delete --exclude '**/.git' --delete-excluded $SOURCEDIR/ ./
Expand Down
3 changes: 3 additions & 0 deletions libtirpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ source: https://github.com/alisw/libtirpc
build_requires:
- "autotools:(slc6|slc7)"
- "GCC-Toolchain:(?!osx)"
prefer_system: .*
prefer_system_check: |
true
---
#!/bin/bash -e
rsync -a --delete --exclude '**/.git' --delete-excluded $SOURCEDIR/ ./
Expand Down
1 change: 1 addition & 0 deletions libwebsockets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ cmake $SOURCEDIR \
cmake --build . --target install ${JOBS+-j $JOBS}
rm -rf $INSTALLROOT/share
# Modulefile
mkdir -p etc/modulefiles
alibuild-generate-module --lib --bin > etc/modulefiles/$PKGNAME
Expand Down
2 changes: 1 addition & 1 deletion lz4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build_requires:
- alibuild-recipe-tools
prefer_system: ".*"
prefer_system_check: |
printf "#include <lz4.h>\n" | cc -xc -I$(brew --prefix lz4)/include - -c -M 2>&1
true
---

cmake -DCMAKE_INSTALL_PREFIX=$INSTALLROOT \
Expand Down
2 changes: 2 additions & 0 deletions o2-customization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package: O2-customization
version: "v1.0.0"
env:
ENABLE_UPGRADES: "ON"
BUILD_SIMULATION: "ON"
valid_defaults:
- o2
- o2-dataflow
- o2-epn
- o2-dev-fairroot
- alo
- o2-prod
- jw
---
# No contents. The only goal of this recipe is to provide customizations to
# enable / disable features of the O2 builds. This cannot be done in the O2
Expand Down
12 changes: 12 additions & 0 deletions o2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ valid_defaults:
- o2-dev-fairroot
- alo
- o2-prod
- jw
---
#!/bin/sh
export ROOTSYS=$ROOT_ROOT
Expand All @@ -141,6 +142,7 @@ export ROOTSYS=$ROOT_ROOT
# maximum safety.
unset SIMPATH

SONAME=so
case $ARCHITECTURE in
osx*)
# If we preferred system tools, we need to make sure we can pick them up.
Expand All @@ -152,6 +154,9 @@ case $ARCHITECTURE in
[[ ! $GLFW_ROOT ]] && GLFW_ROOT=`brew --prefix glfw`
[[ ! $FMT_ROOT ]] && FMT_ROOT=`brew --prefix fmt`
;;
arch*)
export PYTHIA_ROOT=/usr
;;
esac

# This affects only PR checkers
Expand All @@ -174,6 +179,10 @@ if [[ ! $CMAKE_GENERATOR && $DISABLE_NINJA != 1 && $DEVEL_SOURCES != $SOURCEDIR
unset NINJA_BIN
fi

unset ALIBUILD_ENABLE_CUDA
export DISABLE_GPU=ON
export BUILD_SIMULATION=ON
export Geant3_DIR=`echo ${GEANT3_ROOT}/lib64/Geant3-*`
unset DYLD_LIBRARY_PATH
cmake $SOURCEDIR -DCMAKE_INSTALL_PREFIX=$INSTALLROOT \
${CMAKE_GENERATOR:+-G "$CMAKE_GENERATOR"} \
Expand Down Expand Up @@ -205,6 +214,9 @@ cmake $SOURCEDIR -DCMAKE_INSTALL_PREFIX=$INSTALLROOT
${CLANG_REVISION:+-DLLVM_LINK_EXECUTABLE="$CLANG_ROOT/bin/llvm-link"} \
${ITSRESPONSE_ROOT:+-DITSRESPONSE=${ITSRESPONSE_ROOT}}
# LLVM_ROOT is required for Gandiva
# ${BOOST_ROOT:+-DBoost_NO_BOOST_CMAKE=ON} \
# ${BUILD_SIMULATION:+-DBUILD_SIMULATION=$BUILD_SIMULATION} \
# -DGeant3_DIR=$Geant3_DIR \

cmake --build . -- ${JOBS+-j $JOBS} install

Expand Down
1 change: 1 addition & 0 deletions o2suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ valid_defaults:
- alo
- o2-prod
- o2-ninja
- jw
---
#!/bin/bash -ex

Expand Down
2 changes: 2 additions & 0 deletions onnxruntime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ cmake "$SOURCEDIR/cmake"
${FLATBUFFERS_ROOT:+-DFLATBUFFERS_INCLUDE_DIR=${FLATBUFFERS_ROOT}/include} \
${BOOST_ROOT:+-DBOOST_INCLUDE_DIR=${BOOST_ROOT}/include}

file=$(find -name extension.h)
sed -i 's|<cstddef>|<cstddef>\n#include <cstdint>|' $file
cmake --build . -- ${JOBS:+-j$JOBS} install

# Modulefile
Expand Down
16 changes: 2 additions & 14 deletions openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,9 @@ package: OpenSSL
version: v1.1.1m
tag: OpenSSL_1_1_1m
source: https://github.com/openssl/openssl
prefer_system: (?!slc5|slc6)
prefer_system: .*
prefer_system_check: |
#!/bin/bash -e
case $(uname) in
Darwin) prefix=$(brew --prefix openssl@3); [ -d "$prefix" ] ;;
*) prefix= ;;
esac
cc -x c - ${prefix:+"-I$prefix/include"} -c -o /dev/null <<\EOF
#include <openssl/bio.h>
#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER < 0x10101000L
#error "System's OpenSSL cannot be used: we need OpenSSL >= 1.1.1 for the Python ssl module. We are going to compile our own version."
#endif
int main() { }
EOF
true
build_requires:
- zlib
- alibuild-recipe-tools
Expand Down
3 changes: 3 additions & 0 deletions pythia.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ requires:
env:
PYTHIA8DATA: "$PYTHIA_ROOT/share/Pythia8/xmldoc"
PYTHIA8: "$PYTHIA_ROOT"
prefer_system: .*
prefer_system_check: |
true
---
#!/bin/bash -e
rsync -a $SOURCEDIR/ ./
Expand Down
Loading

0 comments on commit f40d6a7

Please sign in to comment.