Skip to content

Commit

Permalink
Merge branch 'feature/sw'
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianDeconinck committed Jan 30, 2024
2 parents 73f6128 + c6add27 commit 9e54549
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
1 change: 1 addition & 0 deletions sw_stack/discover/sles15/src/1.0.0/basics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export DSLSW_LAPACK_VER=3.11.0
export DSLSW_PY_VER=3.8.10
export DSLSW_BASELIBS_VER=7.14.1
export DSLSW_SERIALBOX_VER=2.6.1
export DSLSW_GNU_VER=12.2.0

# Base directory & versioning
export DSLSW_BASE=$PWD/build
Expand Down
54 changes: 53 additions & 1 deletion sw_stack/discover/sles15/src/1.0.0/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,56 @@ make ESMF_COMM=openmpi \
BUILD=ESSENTIALS \
ALLOW_ARGUMENT_MISMATCH=-fallow-argument-mismatch \
--prefix=$DSLSW_INSTALL_DIR/baselibs-$DSLSW_BASELIBS_VER/install/x86_64-pc-linux-gnu/Linux \
install
install

echo " === GNU gcc/gfortran/g++ with OpenACC and OpenMP Offload on NVIDIA GPUs === "
module rm comp/gcc/12.3.0
module rm nvidia/nvhpc-nompi/23.9
unset CC
unset CXX
unset FC

# Build assembler and linking tools
cd $DSLSW_BASE/gnu/nvptx-tools
./configure \
--with-cuda-driver-include=$CUDA_DIR/include \
--with-cuda-driver-lib=$CUDA_DIR/lib64 \
--prefix=$DSLSW_INSTALL_DIR/gnu
make || exit 1
make install || exit 1
cd ..

# Set up the GCC source tree
cd $DSLSW_BASE/gnu/gcc
ln -s ../nvptx-newlib/newlib newlib
cd ..
export target=$(gcc/config.guess)

# Build nvptx GCC
mkdir build-nvptx-gcc
cd build-nvptx-gcc
../gcc/configure \
--target=nvptx-none --with-build-time-tools=$DSLSW_INSTALL_DIR/gnu/nvptx-none/bin \
--enable-as-accelerator-for=$target \
--disable-sjlj-exceptions \
--enable-newlib-io-long-long \
--enable-languages="c,c++,fortran,lto" \
--prefix=$DSLSW_INSTALL_DIR/gnu
make -j`nproc` || exit 1
make install || exit 1
cd ..

# Build host GCC
mkdir build-host-gcc
cd build-host-gcc
../gcc/configure \
--enable-offload-targets=nvptx-none \
--with-cuda-driver-include=$CUDA_DIR/include \
--with-cuda-driver-lib=$CUDA_DIR/lib64 \
--disable-bootstrap \
--disable-multilib \
--enable-languages="c,c++,fortran,lto" \
--prefix=$DSLSW_INSTALL_DIR/gnu
make -j`nproc` || exit 1
make install || exit 1
cd ..
10 changes: 10 additions & 0 deletions sw_stack/discover/sles15/src/1.0.0/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,13 @@ echo "=>Baselibs >> Removing HDF4 from the ESSENTIALS"
sed -i 's/ESSENTIAL_DIRS = jpeg zlib szlib hdf4 hdf5/ESSENTIAL_DIRS = jpeg zlib szlib hdf5/g' GNUmakefile
sed -i 's/\/zlib \/szlib \/jpeg \/hdf5 \/hdf \/netcdf,\\/\/ \/zlib \/szlib \/jpeg \/hdf5 \/netcdf,\\/g' GNUmakefile
cd $DSLSW_BASE

mkdir gnu
cd gnu
git clone https://github.com/SourceryTools/nvptx-tools
git clone git://sourceware.org/git/newlib-cygwin.git nvptx-newlib
git clone --branch releases/gcc-${DSLSW_GNU_VER} git://gcc.gnu.org/git/gcc.git gcc
cd gcc
contrib/download_prerequisites

cd $DSLSW_BASE

0 comments on commit 9e54549

Please sign in to comment.