Skip to content

Commit

Permalink
try with bootstrap, add suitesparse
Browse files Browse the repository at this point in the history
  • Loading branch information
lkeegan committed Jan 19, 2024
1 parent d25a499 commit 6e0e682
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ env:
FUNCTION2_VERSION: "4.2.4"
VTK_VERSION: "v9.3.0"
SCOTCH_VERSION: "v7.0.4"
SUITESPARSE_VERSION: "v7.5.1"

jobs:
linux:
Expand Down Expand Up @@ -61,10 +62,11 @@ jobs:
sudo apt update -yy
sudo apt install -yy clang-17 libglu1-mesa-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxkbcommon-dev libxkbcommon-x11-dev '^libxcb.*-dev'
sudo apt install -yy libmpfr-dev libmpc-dev
- name: Disable system blas/lapack
- name: Disable system blas/lapack & remove gfortran
run: |
sudo rm /usr/lib/x86_64-linux-gnu/libblas*
sudo rm /usr/lib/x86_64-linux-gnu/liblapack*
sudo apt remove -yy gfortran
- name: Set clang version
run: |
sudo update-alternatives --remove-all clang || echo "nothing to remove"
Expand Down
46 changes: 40 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ echo "COMBINE_VERSION: ${COMBINE_VERSION}"
echo "FUNCTION2_VERSION: ${FUNCTION2_VERSION}"
echo "VTK_VERSION: ${VTK_VERSION}"
echo "SCOTCH_VERSION: ${SCOTCH_VERSION}"
echo "SUITESPARSE_VERSION: ${SUITESPARSE_VERSION}"

NPROCS=4
if [[ "$OS_TARGET" == "osx" ]]; then
Expand Down Expand Up @@ -75,28 +76,61 @@ if [[ "$OS_TARGET" != "osx" ]]; then
mkdir build
cd build
CPP=cpp CC=gcc CXX=g++ ../configure \
--prefix="$INSTALL_PREFIX" \
--prefix="$GFORTRAN_INSTALL_PREFIX" \
--disable-shared \
--with-pic \
--disable-gcov \
--disable-multilib \
--disable-bootstrap \
--enable-languages=fortran
time make -j$NPROCS

# --disable-bootstrap \

time make -j$NPROCS
$SUDOCMD make install
cd ../..

"${INSTALL_PREFIX}/bin/gfortran" --version
export FC="$GFORTRAN_INSTALL_PREFIX"
$FC --version

# build OpenBLAS using our gfortan compiler for lapack
git clone -b v0.3.26 --depth 1 https://github.com/OpenMathLib/OpenBLAS.git
cd OpenBLAS
make FC="${INSTALL_PREFIX}/bin/gfortran" TARGET=CORE2 NUM_THREADS=64 USE_OPENMP=0 NO_SHARED=1 -j$NPROCS
sudo make FC="${INSTALL_PREFIX}/bin/gfortran" TARGET=CORE2 NUM_THREADS=64 USE_OPENMP=0 NO_SHARED=1 PREFIX="${INSTALL_PREFIX}" install
make FC=$FC TARGET=CORE2 NUM_THREADS=64 USE_OPENMP=0 NO_SHARED=1 -j$NPROCS
sudo make FC=$FC TARGET=CORE2 NUM_THREADS=64 USE_OPENMP=0 NO_SHARED=1 PREFIX="${INSTALL_PREFIX}" install
cd ..

fi

# build minimal static version of SuiteSparse
git clone -b $SUITESPARSE_VERSION --depth 1 https://github.com/DrTimothyAldenDavis/SuiteSparse.git
cd SuiteSparse
mkdir build
cd build
cmake -G "Unix Makefiles" .. \
-DCMAKE_OSX_DEPLOYMENT_TARGET="${MACOSX_DEPLOYMENT_TARGET}" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_C_FLAGS="-fpic -fvisibility=hidden" \
-DCMAKE_CXX_FLAGS="-fpic -fvisibility=hidden" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" \
-DCMAKE_PREFIX_PATH="$INSTALL_PREFIX" \
-DSUITESPARSE_USE_STRICT=ON \
-DSUITESPARSE_USE_CUDA=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DSUITESPARSE_USE_OPENMP=OFF \
-DSUITESPARSE_ENABLE_PROJECTS="suitesparse_config;cholmod;ldl;spqr;umfpack"

# alternatively, could remove gfortran from system and hard-code required static libs we just built:
# -DSUITESPARSE_USE_FORTRAN=OFF \
# -DBLAS_LIBRARIES="/opt/smelibs_common/lib/libopenblas.a;/usr/lib/gcc/x86_64-linux-gnu/11/libgfortran.a;/usr/lib/gcc/x86_64-linux-gnu/11/libquadmath.a" \
# -DLAPACK_LIBRARIES="/opt/smelibs_common/lib/libopenblas.a;/usr/lib/gcc/x86_64-linux-gnu/11/libgfortran.a;/usr/lib/gcc/x86_64-linux-gnu/11/libquadmath.a" \

time make -j$NPROCS
make test
$SUDOCMD make install
cd ../../


exit

echo "downloading qt & llvm for OS_TARGET: $OS_TARGET"
Expand Down

0 comments on commit 6e0e682

Please sign in to comment.