Results 1 to 6 of 6
Hello everyone, as you may have guessed from the title, I am currently attempting to compile a program via a makefile.
The makefile does not contain a specific target for ...
- 01-19-2010 #1Just Joined!
- Join Date
- Jan 2010
- Posts
- 2
Please Help me with this makefile problem.
Hello everyone, as you may have guessed from the title, I am currently attempting to compile a program via a makefile.
The makefile does not contain a specific target for my computer, so I must construct my own.
Now, I am sure this will all be very simple for you, but unfortunatley, when it comes to filling in the blanks, I draw a blank, I have looked through my files to try and find my compiler ( I use fedora, I believe it comes packaged with G95) , which I have so far failed to do. I also, do not know what flags I should add to it. Also, I had never heard of a linker/loader before, I have since researched it, but am no closer to finding out where this would be (some sources imply my compiler and linker may be the same entity, or at least when I compile, the linking happens at automatically), or what flags to associate with it.Code:# Generic target template #===================================================================== uknown_platform: $(MAKE) LD="path to Fortran 90 Linker-loaDer" \ LDFLAGS="appropriate flags for LD" \ FC="path to Fortran 90 compiler" \ FCFLAGS="appropriate flags for FC" \ EX=$(EX) BINROOT=$(BINROOT) $(TYPE)
I have looked at several several articles about makefiles, but can not yet find the information I am after, if someone could point me to where I would find the paths and flags I need, I would be most appreciative.
The program is DL_POLY 3.09 and I am using fedora 2, desktop edition
Thanks in advance, Sean.
Edit: oh yes, I am using a core i7 920 intel CPU, while I know compiling programs can need this information, It does not seem to be mentioned in this makefile.
- 01-20-2010 #2
It's not bloody simple.
This seems a very technical thing. Is this any use? DL_Poly 3.09Code:lugo@fido:~$ apropos linker ld (1) - The GNU linker ld-linux (8) - dynamic linker/loader ld-linux.so (8) - dynamic linker/loader ld.so (8) - dynamic linker/loader ld86 (1) - Linker for as86(1) ldconfig (8) - configure dynamic linker run-time bindings lugo@fido:~$
- 01-20-2010 #3
The linker/loader is the program that takes the blocks of machine code created by the compiler and those in the libraries referenced, and links them all together into a single executable program. The Linux loader is called ld. The GNU compiler gcc invokes ld automatically (unless you tell it not to), and I assume G95 does too, which is why you weren't aware of there being a separate program.
The main LD FLAGS you need are the paths to any libraries you are using that aren't in the obvious places.
Makefiles can be very complicated. Most people use autoconf and automake rather than writing their own."I'm just a little old lady; don't try to dazzle me with jargon!"
- 01-20-2010 #4Just Joined!
- Join Date
- Jan 2010
- Posts
- 2
Thank you very much for the replies so far.
Do you know where I could find G95, so I can then put down the path for it? Would installing it myself and then pathing to wherever I installed it be an acceptable solution? If the compiler automatically invokes the loader, Can I just link to the compiler again when it asks for the loader?
The thing is, when using the makefile, it demands inputs of these entries, so I would need to find where on earth they are in the OS installation, which is my main stumbling block.
I can see why people would try and have a program do the hard work for them, I will certainly look into those
Thank you again for your help.
- 01-21-2010 #5might give the path the makefile is after. Assuming, of course, gfortran 95 or whatever it is called has been installed.Code:
locate fortran|grep bin
There isn't a 'configure' file anywhere in the thing is there? The relatively friendly thing is usually for that program to make the makefile for you.
- 01-21-2010 #6
You can quckly find the path to any command by typing which command_name at a terminal.
You only have to install it if you haven't already got it.Would installing it myself and then pathing to wherever I installed it be an acceptable solution?
No. The compiler will use this data to find the loader, so you do have to tell it where the loader is.If the compiler automatically invokes the loader, Can I just link to the compiler again when it asks for the loader?
If I were you, I would go no further without reading up on how to build software on Linux as you are obviously floundering. You could start with this Wikipedia article."I'm just a little old lady; don't try to dazzle me with jargon!"


Reply With Quote
