Find the answer to your Linux question:
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 ...
  1. #1
    Just 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.
    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)
    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.

    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.

  2. #2
    Linux Newbie lugoteehalt's Avatar
    Join Date
    Jan 2004
    Posts
    231
    It's not bloody simple.
    Code:
    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:~$
    This seems a very technical thing. Is this any use? DL_Poly 3.09
    All power is violence; all power is evil.
    Money As Debt

  3. #3
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    Quote Originally Posted by Molecule View Post

    The makefile does not contain a specific target for my computer, so I must construct my own.
    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)
    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.
    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!"

  4. #4
    Just 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.

  5. #5
    Linux Newbie lugoteehalt's Avatar
    Join Date
    Jan 2004
    Posts
    231
    Code:
    locate fortran|grep bin
    might give the path the makefile is after. Assuming, of course, gfortran 95 or whatever it is called has been installed.

    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.
    All power is violence; all power is evil.
    Money As Debt

  6. #6
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    Quote Originally Posted by Molecule View Post
    Do you know where I could find G95, so I can then put down the path for it?
    You can quckly find the path to any command by typing which command_name at a terminal.
    Would installing it myself and then pathing to wherever I installed it be an acceptable solution?
    You only have to install it if you haven't already got it.
    If the compiler automatically invokes the loader, Can I just link to the compiler again when it asks for the loader?
    No. The compiler will use this data to find the loader, so you do have to tell it where the loader is.

    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!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...