-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
690e591
commit 26921d7
Showing
1 changed file
with
19 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,25 @@ | ||
#!/bin/bash -ex | ||
|
||
mkdir -p build && pushd build | ||
|
||
export INCLUDES="-I${PREFIX}/include" | ||
export LIBPATH="-L${PREFIX}/lib" | ||
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib" | ||
export CXXFLAGS="${CXXFLAGS} -O3 -I${PREFIX}/include" | ||
#!/bin/bash | ||
|
||
ARCH_BUILD="" | ||
case $(uname -m) in | ||
aarch64) | ||
ARCH_OPTS="-DHAVE_ARM8=1" | ||
;; | ||
*) | ||
ARCH_OPTS="-DHAVE_SSE4_1=1" | ||
;; | ||
x86_64) ARCH_BUILD="-DHAVE_AVX2=1" ;; | ||
arm64|aarch64) ARCH_BUILD="-DHAVE_ARM8=1" ;; | ||
esac | ||
|
||
if [ "$(uname)" == "Darwin" ]; then | ||
export CMAKE_EXTRA="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_FIND_APPBUNDLE=NEVER -Wno-dev" | ||
else | ||
export CMAKE_EXTRA="-Wno-dev" | ||
fi | ||
CUDA=0 | ||
case $(uname -s) in | ||
Linux) CUDA=1 ;; | ||
Darwin) CUDA=0 ;; | ||
esac | ||
|
||
cmake -S .. -B . -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ | ||
-DCMAKE_BUILD_TYPE=RELEASE \ | ||
-DHAVE_TESTS=0 -DHAVE_MPI=0 "${ARCH_OPTS}" \ | ||
-DVERSION_OVERRIDE="${PKG_VERSION}" \ | ||
"${CMAKE_EXTRA}" | ||
if [ -z "${ARCH_BUILD}" ]; then | ||
echo "Invalid architecture" | ||
exit 1 | ||
fi | ||
|
||
cmake --build . --target install -j ${CPU_COUNT} -v | ||
popd | ||
mkdir build | ||
cd build | ||
cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DHAVE_TESTS=0 -DHAVE_MPI=0 ${ARCH_BUILD} -DVERSION_OVERRIDE="${PKG_VERSION}" \ | ||
-DCMAKE_CUDA_ARCHITECTURES="75-real;80-real;86-real;89-real;90" -DENABLE_CUDA=${CUDA} .. | ||
make -j${CPU_COUNT} ${VERBOSE_CM} | ||
make install |