gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1619 Posts in 535 Topics by 781 Members - Latest Member: chekyl43 January 27, 2023, 04:23:31 PM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  Macintosh  |  Pro Fortran 9.2 - bad magic number (not a Mach-O file)
gfx
gfxgfx
 

Author Topic: Pro Fortran 9.2 - bad magic number (not a Mach-O file)  (Read 7186 times)

TocNET

  • Newbie
  • *
  • Posts: 3
Pro Fortran 9.2 - bad magic number (not a Mach-O file)
« on: March 04, 2008, 08:20:22 PM »
Hi,

My machine is:
  Machine Name:   Power Mac G5 Quad
  Number Of CPUs:   4
  CPU Speed:   2.5 GHz
  Memory:   16 GB
  System Version:   Mac OS X 10.4.11 (8S165)
  Kernel Version:   Darwin 8.11.0
 
I'm using the Pro Fortran 9.2 for compile the software called GAMESS [http://www.msg.ameslab.gov/GAMESS/]
The scripts for compilation of GAMESS don't consider the ABSOFT compiler. So I need make some changes.

My problem is when I try linker the program the message [/usr/bin/ld: gamess.o bad magic number (not a Mach-O file)] appear for all objects  compiled with absoft compiler.

My most change in comp script is:

if ($TARGET == macG5) then
   set OPT = '-O3'
   if ($MODULE == guess)  set OPT='-O0'
   if ($MODULE == morokm) set OPT='-O0'
   if ($MODULE == prpel)  set OPT='-O1'
   if ($MODULE == tdxitr) set OPT='-O1'
   if ($MODULE == zheev)  set OPT='-O0'
   set echo
       f95 -c -i8 -v -altivec -blas=altivec -m64 -cpu:g5 -cons -B19 $OPT $MODULE.f
   unset echo
endif

And in lked script

if ($TARGET == macG5) then
   set LDR='gcc'
   set LDOPTS='-Wl,-multiply_defined -Wl,suppress' # add '-Wl,-M' for load map
   if (-e /sw/lib/libatlas.a) then
      set LIBRARIES='-L/sw/lib -lf77blas -latlas'  # Atlas
   else
      set LIBRARIES='-Wl,-framework -Wl,vecLib'    # Apple's BLAS library
   endif
   set BLAS=' '
   set VECTOR=' '
   set QUICHE='zunix.o'
endif

The error message is:

GAMESS will be linked into the executable image gamess.00.x.
chdir object
gcc -o ../gamess.00.x -Wl,-multiply_defined -Wl,suppress gamess.o unport.o zunix.o aldeci.o algnci.o [....] qmmm.o vbdum.o neostb.o ../ddi/libddi.a -lpthread -Wl,-framework -Wl,vecLib
/usr/bin/ld: gamess.o bad magic number (not a Mach-O file)
/usr/bin/ld: unport.o bad magic number (not a Mach-O file)
.
.
.

I search for some orientation on NET but nothing helpful in this problem.
I appreciate so much some orientation for fix this problem.

Thanks.
Thiago...



Mike Linacre

  • Sr. Member
  • ****
  • Posts: 259
Re: Pro Fortran 9.2 - bad magic number (not a Mach-O file)
« Reply #1 on: March 04, 2008, 08:55:27 PM »
Looks like your Mac is confused about file types. Try changing all the Absoft suffixes to something not known by your other software.

TocNET

  • Newbie
  • *
  • Posts: 3
Re: Pro Fortran 9.2 - bad magic number (not a Mach-O file)
« Reply #2 on: March 05, 2008, 08:29:18 PM »
So,

Today I try another approach

recompile the program using this syntax
f95 -c -m64 $MODULE.f

Resulting
/usr/bin/ld: gamess.o bad magic number (not a Mach-O file)
For all objects

SO....

Try recompile without -m64 and the link accept the objects..
Received a lot off messages of symbols not found but this is another problem

.
.
.
umpddi.o vibanl.o vscf.o vvos.o zapddi.o zheev.o zmatrx.o qmmm.o vbdum.o neostb.o ../ddi/libddi.a -lpthread -Wl,-framework -Wl,vecLib
/usr/bin/ld: Undefined symbols:
_DDI_BCAST
_DDI_LEVEL
_DDI_NNODE
__STOP
___A_FRF
___A_FWF
___setup_fpu
__absoft_cvtlld
__absoft_ldiv
__absoft_lmod
__absoft_lmul
_ABORT
_DDI_NPROC
.
.
.

Why when try use the compiler for generate the code in 64Bits I received this ERROR?




TocNET

  • Newbie
  • *
  • Posts: 3
Re: Pro Fortran 9.2 - bad magic number (not a Mach-O file)
« Reply #3 on: March 06, 2008, 06:19:48 PM »
Good News. The Xcode 2.5 solve the problem with -m64. Just upgrade version.

BUT the solution of a problem generate a new problem. See:

gcc -o ../gamess.00.x -Wl,-multiply_defined -Wl,suppress gamess.o unport.o zunix.o .... qmmm.o vbdum.o neostb.o ../ddi/libddi.a -lpthread -Wl,-framework -Wl,vecLib
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status

What I do with this _main? I search a lot on NET but nothing help. The better than I read is that _main is missing LOL!!

Please, I appreciate much the help of support.
Thanks.
Thiago.



Absoft User Forum  |  Support  |  Macintosh  |  Pro Fortran 9.2 - bad magic number (not a Mach-O file)
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!