| View previous topic :: View next topic |
| Author |
Message |
goethe
Joined: 25 Jul 2012 Posts: 4
|
Posted: Wed Jul 25, 2012 7:48 am Post subject: migratio f90 -> pgf90 : file format not recognized |
|
|
Hello.
Doing a migration from f90 (sun) to pgf90 (linux) i have the following error:
| Code: | /usr/bin/ld:OBJ/My_module_XX: file format not recognized; treating as linker script
/usr/bin/ld:OBJ/My_module_XX.o:1: syntax error
*** Error code 2
clearmake: Error: Build script failed for "PROGNAME" |
On the makefile:
| Code: | (...)
$(DBIN): $(XXMODULE)
$(F90) $(XXMODULE) -o $@ $(OBJCOM) $(DLDFLAGS) |
When make file is "launched", i have:
| Code: | | pgf90 XXXX1.o XXXX2.o (...) -o PROGNAME AFILE.o AFILE2.o ALIB.a |
Would you havec any idea about this problem ??
Thanks a lot for your help !! |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Wed Jul 25, 2012 9:44 am Post subject: |
|
|
Hi goethe,
The problem here is that the linker doesn't know what type of file your objects are. My best guess is that you have an error in compile options which is causing a different type of file to be created, such as "-S" to create an assembly file. Do you have an example of the compile line for "My_module_XX.o"?
- Mat |
|
| Back to top |
|
 |
goethe
Joined: 25 Jul 2012 Posts: 4
|
Posted: Thu Jul 26, 2012 2:08 am Post subject: |
|
|
Hi, and thanks a lot for your help !
Compile options should be th key point (i haven't found how to "translate" F90 option to pgf90..)
Here are the line:
| Code: | F90FLAGS = -i4 -r8 -Mcpp -C -IINC -IOBJ -LOBJ
$(DIROBJ)/%.o: %.F90
pgf90 $(F90FLAGS) -c $< -o $@ |
goethe. |
|
| Back to top |
|
 |
TheMatt
Joined: 06 Jul 2009 Posts: 263 Location: Greenbelt, MD
|
Posted: Thu Jul 26, 2012 4:52 am Post subject: |
|
|
| goethe wrote: | Hi, and thanks a lot for your help !
Compile options should be th key point (i haven't found how to "translate" F90 option to pgf90..)
Here are the line:
| Code: | F90FLAGS = -i4 -r8 -Mcpp -C -IINC -IOBJ -LOBJ
$(DIROBJ)/%.o: %.F90
pgf90 $(F90FLAGS) -c $< -o $@ |
|
One possible issue is using "$<". That can only be used in suffix rules, at least in GNU Make (not sure about clearmake). For a % rule in gmake, I use "$^". May not solve the underlying issue, though. |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Thu Jul 26, 2012 9:48 am Post subject: |
|
|
The problem is the "-Mcpp" flag which just pre-processes the file using cpp but does not compile it. Remove this flag or change it to "-Mpreprocess" (though .F90 files are preprocessed by default).
Hope this helps,
Mat
| Code: |
% pgf90 -help -Mcpp
-Mcpp[=m|md|mm|mmd|line|[no]comment|suffix:<suff>|<suff>|include:<file>|c89|c99]
Just preprocess the input files
m Print makefile dependencies
md Print makefile dependencies to .d file
mm Print makefile dependencies; ignore system includes
mmd Print makefile dependencies to .d file; ignore system includes
line Insert line numbers into preprocess output
[no]comment Keep comments in preprocessed output
suffix:<suff> Suffix to use for makefile dependencies
<suff> Suffix to use for makefile dependencies
include:<file> Include file before processing source file
c89 Use the C89 language
c99 Use the C99 language |
|
|
| Back to top |
|
 |
|