Operating System - Linux
1832973 Members
2332 Online
110048 Solutions
New Discussion

Re: script which contains the f90 command with options

 
SOLVED
Go to solution
Roxana_4
Frequent Advisor

script which contains the f90 command with options

My name is Roxana and I'm from Brasov, Romania.
I work on a HP-UX 11 v.23 system

Would you be so kind to show me some web sites where i could find documentation about unix scripts ?

I am interested in writing a script in order to initialize the fortran compiler with options.
In this way i want to compile multiple sources without being necessary to write at prompter f 90 command with options, instead of it i would like to use a script which contains the f90 command with options.

Please tell me how to do it !!!

Thanks you and best regards.
7 REPLIES 7
RAC_1
Honored Contributor
Solution

Re: script which contains the f90 command with options

Why script for this?? You can manage with a alias. Soething like follows should be ok.

alias fortran='/dir/fg90 -a -b -c'

-a, -b and -c will be options to fg90 command.

Anil
There is no substitute to HARDWORK
Roxana_4
Frequent Advisor

Re: script which contains the f90 command with options

thank you
i am beginer
now i understand
easy

thanks

roxana
Tom Schroll
Frequent Advisor

Re: script which contains the f90 command with options


Roxana,

If using f90:

You can also set an environment variable which contains all of the options that you want passed to the compiler. According to the f90 man page (man f90), the variable would be "HP_F90OPTS":

csh/tcsh:
setenv HP_F90OPTS "-opt1 -opt2 ..."

sh/ksh:
HP_F90OPTS="-opt1 -opt2 ..."

You could also add the variable to your .profile (sh/ksh) or .cshrc (csh/tcsh).


PS: This method of using an environment variable is also available and documented for just about every other compiler in the world. You just need to read the man page to determine what that variable is called.

-- Tom

If it ain't broke, it needs optimized.
Roxana_4
Frequent Advisor

Re: script which contains the f90 command with options

Thank you for your help Tom.

I'm glad i've met at least one specialist in F90 on this forum. Your ideea is very usefull to me !

Thank you for your help RAC.

I apologize for my questions. I'm a beginner in unix and i intend to migrate from MPE \ iX to HPUX !

Best Regards !
Tom Schroll
Frequent Advisor

Re: script which contains the f90 command with options

Roxana,

I forgot to add one thing to the syntax for setting an environment variable in sh/ksh:

HP_F90OPTS="-opt1 -opt2 ..."
export HP_F90OPTS

(I forgot the export command to make sure the variable is propagated to sub-shells and other programs)

I'm no f90 expert. But I know a thing or two about compilers. :-) Thanks for the kind words. Take care.

-- Tom
If it ain't broke, it needs optimized.
Sandman!
Honored Contributor

Re: script which contains the f90 command with options

Roxana,

Take a look at this website...its extremely useful resource for beginners to shell scripting.


http://www.shelldorado.com


hope it helps :)
Roxana_4
Frequent Advisor

Re: script which contains the f90 command with options

I used "alias" . For the time being.