- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Products from oneAPI are meant to be loaded into a terminal session through the script:
/opt/intel/oneapi/setvars.sh
The script has this at the header:
#!/bin/sh
# shellcheck shell=sh
# shellcheck source=/dev/null
# shellcheck disable=SC2312
Which suggests that it should be usable by sourcing it in a generic shell. It works correctly if one uses 'bash' or 'zsh' as shell, but it doesn't work at all with 'fish' (a very popular shell for unix systems), unlike common software such as 'conda' (which correctly handles a wide variety of shells in the scripts it sources).
This is the error that I get when trying to source it using 'fish':
~> source /opt/intel/oneapi/setvars.sh
/opt/intel/oneapi/setvars.sh (line 75): Unsupported use of '='. In fish, please use 'set script_name setvars.sh'.
script_name=setvars.sh
^~~~~~~~~~~~~~~~~~~~~^
from sourcing file /opt/intel/oneapi/setvars.sh
source: Error while reading file '/opt/intel/oneapi/setvars.sh'
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, thank you for your question.
The setvars.sh script provided by Intel oneAPI is written for sh compatible shells which include bash and zsh, but not fish. To source environment variables and configurations in fish, you would typically need a script written specifically for the fish syntax.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And that, precisely, is the problem: the script provided by intel's oneAPI is not usable with fish.
Compare that against other software that might typically be used alongside with oneAPI products, such as 'conda', which in contrast offers variants of their sourcing script for a wide variety of shells, including bash, zsh, xonsh, and others:
https://github.com/conda/conda/blob/da66071bb4a8bc4cfba97c8f05ec20e8e3ee5f1c/conda/shell/etc/fish/conf.d/conda.fish#L60
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kindly note that we were unable to get any response from your side. We will be awaiting your reply in the next 24 business hour then we will proceed with the closure of this ticket.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Specifically, it has a different syntax for setting variables compared to the Bash shell. To source the script in Fish, you would need to translate the syntax to something Fish understands or run the script in a compatible shell. Maybe like you need to create a wrapper script that sets the environment variables in Bash and then prints them out in a format that Fish can understand. Then you can source this output in Fish.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page