From 8d047203d44cbe5da96fb7787cda6ee5784f7ed1 Mon Sep 17 00:00:00 2001 From: edoapra Date: Mon, 20 Nov 2023 17:03:36 -0800 Subject: [PATCH 1/5] check if openblas lib is present --- src/config/oblas_ompcheck.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/config/oblas_ompcheck.sh b/src/config/oblas_ompcheck.sh index 299c81e0dc..b668f743af 100755 --- a/src/config/oblas_ompcheck.sh +++ b/src/config/oblas_ompcheck.sh @@ -27,11 +27,16 @@ else SOSUFFIX=so fi # check first against clang libomp -gotomp=$($MYLDD $oblas_dir/lib$oblas_name.$SOSUFFIX | grep libomp | wc -l ) -# next check against gcc libgomp -if [ $gotomp -eq 0 ] +if [ -f "$oblas_dir/lib$oblas_name.$SOSUFFIX" ]; then -gotomp=$($MYLDD $oblas_dir/lib$oblas_name.$SOSUFFIX | grep libgomp | wc -l ) + gotomp=$($MYLDD $oblas_dir/lib$oblas_name.$SOSUFFIX | grep libomp | wc -l ) +# next check against gcc libgomp + if [ $gotomp -eq 0 ] + then + gotomp=$($MYLDD $oblas_dir/lib$oblas_name.$SOSUFFIX | grep libgomp | wc -l ) + fi +else + gotomp=0 fi echo gotomp $gotomp >> $mylog #conda packages might use OpenMP to thread OpenBLAS From 9a764685abfd775a04bb5ffc398f3776ca2a041b Mon Sep 17 00:00:00 2001 From: edoapra Date: Mon, 20 Nov 2023 17:15:27 -0800 Subject: [PATCH 2/5] fix simd detection --- src/NWints/simint/libsimint_source/build_simint.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/NWints/simint/libsimint_source/build_simint.sh b/src/NWints/simint/libsimint_source/build_simint.sh index 5acd8ee250..3895c0bec7 100755 --- a/src/NWints/simint/libsimint_source/build_simint.sh +++ b/src/NWints/simint/libsimint_source/build_simint.sh @@ -32,8 +32,8 @@ else arch=$(uname -m) fi if [[ ${UNAME_S} == Linux ]]; then - CPU_FLAGS=$(cat /proc/cpuinfo | grep flags |tail -n 1) - CPU_FLAGS_2=$(cat /proc/cpuinfo | grep flags |tail -n 1) + CPU_FLAGS=$(cat /proc/cpuinfo | grep flags |grep -v vmx\ f |tail -n 1) + CPU_FLAGS_2=$(cat /proc/cpuinfo | grep flags | grep -v vmx\ f |tail -n 1) elif [[ ${UNAME_S} == Darwin ]]; then CPU_FLAGS=$(sysctl -n machdep.cpu.features) if [[ "$arch" == "x86_64" ]]; then @@ -43,6 +43,8 @@ else echo Operating system not supported yet exit 1 fi +echo CPU_FLAGS $CPU_FLAGS +echo CPU_FLAGS_2 $CPU_FLAGS_2 GOTSSE2=$(echo ${CPU_FLAGS} | tr 'A-Z' 'a-z'| awk ' /sse2/ {print "Y"}') GOTAVX=$(echo ${CPU_FLAGS} | tr 'A-Z' 'a-z'| awk ' /avx/ {print "Y"}') GOTAVX2=$(echo ${CPU_FLAGS_2} | tr 'A-Z' 'a-z'| awk ' /avx2/ {print "Y"}') From 50fd485af7755337d076ecaa54fce468428af419 Mon Sep 17 00:00:00 2001 From: edoapra Date: Mon, 20 Nov 2023 17:47:42 -0800 Subject: [PATCH 3/5] fix simd detection --- src/libext/openblas/build_openblas.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libext/openblas/build_openblas.sh b/src/libext/openblas/build_openblas.sh index 7885395e19..3f12487bd5 100755 --- a/src/libext/openblas/build_openblas.sh +++ b/src/libext/openblas/build_openblas.sh @@ -33,8 +33,8 @@ if [[ -z "${FORCETARGET}" ]]; then FORCETARGET=" " UNAME_S=$(uname -s) if [[ ${UNAME_S} == Linux ]]; then - CPU_FLAGS=$(cat /proc/cpuinfo | grep flags |tail -n 1) - CPU_FLAGS_2=$(cat /proc/cpuinfo | grep flags |tail -n 1) + CPU_FLAGS=$(cat /proc/cpuinfo | grep flags | grep -v vmx\ f |tail -n 1) + CPU_FLAGS_2=$(cat /proc/cpuinfo | grep flags | grep -v vmx\ f |tail -n 1) elif [[ ${UNAME_S} == Darwin ]]; then CPU_FLAGS=$(/usr/sbin/sysctl -n machdep.cpu.features) if [[ "$arch" == "x86_64" ]]; then From b113c2e51061174d5543975045c751a0ee8cb6c6 Mon Sep 17 00:00:00 2001 From: edoapra Date: Mon, 20 Nov 2023 21:20:45 -0800 Subject: [PATCH 4/5] fix simd detection --- travis/guess_simd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/travis/guess_simd.sh b/travis/guess_simd.sh index 36c7686283..9c91759102 100755 --- a/travis/guess_simd.sh +++ b/travis/guess_simd.sh @@ -2,8 +2,8 @@ UNAME_S=$(uname -s) arch=`uname -m` if [[ ${UNAME_S} == Linux ]]; then - CPU_FLAGS=$(cat /proc/cpuinfo | grep flags |tail -n 1) - CPU_FLAGS_2=$(cat /proc/cpuinfo | grep flags |tail -n 1) + CPU_FLAGS=$(cat /proc/cpuinfo | grep flags |grep -v vmx\ flags |tail -n 1) + CPU_FLAGS_2=$(cat /proc/cpuinfo | grep flags |grep -v vmx\ flags |tail -n 1) elif [[ ${UNAME_S} == Darwin ]]; then CPU_FLAGS=$(/usr/sbin/sysctl -n machdep.cpu.features) if [[ "$arch" == "x86_64" ]]; then From 1f3dc2f08c4fc0fb72074a5739fcaa6a2fccc0d3 Mon Sep 17 00:00:00 2001 From: edoapra Date: Fri, 24 Nov 2023 11:55:50 -0800 Subject: [PATCH 5/5] quick exit when BLASOPT is not defined --- src/config/oblas_ompcheck.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/config/oblas_ompcheck.sh b/src/config/oblas_ompcheck.sh index b668f743af..d965c3f272 100755 --- a/src/config/oblas_ompcheck.sh +++ b/src/config/oblas_ompcheck.sh @@ -9,10 +9,18 @@ mylog=/tmp/mylog.txt NWCHEM_TOP=$1 file_check=$NWCHEM_TOP/src/oblas_ompcheck_done.txt if [ -f $file_check ]; then - echo $file_check present >> $mylog +# echo $file_check present >> $mylog cat $file_check exit 0 fi +echo BLASOPT is $BLASOPT >> $mylog +if [[ -z "${BLASOPT}" ]]; then + echo BLASOPT is empty >> $mylog + echo 0 > $NWCHEM_TOP/src/oblas_ompcheck_done.txt + exit 0 +else + echo BLASOPT is not empty @$BLASOPT@ >> $mylog +fi #extract oblas_dir & oblas_name from BLASOPT # oblas_dir=$(echo $BLASOPT | awk 'sub(/.*-L */,""){f=1} f{if ( sub(/ * .*/,"") ) f=0; print}')