0

The oneAPI toolkit provided by Intel requires sourcing of a bash script to add several executables/libraries to $PATH and other environment variables. For this, the documentation instructs to run a provided script as

source setvars.sh

However, on a fresh Ubuntu 20.04 system (supported by Intel OneAPI), I get the following error.

$ source setvars.sh
  :: ERROR: No env scripts found: No "env/vars.sh" scripts to process.
This can be caused by a bad or incomplete "--config" file.
Can also be caused by an incomplete or missing oneAPI installation.

After pouring through forums, I came upon a workaround here for zsh-type shells. Following those hints, when I run

bash -c 'source setvars.sh'

There are no errors reported and the script runs perfectly. As expected, the env variables are not available after execution of the bash -c command.

One workaround to this, is to do

bash -c 'source setvars.sh; exec bash'

every time I open a new terminal. This is very annoying.

I would like to source setvars.sh somewhere inside .bashrc or .profile and forget about it.

Why does source setvars.sh not work and bash -c 'source setvars.sh' run without errors here.

Cibin Joseph
  • 1,173
  • 1
  • 11
  • 16
  • 1
    Have you tried `source COMPLETE_PATH/setvars.sh` ? In seems to be looking in an `env` directory, if you for the entire path it might work? – Nic3500 Aug 17 '22 at 14:27
  • 3
    What is your shell? The script is for `bash`. There are multiple other shells (`csh`, `ksh`, `zsh`, `dash`,...). What shell does your Ubuntu use? You select your preferred shell even on user-level. Different users may use different shells even ona single computer. Some softwares supply a separate configuration script for bash and relsted shellls and a separate one for C shell. – Vladimir F Героям слава Aug 17 '22 at 16:29
  • 1
    @VladimirFГероямслава I concur, this is a shell issue. They are probably running under `sh` and not `bash`. – Something Something Aug 17 '22 at 16:32
  • I've tried using the full path. And I work with a bash shell, the OS is a fresh install. It does seem like a shell issue to me too. I have no idea how to check whether `source` is from a different shell though. – Cibin Joseph Aug 18 '22 at 05:49

1 Answers1

0

Answering my own question. This turned out to be an issue with the cd command being aliased to cd "$@" && ls. Sourcing the setvars.sh script before the alias definition solved the issue.

Refer discussion on the Intel Communities forum here.

Cibin Joseph
  • 1,173
  • 1
  • 11
  • 16