diff --git a/build.sh b/build.sh index 7b4d57e..f6e67e7 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -export ROOT=$(pwd) +export ROOT="$(pwd)" echo "Building in $ROOT" Help() @@ -150,7 +150,8 @@ if [[ "$OS" == "Linux" ]]; then BOOST_INCLUDEDIR=/usr/include/boost BOOST_LIBRARYDIR=/usr/lib/x86_64-linux-gnu CMAKE_CONFIG_DIR=/usr/lib/x86_64-linux-gnu/cmake - export BOOST_INCLUDEDIR BOOST_LIBRARYDIR CMAKE_CONFIG_DIR + MAKE="make" + export BOOST_INCLUDEDIR BOOST_LIBRARYDIR CMAKE_CONFIG_DIR MAKE else echo "Unknown Linux distro - please figure out the packages to install and submit an issue!" exit 1 @@ -176,7 +177,8 @@ elif [[ "$OS" == "Darwin" ]]; then CPPFLAGS="-I/$HOMEBREW_PREFIX/opt/libomp/include -I$HOMEBREW_PREFIX/include/suitesparse -I$HOMEBREW_PREFIX/include $CPPFLAGS -I$HOMEBREW_PREFIX//opt/openblas/include" LEX=$HOMEBREW_PREFIX/opt/flex/bin/flex BISON=$HOMEBREW_PREFIX/opt/bison/bin/bison - export PKG_CONFIG_PATH PATH LDFLAGS CPPFLAGS LEX BISON + MAKE="make" + export PKG_CONFIG_PATH PATH LDFLAGS CPPFLAGS LEX BISON MAKE SUITESPARSE_INC=$HOMEBREW_PREFIX/include/suitesparse LIBRARY_PATH=$HOMEBREW_PREFIX/lib @@ -190,9 +192,12 @@ elif [[ "$OS" == "Windows_MSYS2" || "$OS" == "Cygwin" ]]; then # check we have pacman pacman --version + powershell -File ./scripts/set-path-length.ps1 + ./scripts/windows-install.sh - TRILINOS_CONFIGURE_OPTS="-DBLAS_LIBRARY_NAMES=openblas_64 -DBLAS_INCLUDE_DIRS=/ucrt64/include/openblas64 -DLAPACK_LIBRARY_NAMES=lapack64" + CONFIGURE_OPTS="-DBLAS_LIBRARY_NAMES=openblas_64 -DBLAS_INCLUDE_DIRS=/ucrt64/include/openblas64 -DLAPACK_LIBRARY_NAMES=lapack64 -DCMAKE_OBJECT_PATH_MAX=10000" + TRILINOS_CONFIGURE_OPTS="-DBLAS_LIBRARY_NAMES=openblas_64 -DBLAS_INCLUDE_DIRS=/ucrt64/include/openblas64 -DLAPACK_LIBRARY_NAMES=lapack64 -DCMAKE_OBJECT_PATH_MAX=10000" SUITESPARSE_INC=/ucrt64/include/suitesparse LIBRARY_PATH=/ucrt64/lib/x86_64-linux-gnu INCLUDE_PATH=/ucrt64/include @@ -200,7 +205,8 @@ elif [[ "$OS" == "Windows_MSYS2" || "$OS" == "Cygwin" ]]; then BOOST_INCLUDEDIR=/ucrt64/include/boost BOOST_LIBRARYDIR=/ucrt64/lib/ PYTHON=/ucrt64/usr/bin/python3 - export SUITESPARSE_INC LIBRARY_PATH INCLUDE_PATH BOOST_ROOT BOOST_INCLUDEDIR BOOST_LIBRARYDIR + MAKE=/ucrt64/bin/mingw32-make + export SUITESPARSE_INC LIBRARY_PATH INCLUDE_PATH BOOST_ROOT BOOST_INCLUDEDIR BOOST_LIBRARYDIR MAKE NCPUS=$NUMBER_OF_PROCESSORS CFLAGS="$CFLAGS -fpermissive" diff --git a/scripts/build-trilinos.sh b/scripts/build-trilinos.sh index dfa3ebe..b133903 100755 --- a/scripts/build-trilinos.sh +++ b/scripts/build-trilinos.sh @@ -51,11 +51,13 @@ cmake \ -DAMD_LIBRARY_DIRS="$LIBRARY_PATH" \ -DTrilinos_SET_GROUP_AND_PERMISSIONS_ON_INSTALL_BASE_DIR="$ARCHDIR" \ $CONFIGURE_OPTS \ +-G "Unix Makefiles" \ +-DCMAKE_MAKE_PROGRAM=${MAKE} \ -S "$ROOT/_source/trilinos" \ -B "$ROOT/$BUILDDIR/trilinos" 2>&1 | tee "$ROOT/$BUILDDIR/configure-trilinos.log" echo "Building Trilinos..." NCPUS="${NCPUS:-$(nproc)}" -make -C $BUILDDIR/trilinos -j $NCPUS 2>&1 | tee "$ROOT/$BUILDDIR/build-trilinos.log" -make -C $BUILDDIR/trilinos install +${MAKE} -C $BUILDDIR/trilinos -j $NCPUS 2>&1 | tee "$ROOT/$BUILDDIR/build-trilinos.log" +${MAKE} -C $BUILDDIR/trilinos install diff --git a/scripts/build-xdm.sh b/scripts/build-xdm.sh index 82c427e..cf7c01c 100755 --- a/scripts/build-xdm.sh +++ b/scripts/build-xdm.sh @@ -27,5 +27,5 @@ $CONFIGURE_OPTS \ echo "Building XDM..." NCPUS="${NCPUS:-$(nproc)}" -make -C $BUILDDIR/XDM -j $NCPUS 2>&1 | tee "$ROOT/$BUILDDIR/build-XDM.log" +${MAKE} -C $BUILDDIR/XDM -j $NCPUS 2>&1 | tee "$ROOT/$BUILDDIR/build-XDM.log" diff --git a/scripts/build-xyce.sh b/scripts/build-xyce.sh index 28a8dae..fa8dbb9 100755 --- a/scripts/build-xyce.sh +++ b/scripts/build-xyce.sh @@ -36,6 +36,6 @@ popd echo "Building Xyce..." NCPUS="${NCPUS:-$(nproc)}" -echo "make -C $BUILDDIR/Xyce -j $NCPUS V=1 2>&1 | tee \"$ROOT/$BUILDDIR/Xyce-build.log\"" -make -C $BUILDDIR/Xyce -j $NCPUS V=1 2>&1 | tee "$ROOT/$BUILDDIR/Xyce-build.log" +echo "${MAKE} -C $BUILDDIR/Xyce -j $NCPUS V=1 2>&1 | tee \"$ROOT/$BUILDDIR/Xyce-build.log\"" +${MAKE} -C $BUILDDIR/Xyce -j $NCPUS V=1 2>&1 | tee "$ROOT/$BUILDDIR/Xyce-build.log" diff --git a/scripts/fetch-source.sh b/scripts/fetch-source.sh index 0e9a00a..12b535b 100755 --- a/scripts/fetch-source.sh +++ b/scripts/fetch-source.sh @@ -12,30 +12,30 @@ CloneOrUpdate() repo=$3 echo - if [ ! -d $repo ]; then - echo "Cloning $url branch $branch into $repo" - git clone --depth=1 $url -b $branch $repo + if [ ! -d "$repo" ]; then + echo "Cloning $url branch $branch into "$repo"" + git clone --depth=1 $url -b $branch "$repo" else - echo "Updating $url branch $branch into $repo" - git -C $repo remote set-url origin $url - git -C $repo fetch --depth=1 - git -C $repo checkout $branch - if [ -n "$RESET_GIT" ]; then git -C $repo reset --hard origin/$branch; fi - git -C $repo clean -xdf - git -C $repo prune --expire now - git -C $repo repack -a -d + echo "Updating $url branch $branch into "$repo"" + git -C "$repo" remote set-url origin $url + git -C "$repo" fetch --depth=1 + git -C "$repo" checkout $branch + if [ -n "$RESET_GIT" ]; then git -C "$repo" reset --hard origin/$branch; fi + git -C "$repo" clean -xdf + git -C "$repo" prune --expire now + git -C "$repo" repack -a -d fi echo } mkdir -p _source -CloneOrUpdate https://github.com/Xyce/Xyce master $ROOT/_source/Xyce +CloneOrUpdate https://github.com/Xyce/Xyce master "$ROOT/_source/Xyce" # https://github.com/Xyce/Xyce_Regression/issues/4 -CloneOrUpdate https://github.com/robtaylor/Xyce_Regression cmake-370-windows $ROOT/_source/Xyce_Regression +CloneOrUpdate https://github.com/robtaylor/Xyce_Regression cmake-370-windows "$ROOT/_source/Xyce_Regression" # See https://github.com/Xyce/XDM/issues/11 -CloneOrUpdate https://github.com/robtaylor/XDM fixsstream $ROOT/_source/XDM +CloneOrUpdate https://github.com/robtaylor/XDM fixsstream "$ROOT/_source/XDM" # Backport KokkosKernels: patch #2296 to 14.4.0 -CloneOrUpdate https://github.com/robtaylor/Trilinos win-fix $ROOT/_source/trilinos +CloneOrUpdate https://github.com/robtaylor/Trilinos win-fix "$ROOT/_source/trilinos" diff --git a/scripts/install-xdm.sh b/scripts/install-xdm.sh index bed371b..4792156 100755 --- a/scripts/install-xdm.sh +++ b/scripts/install-xdm.sh @@ -3,7 +3,7 @@ set -e set -o pipefail echo "Installing XDMe..." -make -C $BUILDDIR/XDM install 2>&1 | tee $BUILDDIR/install-XDM.log +${MAKE} -C $BUILDDIR/XDM install 2>&1 | tee $BUILDDIR/install-XDM.log echo "Build completed successfully!" echo "Xyce installed to: $INSTALL_PATH" diff --git a/scripts/install-xyce.sh b/scripts/install-xyce.sh index 8d443a9..5d4fc88 100755 --- a/scripts/install-xyce.sh +++ b/scripts/install-xyce.sh @@ -3,7 +3,7 @@ set -e set -o pipefail echo "Installing Xyce..." -make -C $BUILDDIR/Xyce install 2>&1 | tee $BUILDDIR/install-Xyce.log +${MAKE} -C $BUILDDIR/Xyce install 2>&1 | tee $BUILDDIR/install-Xyce.log echo "Build completed successfully!" echo "Xyce installed to: $INSTALL_PATH" diff --git a/scripts/set-path-length.ps1 b/scripts/set-path-length.ps1 new file mode 100644 index 0000000..a720ce7 --- /dev/null +++ b/scripts/set-path-length.ps1 @@ -0,0 +1 @@ +New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force diff --git a/scripts/windows-install.sh b/scripts/windows-install.sh index dfaf8dc..f7466f6 100755 --- a/scripts/windows-install.sh +++ b/scripts/windows-install.sh @@ -1,20 +1,24 @@ #!/bin/bash -d# Install dependencies using apt +# Install dependencies using apt echo "Installing dependencies..." pacman -S --needed \ + pactoys \ bison \ - flex \ - mingw-w64-ucrt-x86_64-cmake \ - mingw-w64-ucrt-x86_64-make \ - mingw-w64-ucrt-x86_64-msmpi \ - mingw-w64-ucrt-x86_64-openblas64 \ - mingw-w64-ucrt-x86_64-lapack64 \ - mingw-w64-ucrt-x86_64-fftw \ - mingw-w64-ucrt-x86_64-suitesparse \ - mingw-w64-ucrt-x86_64-msmpi \ - mingw-w64-ucrt-x86_64-pkgconf \ - mingw-w64-ucrt-x86_64-boost \ - mingw-w64-ucrt-x86_64-boost-libs + flex + +pacboy -S --needed \ + msmpi \ + cmake \ + make \ + openblas64 \ + lapack64 \ + fftw \ + suitesparse \ + pkgconf \ + boost \ + boost-libs \ + automake \ + autoconf curl -L -O https://github.com/microsoft/Microsoft-MPI/releases/download/v10.1.1/msmpisetup.exe ./msmpisetup.exe -unattend -force diff --git a/scripts/xyce-regression.sh b/scripts/xyce-regression.sh index 93d0e31..d5d24c6 100755 --- a/scripts/xyce-regression.sh +++ b/scripts/xyce-regression.sh @@ -8,7 +8,7 @@ BUILD_DIR="$ROOT/$BUILDDIR" mkdir -p $BUILD_DIR XYCE_BINARY="$BUILD_DIR/Xyce/src/Xyce" -XYCE_REGRESSION=$ROOT/_source/Xyce_Regression +XYCE_REGRESSION="$ROOT/_source/Xyce_Regression" NCPUS="${NCPUS:-$(nproc)}" @@ -17,8 +17,8 @@ eval `$XYCE_REGRESSION/TestScripts/suggestXyceTagList.sh "$XYCE_BINARY"` $XYCE_REGRESSION/TestScripts/run_xyce_regressionMP \ --verbose \ --numproc=$NCPUS \ ---xyce_test=$XYCE_REGRESSION \ +--xyce_test="$XYCE_REGRESSION" \ --taglist="${TAGLIST}" \ ---output=$BUILD_DIR/Xyce_Regression \ ---resultfile=$BUILD_DIR/regression.results \ +--output="$BUILD_DIR/Xyce_Regression" \ +--resultfile="$BUILD_DIR/regression.results" \ "${EXECSTRING}"