Jump to content

Adapt Script In Unix Format To Linux


Guest Ritge
 Share

Recommended Posts

:help:

Hi,

I have got an script of compilation in UNIX that I will to traduce to LINUX in order to make the compilation in one PC with LINUX Mandrake 10.0 . I tried but it not runs. Can you help me please?

(Is a short script and at the end there is one line that calls to the compilator f77 but I use the g77 where something changes). Thank you very much.

Here are the SCRIPT:

 

set -x
#
src=$HOME/nt12
indata=$HOME/ogcm431/indata
outdata=$HOME/ogcm431/outdata
forcing=$HOME/ogcm431/forcing/yr1980
clouds=$HOME/ogcm431/forcing/clouds
#
#-----Bring the input files into the Cray via FTP-----
#-----compile the code-----
#
opt1='-Dskipland -Dislands -Drigidlid -Doldrelax -Dconstvmix -Drestorst -Ddprec -Dcray'
opt2='-Dbiharmonic -Ddiskless -Dimga -Dqb4 -Dceh3 -Daver -Dbiotop1 -Dnewlight'
#
#echo 'precessing with cpp...'
cd $src
cat *.[Ff] > output.a # make one big file
# apply "ifdefs"
/usr/lib/cpp -P $opt1 $opt2 output.a output.0 
/bin/rm output.a
fsplit output.0 # break into *.f files
/bin/rm output.0 # remove output.0
echo 'compiling MOM ...'
f77 -O2 -r8 -o nt12r8 *.f
/bin/rm *.o
/bin/rm *.f
mv nt12r8 /tmp/run60
#
echo done

 

[moved from Software by spinynorman - welcome aboard :)]

Link to comment
Share on other sites

Do you have an actual error message or does it not run at all? Seeing as though you run it on some form of UNIX you'll probably have made the script executable?

 

One problem I can spot is that cpp is probably not is /usr/lib, more likely /usr/bin.

 

I'm not sure if fsplit is common in Linux either, try using split instead.

 

 

HTH

Link to comment
Share on other sites

yep but the easiest is just maybe create a link from

/usr/lib/cpp to /bin/gcc (im at work but I think gcc is in /bin)

 

ln -s /usr/lib/cpp /bin/gcc

 

then let it run, I dont know if the compiler options are the same ... but like Qchem says you need to run it and get the error messages...

Link to comment
Share on other sites

Hi,

The messages after the run are (all the directories are created and I have all the needed programs and archives but the messages are the same):

 

processing with cpp...

 

: No such file or directory/rgonzalez/ECHYM/nt12

 

: No such file or directory

 

apply "ifdefs"

 

cpp: too many input files

 

/bin/rm: unable to erase «output.a\r»: No such file or directory

 

split: output.0: No such file or directory

 

/bin/rm: unable to erase «output.0»: No such file or directory

 

/bin/rm: unable to erase «\r»: No such file or directory

 

compiling MOM ...

 

: No such file or directory

 

mv: unable to make `stat' on «nt12r8»: No such file or directory

 

done

-------------------

 

Thanks a lot!!!

Ritge

Link to comment
Share on other sites

Hi,

:wall:

I have change the cpp calls by the gcc calls and these are the messages

(all the directories & needed archives are created):

 

processing with cpp...

: No such file or directory

: No such file or directory

apply "ifdefs"

gcc: output.0: No such file or directory

: No such file or directory

/bin/rm: unable to erase «output.a\r»: No such file or directory

split: output.0: No such file or directory

/bin/rm: unable to erase «output.0»: No such file or directory

/bin/rm: unable to erase «\r»: No such file or directory

compiling ...

: No such file or directory

mv: unable to make `stat' on «nt12r8»: No such file or directory

done

 

Thank you very much,

Ritge

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...