Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Important Update: Community Platform Migration​. Learn more​>

problem with .csh

scottagold
Beginner
1,882 Views
I've installed the compiler and had no problem working from a bash shell, but am having difficulty setting it up to work in a csh shell with csh scripts. Below is what I've entered in the shell and the result. I'm using Ubuntu 10.04.

# source /opt/intel/Compiler/11.1/072/bin/ifortvars.csh intel64
ERROR: Unknown switch ''. Accepted values: ia32, intel64, ia64

Any suggestions would be much appreciated.
Thanks,
S.Gold
0 Kudos
6 Replies
Ron_Green
Moderator
1,882 Views
I don't see the same behavior here with csh. Try this:

$ which source
source: shell built-in command.

$ echo $0
csh

That said, I have not tried this with Ubu 10.04. I will have such a system ready to test later today or tomorrow.

ron
0 Kudos
mecej4
Honored Contributor III
1,882 Views
I have a vague recollection of reading somewhere that the default shell in Ubuntu is neither sh nor csh, but something else. If so, the behaviour of the source command may be something different from what is expected by the writers of ifortvars.sh/ifortvars.csh . It is quite possible that I am confusing Ubuntu with some other distribution of Linux, neither of which I have had any experience with.
0 Kudos
Ron_Green
Moderator
1,883 Views
my out of the box Ubuntu 10.04 came only with bash, no csh or tcsh. Here's what I got trying to invoke a csh shell:

$ csh
The program 'csh' can be found in the following packages:
* csh
* tcsh
Try: sudo apt-get install

I do remember the older Ubuntu you mentioned. It did have some weird default shell that I'd never heard of. But that was at least 2 revisions ago.

ron
0 Kudos
John4
Valued Contributor I
1,882 Views

Since version 6.06, Ubuntu's sh points to dash, which is kind of minimalist:

$ ls -l `which sh`
lrwxrwxrwx 1 root root 4 2010-05-18 11:50 /bin/sh -> dash

If the script expects bash (or csh, ksh, zsh, etc.), then it must be explicitly stated in the first line (e.g, #!/bin/bash ).

(slightly OT: Ubuntu's developers are insanely focused on improving speed in negligible areas, and since they wanted certain scripts to run as fast as possible, they decided to switch to dash by default, breaking a lot of scripts in the process... And something similar goes for the asynchronous system startup, which is faster, but might block access to some devices in the process).

0 Kudos
mecej4
Honored Contributor III
1,882 Views
In that case, we need 'scottagold' to run the same command to find out what csh is linked to -- a real C-shell or some imposter such as dash.

$ ls -l `which csh`

The Intel startup scripts specify the required shells explicitly. For example, on my Linux X64 system, ifortvars.csh contains "#!/bin/csh" on the shebang line.

John, tell us how dash treats the source command, please?
0 Kudos
John4
Valued Contributor I
1,882 Views

That one is easy! There was a bug report for that back in the day: https://launchpad.net/ubuntu/+source/dash/+bug/65046 .

dash contains only enough features to claim POSIX compliance, and it seems that source is not one of them ---the dot ( . ) should be used instead.

0 Kudos
Reply