For Programmers: Free Programming Magazines  


Home > Archive > Fortran > December 2005 > makefile from linux lahey fortran to intel visual fortran on windows









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author makefile from linux lahey fortran to intel visual fortran on windows
bonsoir2006@hotmail.com

2005-12-05, 7:04 pm

Hello!

I am new with programming in fortran and I need some help with
compiling.

I have this program that uses a makefile for linux lahey fortran, and I
want to make the program run on intel visual fortran. The program uses
modules (which replace common blocks in fortran 77), and I don't know
how to port the makefile. The makefile for linux lahey fortran looks
like

EXECUTABLE: main.o subroutine1.o subroutine2.o module.o

lf95 -o EXECUTABLE main.o subroutine1.o subroutine2.o module.o

main.o: main.f90 module.o makefile
lf95 -c main.f90

subroutine1.o: subroutine1.f90 module.o makefile
lf95 -c subroutine1.f90

subroutine2.o: subroutine2.f90 module.o makefile
lf95 -c subroutine1.f90

module.o: module.f90 makefile
lf95 -c module.f90

I changed the .o for .obj, the -o by /o, the -c by /c, the lf95 by
ifort, name the makefile makefile.mak, and use the nmake command to
call it,
but it is not working. as I said, I'm really new in programming.

Can somebody help me with that?

The error says:
makefile.mak(18) : fatal error U1033: syntax error : 'ifort' unexpected
Stop.
and I suspect that there will be more errors... any suggestions? maybe
I'm in the wrong track?

Thank you!

Robert

AM

2005-12-05, 7:04 pm

Your best bet will be to use the Visual Fortran (IDE). Since you say
visual fortran - i am assuming that you know how to start a new
project. Add all the f90 files are dependencies in the project and hit
Build.

It's been a while since i used that platform - but i think i am on the
right track.

-Ash

bonsoir2006@hotmail.com

2005-12-06, 7:57 am

Hei Ash,

Thanks a lot for your answer.

I have indeed visual fortran. However, I have this version only because
it is one of the versions that can work on Windows. I would really
prefer only to work from the command line prompt with a makefile. I
have been able to compile with my makefile on a Unix machine by logging
remote, but I would like to have a version of fortran that I coud use
locally on my computer. Installing linux on my computer and then a
version of fortran for linux could be an option, and another that I am
trying now is to use intel visual fortran on Windows using the command
line prompt.

I have tried the visual interface a little and have gotten not too big
a success...

Would you have some tips on how to use a makefile to be able to use
only the command line prompt with intel visual fortran on Windows?

Thank you very much,

Robert


AM skrev:
> Your best bet will be to use the Visual Fortran (IDE). Since you say
> visual fortran - i am assuming that you know how to start a new
> project. Add all the f90 files are dependencies in the project and hit
> Build.
>
> It's been a while since i used that platform - but i think i am on the
> right track.
>
> -Ash


Jugoslav Dujic

2005-12-06, 7:57 am

bonsoir2006@hotmail.com wrote:
| Hei Ash,
|
| Thanks a lot for your answer.
|
| I have indeed visual fortran. However, I have this version only because
| it is one of the versions that can work on Windows. I would really
| prefer only to work from the command line prompt with a makefile. I
| have been able to compile with my makefile on a Unix machine by logging
| remote, but I would like to have a version of fortran that I coud use
| locally on my computer. Installing linux on my computer and then a
| version of fortran for linux could be an option, and another that I am
| trying now is to use intel visual fortran on Windows using the command
| line prompt.
|
| I have tried the visual interface a little and have gotten not too big
| a success...
|
| Would you have some tips on how to use a makefile to be able to use
| only the command line prompt with intel visual fortran on Windows?

Is it Microsoft NMAKE (the one that ships with Visual Studio) or
some other flavor? MSDN-ing... yes; U1033 is NMAKE's error message.

I attached a modified makefile which works with NMAKE. First, you had
missing tabs before build command (maybe they were erased in posting?).
Second, ifort AFAIK cannot be made to produce object files with extension
..o (not that I looked at documentation too deeply).

We use lots of make macros to achieve portability; here's an excerpt
from a bigger makefile which builds (lib)dmsapp.so/dll on
Compaq F90 on Tru64 unix, CVF on Windows and ifort on Fedora
(the latter two commented out):

# TRU64 -------------------------------------------

SEP=/
BINDIR=$(DMS_PATH)/lib

DMSAPP=libdmsapp

LINK32=ld
LINK32_FLAGS= -o
$(BINDIR)$(SEP)$(DMSAPP).$(DLL) -shared -lfor -lm -lc -lUfor -lFutil -lots

RM=rm -rf

# FEDORA ----------------------------------------------
#F90=ifort
#F90_PROJ=-c -O0 -automatic -check bounds -check
format -DTA -DLF -DPI -DMINIMAL -DSPACE_32 -I$(INTDIR) -nologo -module
$(INTDIR) -o $*.$(OBJ)

#OBJ=o
#DLL=so
#SEP=/
#BINDIR=$(SEP)usr$(SEP)share$(SEP)DMS$(S
EP)bin

#DMSAPP=libdmsapp

#LINK32=ld
#LINK32_FLAGS= -o $(BINDIR)$(SEP)$(DMSAPP).$(DLL) -shared

#RM=rm -rf

# WINDOWS -------------------------------------------
#F90=f90
#F90_PROJ=/c /debug /automatic /check:bounds /check:format /DTA /DLF /DPI
/DMINIMAL /DSPACE_32 /I$(INTDIR) /nologo /module:$(INTDIR) /object:$*.$(OBJ)

#OBJ=obj
#DLL=dll
#SEP=\\
#BINDIR=..$(SEP)..$(SEP)..$(SEP)..$(SEP)bin

#DMSAPP=dmsapp

#LINK32=link
#LINK32_FLAGS= /out:$(BINDIR)$(SEP)$(DMSAPP).$(DLL) /dll

#RM=del

....
SRCDIR=..$(SEP)..$(SEP)

OBJDIR=.$(SEP)objs

INTDIR=$(OBJDIR)$(SEP)

MOD=mod

MSG_F90 = echo "Compiling Fortran ($@)"
MSG_LD = echo "Linking ($@)..."
....
#LINK OBJS=================================
LINK32_OBJS= \
$(INTDIR)e_enum.$(OBJ) \
$(INTDIR)e_output.$(OBJ) \

#LINK COMMAND===============================
$(BINDIR)$(SEP)$(DMSAPP).$(DLL): $(LINK32_OBJS) $(BINDIR) $(OBJDIR)
@ $(MSG_LD)
@ $(LINK32) $(LINK32_FLAGS) $(LINK32_OBJS)

#BUILD RULES===============================
$(INTDIR)e_enum.$(MOD) : $(INTDIR)e_enum.$(OBJ)

$(INTDIR)e_output.$(OBJ) : $(SRCDIR)e_output.f90 $(INTDIR)m_dmsapp.$(MOD)
@ $(MSG_F90)
@ $(F90) $(F90_PROJ) $(SRCDIR)e_output.f90


--
Jugoslav
___________
www.xeffort.com

Please reply to the newsgroup.
You can find my real e-mail on my home page above.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com