Skip to content

Commit

Permalink
BUILD: ubuntu build shell script
Browse files Browse the repository at this point in the history
  • Loading branch information
tmasthay committed May 30, 2024
1 parent cd64fc2 commit 63ddfa2
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions api/julia/ubuntu_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# Check if we are on ubuntu
lsb_release -a | grep "Ubuntu" || exit 1
UBUNTU_VERSION=$(lsb_release -r | awk '{print $2}')

# Get the git hash
GIT_HASH=$(git rev-parse HEAD)

cd ../..

PREFIX=$(pwd)/__PRECOMPILED_BUILD_UBUNTU_${UBUNTU_VERSION}__${GIT_HASH}__
INCLUDE_PATH=$PREFIX/include
LIB_PATH=$PREFIX/lib
./configure \
--prefix=$PREFIX \
CC=$(which gcc) \
CXX=$(which g++) \
CAIROPATH=$INCLUDE_PATH/cairo \
FFMPEGPATH=$INCLUDE_PATH/ffmpeg \
AR=$(which ar) \
CPPPATH=$INCLUDE_PATH \
LIBPATH=$LIB_PATH \
BLAS=openblas

# Build
NUM_CPUS=$(lscpu | grep "^CPU(s):" | grep -v "NUMA" | awk '{print $2}')
make -j$NUM_CPUS

# Install
make install

0 comments on commit 63ddfa2

Please sign in to comment.