Skip to content

Commit

Permalink
Triangle built
Browse files Browse the repository at this point in the history
  • Loading branch information
krystophny committed Dec 17, 2024
1 parent 52b5bb2 commit fd35760
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions cmake/setup_triangle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,23 @@ CC=${CC:-gcc}
if [ "$(uname)" == "Darwin" ]; then
CFLAGS="-I/opt/homebrew/include"
LDFLAGS="-L/opt/homebrew/lib"
else
CFLAGS=""
LDFLAGS=""
fi


echo "Fetching and building Triangle..."
git clone https://salsa.debian.org/science-team/triangle.git
pushd triangle
while read -r patch; do
patch -p1 < "debian/patches/$patch"
done < debian/patches/series
cd triangle
while read -r patch; do
patch -p1 < "debian/patches/$patch"
done < debian/patches/series

$CC triangle.c -o triangle.o $CFLAGS -O2 -DTRILIBRARY -fPIC -DPIC -c
$CC -shared triangle.o -o libtriangle-1.6.so $LDFLAGS -lm
ln -s libtriangle-1.6.so libtriangle.so
echo "Building Triangle..."

popd
$CC triangle.c -o triangle.o $CFLAGS -O2 -DTRILIBRARY -fPIC -DPIC -c
$CC -shared triangle.o -o libtriangle-1.6.so $LDFLAGS -lm
ln -s libtriangle-1.6.so libtriangle.so

echo "Triangle built successfully."
2 changes: 1 addition & 1 deletion setup_debian.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

sudo apt-get update -y && sudo apt-get install -y -q --no-install-recommends \
cmake make ninja-build git gfortran gcc libgsl-dev \
cmake make ninja-build git gfortran gcc patch libgsl-dev \
libopenblas-dev libsuitesparse-dev libmetis-dev libhdf5-dev \
libnetcdf-dev libnetcdff-dev libboost-dev libfftw3-dev \
openmpi-bin libopenmpi-dev python3 python3-dev python3-pip python3-numpy

0 comments on commit fd35760

Please sign in to comment.