diff --git a/bin/build_supp.sh b/bin/build_supp.sh index 1fff78669..664e33623 100755 --- a/bin/build_supp.sh +++ b/bin/build_supp.sh @@ -579,12 +579,30 @@ function getrocmpackage(){ function buildhdf5(){ _cname="hdf5" - _version=1.14.0 - _release=hdf5-1.14 + _version=2.2.0 + _release=hdf5-2.2.0 _installdir=$AOMP_SUPP_INSTALL/hdf5-$_version _linkfrom=$AOMP_SUPP/hdf5 _builddir=$AOMP_SUPP_BUILD/hdf5 SKIPBUILD="FALSE" + BUILD_TYPE=${BUILD_TYPE:-Release} + declare -a MYCMAKEOPTS + MYCMAKEOPTS=(-DCMAKE_BUILD_TYPE="$BUILD_TYPE" + -DCMAKE_INSTALL_PREFIX="$_installdir" + -DCMAKE_CXX_COMPILER="$AOMP/bin/clang++" + -DCMAKE_C_COMPILER="$AOMP/bin/clang" + -DCMAKE_Fortran_COMPILER="$AOMP/bin/flang" + -DHDF5_BUILD_FORTRAN=ON + -DHDF5_BUILD_HL_LIB=ON + -DHDF5_BUILD_TOOLS=ON + -DBUILD_SHARED_LIBS=ON + -DBUILD_STATIC_LIBS=ON + -DHDF5_ENABLE_ZLIB_SUPPORT=ON + -DHDF5_ENABLE_SZIP_SUPPORT=OFF + -DHDF5_ENABLE_THREADSAFE=OFF + -DBUILD_TESTING=OFF + -DHDF5_INSTALL_MOD_FORTRAN=STATIC) + checkversion if [ "$SKIPBUILD" == "TRUE" ] ; then return @@ -595,15 +613,27 @@ function buildhdf5(){ fi runcmd "mkdir -p $_builddir" runcmd "cd $_builddir" - runcmd " wget https://support.hdfgroup.org/ftp/HDF5/releases/$_release/hdf5-$_version/src/hdf5-$_version.tar.bz2" - runcmd "bzip2 -d hdf5-$_version.tar.bz2" - runcmd "tar -xf hdf5-$_version.tar" + #runcmd " wget https://support.hdfgroup.org/ftp/HDF5/releases/$_release/hdf5-$_version/src/hdf5-$_version.tar.bz2" + runcmd " wget https://github.com/HDFGroup/hdf5/releases/download/$_version/hdf5-$_version.tar.gz" + runcmd "tar -xzf hdf5-$_version.tar.gz" runcmd "cd hdf5-$_version" if [ -d "$_installdir" ] ; then runcmd "rm -rf $_installdir" fi runcmd "mkdir -p $_installdir" - runcmd "./configure --enable-fortran --prefix=$_installdir" + runcmd "mkdir -p build" + runcmd "cd build" + #runcmd "./configure --enable-fortran --prefix=$_installdir" + echo + echo " -----Running cmake ---- " + echo "${AOMP_CMAKE}" "$(shquot "${MYCMAKEOPTS[@]}")" \ + "$AOMP_REPOS/$AOMP_FLANG_REPO_NAME" + + if ! ${AOMP_CMAKE} "${MYCMAKEOPTS[@]}" ../; then + echo "ERROR cmake failed. Cmake flags" + echo " $(shquot "${MYCMAKEOPTS[@]}")" + exit 1 + fi runcmd "make -j${AOMP_JOB_THREADS}" runcmd "make install" if [ -L "$_linkfrom" ] ; then diff --git a/bin/run_genasis.sh b/bin/run_genasis.sh index 6d98d28af..a097b7564 100755 --- a/bin/run_genasis.sh +++ b/bin/run_genasis.sh @@ -4,18 +4,19 @@ # # --- Start standard header to set AOMP environment variables ---- -realpath=`realpath $0` -thisdir=`dirname $realpath` +realpath=$(realpath "$0") +thisdir=$(dirname "$realpath") export AOMP_USE_CCACHE=0 -. $thisdir/aomp_common_vars +# shellcheck disable=SC1091 +. "$thisdir"/aomp_common_vars # --- end standard header ---- # Setup AOMP variables AOMP=${AOMP:-$HOME/rocm/aomp/llvm} -AOMPHIP=${AOMPHIP:-$(realpath -m $(realpath -m $AOMP)/../..)} +AOMPHIP=${AOMPHIP:-$(realpath -m "$(realpath -m "$AOMP")/../..")} # for ROCm utilities (e.g. rocm_agent_enumerator) -ROCM=${ROCM:-$(realpath -m $(realpath -m $AOMP)/../..)} +ROCM=${ROCM:-$(realpath -m "$(realpath -m "$AOMP")/../..")} FLANG=${FLANG:-flang} echo "AOMP = $AOMP" @@ -31,16 +32,16 @@ SRC_DIR=${SRC_DIR:-GenASis} # old source REPO_DIR=$AOMP_REPOS_TEST/$SRC_DIR if [ -d "$REPO_DIR" ] ; then - echo $REPO_DIR " exists." + echo "$REPO_DIR exists." else echo "$REPO_DIR does not exist. Please run ./clone_test.sh and re-run this script." exit fi # Copy Makefile_ROCm to GenASis repository -cp Makefile_ROCm $REPO_DIR/Build/Machines/ +cp Makefile_ROCm "$REPO_DIR"/Build/Machines/ -cd $REPO_DIR +cd "$REPO_DIR" || exit 1 AOMP_SUPP=${AOMP_SUPP:-$HOME/local} export OPENMPI_DIR="$AOMP_SUPP/openmpi" @@ -49,13 +50,14 @@ export HDF5_DIR="$AOMP_SUPP/hdf5" export GENASIS_MACHINE=ROCm if [ -d "$AOMP" ] ; then - echo $AOMP " exists." + echo "$AOMP exists." else echo "Install latest AOMP and try again!" exit fi -export GPU_ID=$($ROCM/bin/rocm_agent_enumerator | grep -m 1 -E gfx[^0]{1}.{2}) +GPU_ID=$("$ROCM"/bin/rocm_agent_enumerator | grep -m 1 -E 'gfx[^0]{1}.{2}') +export GPU_ID currdir=$(pwd) if [ -d "$SILO_DIR" ] ; then echo "SILO 4.11.1 exists." @@ -64,11 +66,11 @@ else exit fi if [ -d "$HDF5_DIR" ] ; then - echo "HDF5-1.14.0 exists." + echo "HDF5-2.2.0 exists." export INCLUDE_HDF5="-I$HDF5_DIR/include" export LIBRARY_HDF5="-L$HDF5_DIR/lib -lhdf5_fortran -lhdf5" else - echo "HDF5-1.14.0 does not exist. Please run ./build_supp.sh hdf5 in $thisdir" + echo "HDF5-2.2.0 does not exist. Please run ./build_supp.sh hdf5 in $thisdir" exit fi if [ -d "$OPENMPI_DIR" ] ; then @@ -87,9 +89,9 @@ export FORTRAN_LINK="$AOMP/bin/clang $OTHER_LIBS" export DEVICE_COMPILE="$AOMPHIP/bin/hipcc -D__HIP_PLATFORM_HCC__" export HIP_DIR=$ROCM export HIP_CLANG_PATH=$AOMP/bin -cd $currdir +cd "$currdir" || exit 1 if [ "$1" != "runonly" ] ; then - cd $REPO_DIR/Programs/UnitTests/Basics/Runtime/Executables + cd "$REPO_DIR"/Programs/UnitTests/Basics/Runtime/Executables || exit 1 echo "================= STARTING 1st MAKE in $PWD ========" make clean make PURPOSE=OPTIMIZE all @@ -99,7 +101,7 @@ if [ "$1" != "runonly" ] ; then exit fi echo - cd $REPO_DIR/Programs/Examples/Basics/FluidDynamics/Executables + cd "$REPO_DIR"/Programs/Examples/Basics/FluidDynamics/Executables || exit 1 echo "================= STARTING 2nd MAKE in $PWD ========" make clean make PURPOSE=OPTIMIZE all @@ -109,7 +111,7 @@ if [ "$1" != "runonly" ] ; then exit fi echo - cd $REPO_DIR/Programs/UnitTests/Basics/Devices/Executables + cd "$REPO_DIR"/Programs/UnitTests/Basics/Devices/Executables || exit 1 echo "================= STARTING 3rd MAKE in $PWD ========" make clean make PURPOSE=OPTIMIZE all @@ -125,29 +127,32 @@ if [ "$1" != "buildonly" ] ; then export LIBOMPTARGET_KERNEL_TRACE=1 export LIBOMPTARGET_INFO=1 export OMP_TARGET_OFFLOAD=MANDATORY - cd $REPO_DIR/Programs/UnitTests/Basics/Runtime/Executables + cd "$REPO_DIR"/Programs/UnitTests/Basics/Runtime/Executables || exit 1 echo ./PROGRAM_HEADER_Singleton_Test_$GENASIS_MACHINE ./PROGRAM_HEADER_Singleton_Test_$GENASIS_MACHINE echo - cd $REPO_DIR/Programs/Examples/Basics/FluidDynamics/Executables + cd "$REPO_DIR"/Programs/Examples/Basics/FluidDynamics/Executables || exit 1 echo echo "================= 2D RiemannProblem ========" - _cmd="./RiemannProblem_$GENASIS_MACHINE Verbosity=INFO_2 nCells=256,256 \ Dimensionality=2D FinishTime=0.25 nWrite=10" - echo $_cmd - time $_cmd - echo "Done: $_cmd" + _cmd=(./RiemannProblem_"$GENASIS_MACHINE" Verbosity=INFO_2 "nCells=256,256" + Dimensionality=2D FinishTime=0.25 nWrite=10) + echo "${_cmd[@]}" + time "${_cmd[@]}" + echo "Done: ${_cmd[*]}" echo echo "================= attempting mpirun ========" echo #echo ldd ./SineWaveAdvection_$GENASIS_MACHINE #ldd ./SineWaveAdvection_$GENASIS_MACHINE echo - _cmd="$OPENMPI_DIR/bin/mpirun -np 1 $AOMP/bin/gpurun $REPO_DIR/Programs/Examples/Basics/FluidDynamics/Executables/SineWaveAdvection_$GENASIS_MACHINE nCells=128,128,128" - echo $_cmd - time $_cmd + _cmd=("$OPENMPI_DIR"/bin/mpirun -np 1 "$AOMP"/bin/gpurun + "$REPO_DIR"/Programs/Examples/Basics/FluidDynamics/Executables/SineWaveAdvection_"$GENASIS_MACHINE" + "nCells=128,128,128") + echo "${_cmd[@]}" + time "${_cmd[@]}" echo "================= end mpirun ========" echo "================= Now running Unitests related to offloading ========" - cd $REPO_DIR/Programs/UnitTests/Basics/Devices/Executables + cd "$REPO_DIR"/Programs/UnitTests/Basics/Devices/Executables || exit 1 ./AllocateDevice_Command_Test_$GENASIS_MACHINE echo "AllocateDevice_Command_Test_$GENASIS_MACHINE done!" ./AllocateHost_Command_Test_$GENASIS_MACHINE diff --git a/bin/run_genasis_flang_new.sh b/bin/run_genasis_flang_new.sh index 9f54d1642..ef6a50bd1 100755 --- a/bin/run_genasis_flang_new.sh +++ b/bin/run_genasis_flang_new.sh @@ -23,18 +23,19 @@ # AOMP=/llvm ./run_genasis_flang_new.sh # # --- Start standard header to set AOMP environment variables ---- -realpath=`realpath $0` -thisdir=`dirname $realpath` +realpath=$(realpath "$0") +thisdir=$(dirname "$realpath") export AOMP_USE_CCACHE=0 -. $thisdir/aomp_common_vars +# shellcheck disable=SC1091 +. "$thisdir"/aomp_common_vars # --- end standard header ---- # Setup AOMP variables AOMP=${AOMP:-$HOME/rocm/aomp/llvm} -AOMPHIP=${AOMPHIP:-$(realpath -m $(realpath -m $AOMP)/../..)} +AOMPHIP=${AOMPHIP:-$(realpath -m "$(realpath -m "$AOMP")/../..")} # for ROCm utilities (e.g. rocm_agent_enumerator) -ROCM=${ROCM:-$(realpath -m $(realpath -m $AOMP)/../..)} +ROCM=${ROCM:-$(realpath -m "$(realpath -m "$AOMP")/../..")} FLANG=${FLANG:-flang} echo "AOMP = $AOMP" @@ -50,19 +51,19 @@ SRC_DIR=${SRC_DIR:-GenASis} # old source REPO_DIR=$AOMP_REPOS_TEST/$SRC_DIR if [ -d "$REPO_DIR" ] ; then - echo $REPO_DIR " exists." + echo "$REPO_DIR exists." else echo "$REPO_DIR does not exist. Please run ./clone_test.sh and re-run this script." exit fi # Copy Makefile_ROCm to GenASis repository -cp Makefile_ROCmFlangNew $REPO_DIR/Build/Machines/ +cp Makefile_ROCmFlangNew "$REPO_DIR"/Build/Machines/ -patchrepo $AOMP_REPOS_TEST/$SRC_DIR -trap "removepatch $AOMP_REPOS_TEST/$SRC_DIR" EXIT +patchrepo "$AOMP_REPOS_TEST/$SRC_DIR" +trap 'removepatch "$AOMP_REPOS_TEST/$SRC_DIR"' EXIT -cd $REPO_DIR +cd "$REPO_DIR" || exit 1 AOMP_SUPP=${AOMP_SUPP:-$HOME/local} export OPENMPI_DIR="$AOMP_SUPP/openmpi" @@ -71,13 +72,14 @@ export HDF5_DIR="$AOMP_SUPP/hdf5" export GENASIS_MACHINE=ROCmFlangNew if [ -d "$AOMP" ] ; then - echo $AOMP " exists." + echo "$AOMP exists." else echo "Install latest AOMP and try again!" exit fi -export GPU_ID=$($ROCM/bin/rocm_agent_enumerator | grep -m 1 -E gfx[^0]{1}.{2}) +GPU_ID=$("$ROCM"/bin/rocm_agent_enumerator | grep -m 1 -E 'gfx[^0]{1}.{2}') +export GPU_ID currdir=$(pwd) if [ -d "$SILO_DIR" ] ; then echo "SILO 4.11.1 exists." @@ -86,11 +88,11 @@ else exit fi if [ -d "$HDF5_DIR" ] ; then - echo "HDF5-1.14.0 exists." + echo "HDF5-2.2.0 exists." export INCLUDE_HDF5="-I$HDF5_DIR/include" export LIBRARY_HDF5="-L$HDF5_DIR/lib -lhdf5_fortran -lhdf5" else - echo "HDF5-1.14.0 does not exist. Please run ./build_supp.sh hdf5 in $thisdir" + echo "HDF5-2.2.0 does not exist. Please run ./build_supp.sh hdf5 in $thisdir" exit fi if [ -d "$OPENMPI_DIR" ] ; then @@ -127,7 +129,7 @@ export FORTRAN_LINK="$AOMP/bin/clang $OTHER_LIBS" export DEVICE_COMPILE="$AOMPHIP/bin/hipcc -D__HIP_PLATFORM_HCC__" export HIP_DIR=$ROCM export HIP_CLANG_PATH=$AOMP/bin -cd $currdir +cd "$currdir" || exit 1 echo "LD_LIBRARY_PATH = $LD_LIBRARY_PATH" echo "FORTRAN_COMPILE = $FORTRAN_COMPILE" @@ -140,7 +142,7 @@ echo "HIP_DIR = $HIP_DIR" echo "HIP_CLANG_PATH = $HIP_CLANG_PATH" if [ "$1" != "runonly" ] ; then - cd $REPO_DIR/Programs/UnitTests/Basics/Runtime/Executables + cd "$REPO_DIR"/Programs/UnitTests/Basics/Runtime/Executables || exit 1 echo "================= STARTING 1st MAKE in $PWD ========" make clean make PURPOSE=OPTIMIZE all @@ -150,7 +152,7 @@ if [ "$1" != "runonly" ] ; then exit fi echo - cd $REPO_DIR/Programs/Examples/Basics/FluidDynamics/Executables + cd "$REPO_DIR"/Programs/Examples/Basics/FluidDynamics/Executables || exit 1 echo "================= STARTING 2nd MAKE in $PWD ========" make clean make PURPOSE=OPTIMIZE all @@ -160,7 +162,7 @@ if [ "$1" != "runonly" ] ; then exit fi echo - cd $REPO_DIR/Programs/UnitTests/Basics/Devices/Executables + cd "$REPO_DIR"/Programs/UnitTests/Basics/Devices/Executables || exit 1 echo "================= STARTING 3rd MAKE in $PWD ========" make clean make PURPOSE=OPTIMIZE all @@ -177,12 +179,12 @@ if [ "$1" != "buildonly" ] ; then # export LIBOMPTARGET_INFO=1 export OMP_TARGET_OFFLOAD=MANDATORY ulimit -s unlimited - cd $REPO_DIR/Programs/UnitTests/Basics/Runtime/Executables + cd "$REPO_DIR"/Programs/UnitTests/Basics/Runtime/Executables || exit 1 echo ./PROGRAM_HEADER_Singleton_Test_$GENASIS_MACHINE ./PROGRAM_HEADER_Singleton_Test_$GENASIS_MACHINE echo echo "================= Now running Unitests related to offloading ========" - cd $REPO_DIR/Programs/UnitTests/Basics/Devices/Executables + cd "$REPO_DIR"/Programs/UnitTests/Basics/Devices/Executables || exit 1 ./AllocateDevice_Command_Test_$GENASIS_MACHINE echo "AllocateDevice_Command_Test_$GENASIS_MACHINE done!" ./AllocateHost_Command_Test_$GENASIS_MACHINE @@ -199,27 +201,31 @@ if [ "$1" != "buildonly" ] ; then echo "DisassociateHost_Command_Test_$GENASIS_MACHINE done!" ./UpdateDevice_Command_Test_$GENASIS_MACHINE echo "UpdateDevice_Command_Test_$GENASIS_MACHINE done!" - cd $REPO_DIR/Programs/Examples/Basics/FluidDynamics/Executables + cd "$REPO_DIR"/Programs/Examples/Basics/FluidDynamics/Executables || exit 1 echo echo "================= 2D RiemannProblem ========" - _cmd="./RiemannProblem_$GENASIS_MACHINE Verbosity=INFO_2 nCells=256,256 \ Dimensionality=2D FinishTime=0.25 nWrite=10" - echo $_cmd - time $_cmd - echo "Done: $_cmd" + _cmd=(./RiemannProblem_"$GENASIS_MACHINE" Verbosity=INFO_2 "nCells=256,256" + Dimensionality=2D FinishTime=0.25 nWrite=10) + echo "${_cmd[@]}" + time "${_cmd[@]}" + echo "Done: ${_cmd[*]}" echo echo "================= 3D RiemannProblem ========" - _cmd="./RiemannProblem_${GENASIS_MACHINE} Verbosity=INFO_2 nCells=256,256,256 Dimensionality=3D NoWrite=T FinishCycle=10" - echo $_cmd - time $_cmd - echo "Done: $_cmd" + _cmd=(./RiemannProblem_"${GENASIS_MACHINE}" Verbosity=INFO_2 "nCells=256,256,256" + Dimensionality=3D NoWrite=T FinishCycle=10) + echo "${_cmd[@]}" + time "${_cmd[@]}" + echo "Done: ${_cmd[*]}" echo echo "================= attempting mpirun ========" echo #echo ldd ./SineWaveAdvection_$GENASIS_MACHINE #ldd ./SineWaveAdvection_$GENASIS_MACHINE echo - _cmd="$OPENMPI_DIR/bin/mpirun -np 1 $AOMP/bin/gpurun $REPO_DIR/Programs/Examples/Basics/FluidDynamics/Executables/SineWaveAdvection_$GENASIS_MACHINE nCells=128,128,128 Verbosity=INFO_5" - echo $_cmd - time $_cmd + _cmd=("$OPENMPI_DIR"/bin/mpirun -np 1 "$AOMP"/bin/gpurun + "$REPO_DIR"/Programs/Examples/Basics/FluidDynamics/Executables/SineWaveAdvection_"$GENASIS_MACHINE" + "nCells=128,128,128" Verbosity=INFO_5) + echo "${_cmd[@]}" + time "${_cmd[@]}" echo "================= end mpirun ========" fi diff --git a/srock-bin/build_cmake.sh b/srock-bin/build_cmake.sh index 2207e80ff..bf24d3c2b 100755 --- a/srock-bin/build_cmake.sh +++ b/srock-bin/build_cmake.sh @@ -12,6 +12,7 @@ PREREQUISITE_COMPONENTS=${PREREQUISITE_COMPONENTS:-cmake rocmsmilib hwloc aqlpro # --- Start standard header to set SROCK environment variables ---- realpath=$(realpath "$0") thisdir=$(dirname "$realpath") +# shellcheck disable=SC1091 . "$thisdir/srock_common_vars" # --- end standard header ---- FLANG=${FLANG:-flang} @@ -90,62 +91,6 @@ function checkversion(){ fi fi } -function buildopenmpi(){ - # Not all builds, trunk for example, install clang into lib/llvm/bin. Fall back on $SROCK/bin. - if [ ! -f "$LLVM_INSTALL_LOC/bin/${FLANG}" ] ; then - LLVM_INSTALL_LOC=$SROCK - if [ ! -f "$LLVM_INSTALL_LOC/bin/${FLANG}" ] ; then - LLVM_INSTALL_LOC=$SROCK/lib/llvm - if [ ! -f "$LLVM_INSTALL_LOC/bin/${FLANG}" ] ; then - echo "Error: buildopenmpi cannot find ${FLANG} executable. Set SROCK to location of $FLANG " - exit 1 - fi - fi - fi - if [ ! -d "$SROCK_SUPP/hwloc" ] ; then - echo "Error: 'build_supp.sh openmpi' requires that hwloc is installed at $SROCK_SUPP/hwloc" - echo " Please run 'build_supp.sh hwloc' " - exit 1 - fi - - _cname="openmpi" - _version=5.0.7 - _release=v5.0 - _installdir=$SROCK_SUPP_INSTALL/$_cname-$_version - _linkfrom=$SROCK_SUPP/$_cname - _builddir=$SROCK_SUPP_BUILD/$_cname - - SKIPBUILD="FALSE" - checkversion - if [ "$SKIPBUILD" == "TRUE" ] ; then - return - fi - if [ -d "$_builddir" ] ; then - runcmd "rm -rf $_builddir" - fi - runcmd "mkdir -p $_builddir" - runcmd "cd $_builddir" - runcmd "wget https://download.open-mpi.org/release/open-mpi/$_release/openmpi-$_version.tar.bz2" - runcmd "bzip2 -d openmpi-$_version.tar.bz2" - runcmd "tar -xf openmpi-$_version.tar" - runcmd "cd openmpi-$_version" - if [ -d "$_installdir" ] ; then - runcmd "rm -rf $_installdir" - fi - runcmd "mkdir -p $_installdir" - ### update configure to recognize flang - runcmd "cp configure configure-orig" - runcmdout "sed -e s/flang\s*)/flang*)/ configure-orig" configure - ### - runcmd "./configure --with-hwloc=$SROCK_SUPP/hwloc --with-hwloc-libdir=$SROCK_SUPP/hwloc/lib OMPI_CC=$LLVM_INSTALL_LOC/bin/clang OMPI_CXX=$LLVM_INSTALL_LOC/bin/clang++ OMPI_F90=$LLVM_INSTALL_LOC/bin/${FLANG} CXX=$LLVM_INSTALL_LOC/bin/clang++ CC=$LLVM_INSTALL_LOC/bin/clang FC=$LLVM_INSTALL_LOC/bin/${FLANG} --prefix=$_installdir" - runcmd "make -j8" - runcmd "make install" - if [ -L "$_linkfrom" ] ; then - runcmd "rm $_linkfrom" - fi - runcmd "ln -sf $_installdir $_linkfrom" - echo "# $_linkfrom is now symbolic link to $_installdir " >>"$CMDLOGFILE" -} function buildninja(){ _cname="ninja" @@ -255,120 +200,9 @@ function getrocmpackage(){ echo "# $_linkfrom is now symbolic link to $_installdir " >>"$CMDLOGFILE" } -function buildhdf5(){ - _cname="hdf5" - _version=1.12.0 - _release=hdf5-1.12 - _installdir=$SROCK_SUPP_INSTALL/hdf5-$_version - _linkfrom=$SROCK_SUPP/hdf5 - _builddir=$SROCK_SUPP_BUILD/hdf5 - SKIPBUILD="FALSE" - checkversion - if [ "$SKIPBUILD" == "TRUE" ] ; then - return - fi - - if [ -d "$_builddir" ] ; then - runcmd "rm -rf $_builddir" - fi - runcmd "mkdir -p $_builddir" - runcmd "cd $_builddir" - runcmd " wget https://support.hdfgroup.org/ftp/HDF5/releases/$_release/hdf5-$_version/src/hdf5-$_version.tar.bz2" - runcmd "bzip2 -d hdf5-$_version.tar.bz2" - runcmd "tar -xf hdf5-$_version.tar" - runcmd "cd hdf5-$_version" - if [ -d "$_installdir" ] ; then - runcmd "rm -rf $_installdir" - fi - runcmd "mkdir -p $_installdir" - runcmd "./configure --enable-fortran --prefix=$_installdir" - runcmd "make -j8" - runcmd "make install" - if [ -L "$_linkfrom" ] ; then - runcmd "rm $_linkfrom" - fi - runcmd "ln -sf $_installdir $_linkfrom" - echo "# $_linkfrom is now symbolic link to $_installdir " >>"$CMDLOGFILE" -} - -function buildsilo(){ - _cname="silo" - _version=4.10.2 - _installdir=$SROCK_SUPP_INSTALL/silo-$_version - _linkfrom=$SROCK_SUPP/silo - _builddir=$SROCK_SUPP_BUILD/silo - SKIPBUILD="FALSE" - checkversion - if [ "$SKIPBUILD" == "TRUE" ] ; then - return - fi - - if [ -d "$_builddir" ] ; then - runcmd "rm -rf $_builddir" - fi - runcmd "mkdir -p $_builddir" - runcmd "cd $_builddir" - # runcmd "wget https://wci.llnl.gov/sites/wci/files/2021-01/silo-$_version.tgz" - # runcmd "tar -xzf silo-$_version.tgz" - runcmd "wget https://software.llnl.gov/Silo/ghpages/releases/silo-$_version.tar.xz" - runcmd "tar -x --xz -f silo-$_version.tar.xz" - runcmd "cd silo-$_version" - if [ -d "$_installdir" ] ; then - runcmd "rm -rf $_installdir" - fi - runcmd "mkdir -p $_installdir" - runcmd "./configure --prefix=$_installdir" - runcmd "make -j8" - runcmd "make install" - if [ -L "$_linkfrom" ] ; then - runcmd "rm $_linkfrom" - fi - runcmd "ln -sf $_installdir $_linkfrom" - echo "# $_linkfrom is now symbolic link to $_installdir " >>"$CMDLOGFILE" -} - -function buildfftw(){ - _cname="fftw" - _version=3.3.8 - _installdir=$SROCK_SUPP_INSTALL/fftw-$_version - _linkfrom=$SROCK_SUPP/fftw - _builddir=$SROCK_SUPP_BUILD/fftw - SKIPBUILD="FALSE" - checkversion - if [ "$SKIPBUILD" == "TRUE" ] ; then - return - fi - - if [ -d "$_builddir" ] ; then - runcmd "rm -rf $_builddir" - fi - runcmd "mkdir -p $_builddir" - runcmd "cd $_builddir" - runcmd "wget http://www.fftw.org/fftw-$_version.tar.gz" - runcmd "tar -xzf fftw-$_version.tar.gz" - runcmd "cd fftw-$_version" - if [ -d "$_installdir" ] ; then - runcmd "rm -rf $_installdir" - fi - runcmd "mkdir -p $_installdir" - runcmd "./configure --prefix=$_installdir --enable-shared --enable-threads --enable-sse2 --enable-avx" - runcmd "make -j8" - runcmd "make install" - runcmd "make clean" - runcmd "./configure --prefix=$_installdir --enable-shared --enable-threads --enable-sse2 --enable-avx --enable-float" - runcmd "make -j8" - runcmd "make install" - if [ -L "$_linkfrom" ] ; then - runcmd "rm $_linkfrom" - fi - runcmd "ln -sf $_installdir $_linkfrom" - echo "# $_linkfrom is now symbolic link to $_installdir " >>"$CMDLOGFILE" -} - - function buildcmake(){ _cname="cmake" - _version=3.25.2 + _version=3.31.0 _installdir=$SROCK_SUPP_INSTALL/$_cname-$_version _linkfrom=$SROCK_SUPP/$_cname _builddir=$SROCK_SUPP_BUILD/$_cname @@ -400,82 +234,6 @@ function buildcmake(){ echo "# $_linkfrom is now symbolic link to $_installdir " >>"$CMDLOGFILE" } -function buildrocmsmilib(){ - _cname="rocmsmilib" - _version=7.0.x - _installdir=$SROCK_SUPP_INSTALL/rocmsmilib-$_version - _linkfrom=$SROCK_SUPP/rocmsmilib - _builddir=$SROCK_SUPP_BUILD/rocmsmilib - SKIPBUILD="FALSE" - checkversion - if [ "$SKIPBUILD" == "TRUE" ] ; then - return - fi - - if [ -d "$_builddir" ] ; then - runcmd "rm -rf $_builddir" - fi - runcmd "mkdir -p $_builddir" - runcmd "cd $_builddir" - runcmd "git clone -b release/rocm-rel-7.0 https://github.com/ROCm/rocm_smi_lib rocmsmilib-$_version" - runcmd "cd rocmsmilib-$_version" - runcmd "mkdir -p build" - runcmd "cd build" - runcmd "$SROCK_SUPP/cmake/bin/cmake -DCMAKE_INSTALL_PREFIX=$_installdir .." - if [ -d "$_installdir" ] ; then - runcmd "rm -rf $_installdir" - fi - runcmd "mkdir -p $_installdir" - runcmd "make -j8" - runcmd "make install" - if [ -L "$_linkfrom" ] ; then - runcmd "rm $_linkfrom" - fi - runcmd "ln -sf $_installdir $_linkfrom" - echo "# $_linkfrom is now symbolic link to $_installdir " >>"$CMDLOGFILE" -} - -function buildhwloc(){ - _cname="hwloc" - _version=2.7 - _installdir=$SROCK_SUPP_INSTALL/hwloc-$_version - _linkfrom=$SROCK_SUPP/hwloc - _builddir=$SROCK_SUPP_BUILD/hwloc - SKIPBUILD="FALSE" - checkversion - if [ "$SKIPBUILD" == "TRUE" ] ; then - return - fi - - if [ ! -d "$SROCK_SUPP/rocmsmilib/lib" ] && [ ! -d "$SROCK_SUPP/rocmsmilib/lib64" ]; then - echo "ERROR: Must build rocmsmilib before hwloc. Try:" - echo " $0 rocmsmilib" - echo "#ERROR: You must build rocmsmilib before hwloc because static build of hwloc depends on rocsmilib">>"$CMDLOGFILE" - exit 1 - fi - if [ -d "$_builddir" ] ; then - runcmd "rm -rf $_builddir" - fi - runcmd "mkdir -p $_builddir" - runcmd "cd $_builddir" - runcmd "git clone https://github.com/open-mpi/hwloc hwloc-$_version" - runcmd "cd hwloc-$_version" - runcmd "git checkout v$_version" - runcmd "./autogen.sh" - runcmd "./configure --prefix=$_installdir --with-pic=yes --enable-static=yes --enable-shared=no --disable-io --disable-libudev --disable-libxml2 --with-rocm=$SROCK_SUPP/rocsmilib" - if [ -d "$_installdir" ] ; then - runcmd "rm -rf $_installdir" - fi - runcmd "mkdir -p $_installdir" - runcmd "make -j8" - runcmd "make install" - if [ -L "$_linkfrom" ] ; then - runcmd "rm $_linkfrom" - fi - runcmd "ln -sf $_installdir $_linkfrom" - echo "# $_linkfrom is now symbolic link to $_installdir " >>"$CMDLOGFILE" -} - #--------------------------- Main script starts here ----------------------- CMDLOGFILE=$SROCK_SUPP_BUILD/cmdlog diff --git a/test/smoke-fort-fails/lcompiler-2635/Makefile b/test/smoke-fort-fails/lcompiler-2635/Makefile new file mode 100644 index 000000000..03b82ea07 --- /dev/null +++ b/test/smoke-fort-fails/lcompiler-2635/Makefile @@ -0,0 +1,17 @@ +include ../../Makefile.defs + +TESTNAME = test +TESTSRC_MAIN = test.f90 +TESTSRC_AUX = +TESTSRC_ALL = $(TESTSRC_AUX) $(TESTSRC_MAIN) + +FLANG ?= flang +OMP_BIN = $(AOMP)/bin/$(FLANG) +CC = $(OMP_BIN) $(VERBOSE) +CFLAGS = $(FLANG_GPU_LINK_FLAGS) +# CFLAGS = $(FLANG_GPU_LINK_FLAGS) -O0 # works at -O0 +#OMP_FLAGS += -DFAIL + +RUNCMD = ./${TESTNAME} 2>&1 | tee ${TESTNAME}.out 2>&1 && diff -w ${TESTNAME}.out chk.stdout + +include ../Makefile.rules diff --git a/test/smoke-fort-fails/lcompiler-2635/chk.stderr b/test/smoke-fort-fails/lcompiler-2635/chk.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/test/smoke-fort-fails/lcompiler-2635/chk.stdout b/test/smoke-fort-fails/lcompiler-2635/chk.stdout new file mode 100644 index 000000000..49444eac5 --- /dev/null +++ b/test/smoke-fort-fails/lcompiler-2635/chk.stdout @@ -0,0 +1,7 @@ + 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. + 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. + 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. + 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. + 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. + 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. + 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. 42. diff --git a/test/smoke-fort-fails/lcompiler-2635/test.f90 b/test/smoke-fort-fails/lcompiler-2635/test.f90 new file mode 100644 index 000000000..887ea4b61 --- /dev/null +++ b/test/smoke-fort-fails/lcompiler-2635/test.f90 @@ -0,0 +1,20 @@ +program test +implicit none +integer, parameter :: n = 128 +integer :: i +real,allocatable :: dx(:) +real :: dx_cpy(n) + +allocate(dx(1:n)) +dx = 404 + +!$omp target teams distribute parallel do & +!$omp private(dx) +do i=1,100 +dx = 42.0 +dx_cpy = dx +enddo + +print *, dx_cpy +deallocate(dx) +end program test