Skip to content

Commit

Permalink
flexible cxx/cxxflags/ldflags for CI integration
Browse files Browse the repository at this point in the history
  • Loading branch information
vineetbansal committed Dec 9, 2024
1 parent d3d1441 commit 0f11f5f
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,26 @@ set -e
OS=$(uname -s)
ARCH=$(uname -m)

if [ "${OS}" = "Linux" ]; then
alias gx1="g++ -O3 -c -fpic -fopenmp "
alias gx2="g++ -O3 -shared -fopenmp "
elif [ "${OS}" = "Darwin" ]; then
if [ "${ARCH}" = "arm64" ]; then
compiler="/opt/homebrew/opt/llvm/bin/clang++"
if [ -n "$CXX" ]; then
compiler="$CXX"
else
if [ "${OS}" = "Linux" ]; then
compiler="g++"
elif [ "${OS}" = "Darwin" ]; then
if [ "${ARCH}" = "arm64" ]; then
compiler="/opt/homebrew/opt/llvm/bin/clang++"
else
compiler="/usr/local/opt/llvm/bin/clang++"
fi
else
compiler="/usr/local/opt/llvm/bin/clang++"
echo "Unsupported OS"
exit -1
fi
alias gx1="${compiler} -O3 -c -fpic -fopenmp "
alias gx2="${compiler} -O3 -shared -fopenmp "
else
echo "Unsupported OS"
exit -1
fi

alias gx1="${compiler} \$CXXFLAGS -O3 -c -fpic -fopenmp "
alias gx2="${compiler} \$LDFLAGS -O3 -shared -fopenmp "

mkdir -p ocmesher/lib
gx1 -o ocmesher/lib/core.o ocmesher/source/core.cpp
gx2 -o ocmesher/lib/core.so ocmesher/lib/core.o

0 comments on commit 0f11f5f

Please sign in to comment.