|
[Sponsors] |
September 22, 2007, 05:02 |
Makefile for f90 under unix
|
#1 |
Guest
Posts: n/a
|
I am running fortran codes on Linux/UNIX system. On Linux, the intel fortran, ifort is installed. My makefile worked well in that system. To run them on UNIX having f90, I modified the makefile as
---------------------------------------------------------- # 1. Fortran compiler FC = f90 OPTS = -O3 # 2. DEFINE DIRECTIONS SRCDIR = . OBJDIR = . PROG = main # 5. DEFINE OBJECT FILES OBJS = \ analytic.o \ ................ # 6. DEFINE OBJECT FILES DEPENDENCIES SOURCE = ${SRCDIR}/analytic.f90 ${OBJDIR}/analytic.o:$(SOURCE) ${OBJDIR} ${FC} ${OPTS} -c -module ${OBJDIR} $< -o $@ ............... ------------------------------------------------------- It does not work with this message --> don't know how to make /, (bu42). I am pretty new to run fortran codes on UNIX. Please let me know how to run these codes on UNIX. I did it on Linux having ifort. But i could not run them on UNIX having f90. |
|
September 22, 2007, 06:10 |
Re: Makefile for f90 under unix
|
#2 |
Guest
Posts: n/a
|
I accomplished compiling of a single file even though I typed make all. Please see my makefile. --------------------------------------------------------- # 1. DEFINE COMPILER FC = f90 OPTS = -n32
# 2. DEFINE DIRECTIONS SRCDIR = . OBJDIR = . PROG = main # 3. DEFINE OBJECT FILES OBJS = \ analytic.o \ boundary.o \ compute_flux.o \ main.o \ # 4. DEFINE OBJECT FILES DEPENDENCIES SOURCE = ${SRCDIR}/analytic.f90 ${OBJDIR}/analytic.o:$(SOURCE) ${OBJDIR} ${FC} ${OPTS} -c ${OBJDIR} $< -o $@ SOURCE = ${SRCDIR}/boundary.f90 ${OBJDIR}/boundary.o:$(SOURCE) ${OBJDIR} ${FC} ${OPTS} -c ${OBJDIR} $< -o $@ SOURCE = ${SRCDIR}/compute_flux.f90 ${OBJDIR}/compute_flux.o:$(SOURCE) ${OBJDIR} ${FC} ${OPTS} -c -module ${OBJDIR} $< -o $@ SOURCE = ${SRCDIR}/main.f90 ${OBJDIR}/main.o : $(SOURCE) ${OBJDIR} ${FC} ${OPTS} -c -module ${OBJDIR} $< -o $@ # 5. LINK OBJECT FILES (*.o) ${PROG}: ${addprefix ${OBJDIR}/, ${OBJS}} ${FC} ${OPTS} $^ -o $@ echo ${PROG} : make complete # 6. CLEAN OBJECT FILES (*.o) and EXE rm -r *.o echo clean : make complete w/o error # 7. DEFINE ALL TARGET #all: ${PROG} # END OF MAKEFILE ----------------------------------------------------------- Please help me. I have to finish a simulation in this weekend. Thanks in advance. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Linux vs commercial Unix for workstations | wenp | Hardware | 6 | May 18, 2011 09:46 |
Background execution on UNIX systems | law | FLUENT | 1 | January 3, 2006 11:53 |
memory problems with a code on unix | vince | Main CFD Forum | 2 | November 5, 2002 04:48 |
compaq tru-64 unix? | lgpatil | FLUENT | 0 | October 21, 2002 15:03 |
Fluent on UNIX or WinNT | mike | FLUENT | 1 | May 30, 2001 13:00 |