- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I run
source /opt/intel/bin/compilervars.sh intel64
there are bash errors pop up due to the spaces in $PATH.
For example, I have path
/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common
in the $PATH and it will not be preserved correctly when passed through the remove_duplicate_paths() function in comilervars.sh.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Windows subsystem for linux is not a supported OS/environment. You will have to fix this issue on your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I apologize, my response is a bit off tone. What I meant to say is WSL is not an officially tested nor supported environment. There are, however, a few users on this Forum using WSL. Perhaps one of them has encountered this and will have a solution or workaround.
One thought I had - since this is Linux perhaps use the 'env2' solution HERE . Since the compilervars script invokes so many other sub-scripts, it's a rat's nest to unwind to find all the right env vars and their settings. env2 has to -to and -from, nothing saying you can't -from bash -to bash just to unravel all the spaghetti in the compilervars nest of sourcing. Then once you have that -from script THEN perhaps backslash-escape the spaces "\ " for each place where you see Windows paths.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
WSL purports to be Ubuntu. I'm wondering if the Intel scripts would work on Linux if path contained spaces, which is not typical on Linux.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve, I wonder the same. From what I can tell, it comes from the function
remove_duplicate_paths() {
local arg=$1
if [ "${INTEL_HOST_PLATFORM}" = "Darwin" ]; then
local arr=(`echo ${!arg} | sed 's/:/\'$'\n/g'`)
else
local arr=(`echo ${!arg} | sed 's/:/\n/g'`)
fi
local fixarr=()
local found=
local i=0
for var in ${arr[*]}; do
found=0
for dup in ${fixarr[*]}; do
if [ "${dup}" = "${var}" ]; then
found=1
break
fi
done
if [ "${found}" = "0" ]; then
if [ "${#fixarr[*]}" = "0" ]; then
fixarr=("${var}")
else
fixarr=("${fixarr[*]} ${var}")
fi
fi
done
echo $fixarg
local fixarg=`echo ${fixarr[*]} | sed 's/ /:/g'`
eval export \$arg="${fixarg}"
}
which uses spaces as a natural delimiter to make the different paths in $PATH as different strings to look for duplicates and substitute at the end with ":". It works cleverly for most traditional linux environments and I never had a problem with it until I start to use WSL2 on a new laptop yesterday. But from the look of it, it will fail if there is a space in any path in a regular linux environment as well. I wonder if it's better to write the remove duplicate function in perl or even awk to be bullet proof.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ronald, No need to apologize and I appreciate your new input here. I think it's a valid way to manually fix the issue. - Ming
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page