Guest Ritge Posted September 8, 2004 Report Share Posted September 8, 2004 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 :)] Quote Link to comment Share on other sites More sharing options...
Qchem Posted September 8, 2004 Report Share Posted September 8, 2004 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 Quote Link to comment Share on other sites More sharing options...
Gowator Posted September 8, 2004 Report Share Posted September 8, 2004 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... Quote Link to comment Share on other sites More sharing options...
thinkliberty Posted September 8, 2004 Report Share Posted September 8, 2004 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 <{POST_SNAPBACK}> Shouldn't that be /usr/bin/g++ As he wants to use c++ and not c Quote Link to comment Share on other sites More sharing options...
Qchem Posted September 8, 2004 Report Share Posted September 8, 2004 gcc does cpp as well as c, I'm not aware that you usually have to specify which to use. Quote Link to comment Share on other sites More sharing options...
thinkliberty Posted September 9, 2004 Report Share Posted September 9, 2004 GCC should know, but it depends on how it is set up. In 10.0 gcc did not compile c++ (qt) code I had to specify g++ to get it to compile. Quote Link to comment Share on other sites More sharing options...
Qchem Posted September 9, 2004 Report Share Posted September 9, 2004 I think for simplicity we could just advise to change /usr/lib/cpp to simply cpp (it'll be in the path) and that way we can bypass any silliness on gcc's behalf. ;) Quote Link to comment Share on other sites More sharing options...
Guest Ritge Posted September 15, 2004 Report Share Posted September 15, 2004 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 Quote Link to comment Share on other sites More sharing options...
Guest Ritge Posted September 16, 2004 Report Share Posted September 16, 2004 Hi, 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.