makefile from linux lahey fortran to intel visual fortran on windows 
Author Message
 makefile from linux lahey fortran to intel visual fortran on windows

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



Sat, 24 May 2008 06:09:41 GMT  
 makefile from linux lahey fortran to intel visual fortran on windows
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



Sat, 24 May 2008 07:39:55 GMT  
 makefile from linux lahey fortran to intel visual fortran on windows
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:

Quote:
> 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



Sat, 24 May 2008 18:03:31 GMT  
 makefile from linux lahey fortran to intel visual fortran on windows

| 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$(SEP)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



...
#LINK OBJS=================================
LINK32_OBJS= \
 $(INTDIR)e_enum.$(OBJ) \
 $(INTDIR)e_output.$(OBJ) \

#LINK COMMAND===============================
$(BINDIR)$(SEP)$(DMSAPP).$(DLL): $(LINK32_OBJS) $(BINDIR) $(OBJDIR)


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

$(INTDIR)e_output.$(OBJ) : $(SRCDIR)e_output.f90 $(INTDIR)m_dmsapp.$(MOD)


--
 Jugoslav
___________
www.xeffort.com

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

  Makefile.mak
< 1K Download

  module.F90
< 1K Download

  subroutine1.F90
< 1K Download

  subroutine2.F90
< 1K Download

  main.F90
< 1K Download


Sat, 24 May 2008 19:28:03 GMT  
 makefile from linux lahey fortran to intel visual fortran on windows
Quote:

> 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?

As gnu make is available in so many flavors, including mingw and cygwin,
I don't find the choice so difficult.  Perhaps the most difficult choice
is between .o and .obj files.  For the latter, you would need a
.SUFFIXES rule, including .obj as well as .exe.  It gets somewhat ugly
then, when you set up to handle both .o and .obj files.
You don't mention whether you are using a 64-bit compiler, which may
bring in complications with the addition of /amd64 tags when building
libraries and linking.


Sat, 24 May 2008 22:13:23 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Building DLLs with Compaq Visual Fortran and Intel Visual Fortran

2. Lahey announces Lahey/Fujitsu Fortran 95 v6.2 for Linux

3. Compaq Visual Fortran or Intel Fortran Compiler?

4. Handling automation events in an Intel Visual Fortran Windows application

5. Intel Fortran Compilers 8.0 for Windows and Linux now available

6. Announcing the Intel Fortran Compiler 6.0 for Windows and Linux

7. using Intel Visual Fortran with Visual C++ 2005 Express

8. Lahey Fortran for Win - makefile example

9. Using IMSL libraries with Lahey/Intel fortran compilers

10. Random numbers - Algorithm (Lahey and Intel fortran compilers)

11. Creating - Fortran 77 dll for use in Visual Basic 6.0 (not using Compaq Visual Fortran)

12. Lahey/Fujitsu Fortran Technology Preview for Microsoft Visual Studio .NET

 

 
Powered by phpBB® Forum Software