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, 03:37:40 PM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  Macintosh  |  Compile on Intel, run on PPC
gfx
gfxgfx
 

Author Topic: Compile on Intel, run on PPC  (Read 5911 times)

mankoff

  • Newbie
  • *
  • Posts: 9
Compile on Intel, run on PPC
« on: March 14, 2008, 05:20:49 PM »
I'm trying to get a simple hello world compiled on an intel box to run on PPC. The dev machine is OS X 10.5 Intel and Absoft 9.2. The dev machine is 10.4 and PPC. I get bus errors, even with a simple 'hello world'. I've followed the instructions here:
http://www.absoft.com/Support/FAQ/macosx92faqupdated.html#anchor0084

Any advice on what I'm doing wrong will be much appreciated.

Thanks,

   -k.

Code in helloworld.f:
Code: [Select]
C     Hello World in Fortran

      PROGRAM HELLO
      WRITE (*,100)
      STOP
 100   FORMAT (' Hello World! ' /)
      END

Makefile:
Code: [Select]
F77COMPILER = f77
LINKER =    c++ -arch ppc
F77_FLAGS =    -O2 -c -T 100000 -s -f -q -cpu:g4 -N11
LIBS = -lU77 -lV77 -L"$(ABSOFT)/lib" -lf90math -lfio -lf77math -lm
LNK_FLAGS = -Xlinker -w -Xlinker -Y -Xlinker 10 # Absoft

SRCS = helloworld.f
OBJS = $(SRCS:.f=.o)

%.o: %.f
        $(F77COMPILER) -o $@ $(F77_FLAGS) $<

hello: $(OBJS)
        $(LINKER) $(LPATHS) $(OBJS) $(LNK_FLAGS) $(LIBS) -o hello

And my environment w.r.t. Absoft:
Code: [Select]
ABSOFT_LINKER=c++ -arch ppc
ABSOFT_AS=as -arch ppc
ABSOFT=/Users/mankoff/local/Applications/Absoft.ppc
COMPILER=Absoft

Jeremy

  • Guest
Re: Compile on Intel, run on PPC
« Reply #1 on: March 17, 2008, 02:26:36 PM »
For Absoft Pro Fortran v9.2 and Absoft Pro Fortran v10.0 you can add some environment variables and you can compile programs on Leopard and run those same executables on Tiger.

This works for command line compilations on Intel systems running
Leopard with XCode 3.0 installed.

Add the following lines to .bash_profile

For v9.2 of Absoft Pro Fortran:
export ABSOFT_AS="as -arch ppc"
export SDK=/Developer/SDKs/MacOSX10.4.0.sdk
export MACOSX_DEPLOYMENT_TARGET=10.4
export ABSOFT_LINKER="c++ -isysroot ${SDK} -Wl,-syslibroot,${SDK} -arch ppc"

For v10.0 of Absoft Pro Fortran:
export MACOSX_DEPLOYMENT_TARGET=10.4
export SDK=/Developer/SDKs/MacOSX10.4u.sdk
export ABSOFT10_LINKER="c++ -isysroot ${SDK} -Wl,-syslibroot,${SDK}"
export ABSOFT10_LINKER32="c++ -isysroot ${SDK} -Wl,-syslibroot,${SDK}"

After relaunching Terminal.app, all Fortran command line compilations
will produce Tiger compatible applications.

For further information, please see:

http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development/index.html

Absoft User Forum  |  Support  |  Macintosh  |  Compile on Intel, run on PPC
 

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