how to compile rpm package in shell
I tried to compile fortran g77 in shell but I couldnt. I folowed the procedure and typed
$ g77 source.for and the answer was bash: $: command not found I don't understand why shell didn't recognize this symbol, $ Perhaps I made a mistake in installation procedure... Firstly, I made a file named source in home directoy and copied compat-g77 and gcc-fortran rpm packages into. Secondly, i installed these rpm packages with yast, and finally checked them... As I undersood the last step shoul be to compile g77 in shell...?! But I have problem with that, and I need a step by step procedure |
What exactly are you trying to do? Are you trying to literally compile g77 from source, or are you trying to compile a Fortran 77 program using g77? If the latter, then you just need to enter "g77 source.for" if your source code is in source.for. When you see a "$", that's just indicating the prompt, so you don't need to type it.
|
I don't think you need to use $. Where did you find the procedure?
|
I tried to type g77 source.for(without $), but the answer was the same
g77: source.for: no such file or directory Perhaps my source code is not in source.for. Where I made a mistake? What can I do now? |
Do you have a Fortran program in a file called source.for? If so, make sure that you are in the same directory as the source.for file when you try to compile the program. You can use cd to change directories, pwd to tell you what directory you arein, and ls to list the contents of the directory.
|
Surely you should know which file your code is in :confused:.
|
Quote:
Quote:
Code:
allan@linux-c4ug:~> |
Stop typing in the "$" before the command. That doesn't make sense. Sometimes it is posted just to show the prompt.
Make sure that you are in the directory with the fortran program, or include the path with the file. I still can't get what you are trying to do. You mentioned downloading fortran rpms. Are you trying to install fortran, and what where the (full) names of the rpm packages. If the package ends in .src.rpm, then this is a source rpm, which you would use the rpmbuild command to install, or create a binary rpm file. If you want to install fortran from a binary rpm package, you would use the "rpm -Uhv <package-file>" command, or better yet use YaST to install it from cd/dvd or the net. What is with the "source.for" file? That has nothing to do with rpm. --- Check if the fortran packages are installed: rpm -qi gcc-fortran for example. My SuSE version doesn't have a a g77-compat package. Does "which g77" return anything. How about "which gfortran" or "which gfortran-4.2" |
Check if the fortran packages are installed:
rpm -qi gcc-fortran for example. I checked, it's installed, and Source RMP is gcc-4.0.2_20050901-3.src.rpm When I typed g77 source.for the answer was /usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../libfrtbegin.a(frtbegin.o): In function `main':http://linuxquestions.cachefly.net/i...s_lq/icon5.gif : undefined reference to `MAIN__' |
Quote:
Anyway, as jschiwal already pointed out, it is not clear what you're trying to accomplish. In order to get some good advice to solve your issue, you should try to elaborate your question a little more. |
I will try to be clear.
I have to install fortran 77...! As I understood I should download two rpm packages compat-g77 and gcc-fortran and installed them with yast. Final step would be compile fortran in shell. Perhaps this isn't correct procedure...? I don't know how to run fortran 77...! (Source.for is file I created by myself in home directory. I copied rpm packages into source.for.) |
You don't need to compile fortran if you already have it installed. if you have fortran77 installed
|
Ok, thanks. The Yast software manager let you to select packages you want to install, then:
1. it takes care of all the dependencies (that is it automatically selects extra required packages), 2. downloads all the selected packages, 3. installs them 4. update the system configuration and caches. So if you have a working internet connection and you properly configured the software repositories, you don't have to worry about manually downloading packages or compiling from source. Just select the software you want to install and after a bunch of minutes you have a working fortran 77 compiler at hand. At this point it looks like you have already installed the downloaded packages. To be sure, simply issue the command Code:
rpm -q gcc-fortran compat-g77 Quote:
Code:
gfortran my_program.f If you want I can give you a hand to correctly set-up the packages repositories in Yast, since it seems the starting point of the whole issue. |
I typed rpm -q gcc-fortran compat-g77 and I got this
gcc-fortran-4.0.2_20050901-3 compat-g77-3.3.5-2 When I typed gcc-fortran my_program.f I got bash: gcc-fortran: command not found Yes, I need a hand to correctly set-up the packages repositories in yast |
the correct command is gfortran not gcc-fortran
|
All times are GMT -5. The time now is 07:49 PM. |