Quantcast
Channel: Recent posts
Viewing all articles
Browse latest Browse all 190

Bug in daalvars.sh if installation path contains "/bin"

$
0
0

I am running the Professional Edition for Fortran and C++ of Intel Parallel Studio XE 2016. This bug occurs in versions 16.0.0 and 16.0.1 at least.

When I discovered this bug, I was trying to source bin/compilervars.sh in order to set my LD_LIBRARY_PATH properly. After running this, my LD_LIBRARY_PATH contained a couple of suspicious entries:

daalvars.csh daalvars.sh /soft/spack/opt/spack/linux-x86_64aries/intel-16.0.1/compilers_and_libraries_2016.1.150/linux/daal/bin/lib/intel64_lin
daalvars.csh daalvars.sh /soft/spack/opt/spack/linux-x86_64aries/intel-16.0.1/compilers_and_libraries_2016.1.150/linux/daal/bin/../compiler/lib/intel64_lin

The installation directory I used was:

/soft/spack/opt/spack/linux-x86_64/binaries/intel-16.0.1

As you can see, something stripped the "/bin" out of the middle of my path. I tracked this bug down to another script that is sourced by compilervars.sh. If you look inside daal/bin/daalvars.sh, you'll see the following line:

local daal=${daal_bin/\/bin/}

This line is designed to strip the "/bin" from the end of a path. However, my path contains the word "/binaries". This bash replacement actually strips out the first occurrence of the word "/bin". In order to fix this bug, I changed the line to the following:

local daal=${daal_bin%\/bin}

The second problem with daalvars.sh is actually on the line above. The script added a "daalvars.csh daalvars.sh " to my path. To be fair, this is actually my fault. In my .bashrc, I created a function:

function cd {
    command -p cd "$@"&& ls
}

This function automatically runs "ls" every time I change directories. The problem with the script is that it runs "cd" to determine the directory:

local daal_bin=$(cd "$(dirname "${BASH_SOURCE[0]}")"&& pwd)

The easiest fix for me was to change the line into:

local daal_bin=$(command -p cd "$(dirname "${BASH_SOURCE[0]}")"&& pwd)

I know, it's definitely my fault for creating a "cd" function that obscures the system "cd". If you don't want to patch this then I totally understand. It's mainly the "/bin" stripping that I consider to be a bug.

I attached a patch that I created for this bug. In order to use it, download the path, place it in the daal/bin directory, and run:

patch -p1 < daalvars_patch.txt daalvars.sh

I couldn't figure out where to submit a bug report for this problem, so if you would like me to submit an official bug report just let me know.


Viewing all articles
Browse latest Browse all 190

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>