Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29252 Discussions

how define make file macros for ifort

hamid_mosaddeghi
Beginner
2,542 Views
Hi Dears

I have problem with define this make file for ifort 11.1 prof , I have dell labtop dual core ispiron 6400, fedora os.

plesae say to me how define variable :

------------------------------------------------------------------
#####################################################
#
# Makefile.generic : Compiler options for generic computers
# The present file is invoked by Makefile
#
#####################################################


# Compiler and flag for f90
F90=FC
FLAGS90= -c -mips4 -O3 -INLINE

# Preprocessor and flags
CPP=FC -E -cpp -macro_expand
MACHINE_CPFLAGS=

# Additional platform specific options for preprocessor (syntax: -Doption)
MACHINE_CPFLAGS=

# Extra modules for specific platform
EXTRAS= sys_generic.o timer.o

--------------------------------------------------




PS :

if I change "f90" with "ifort" but I get this error:


You just type make: let us check if target variable is set..
FC -E -cpp -macro_expand -DSERIAL -DDEBUG -DSTRESS -DNOENEAT -DPUBFFT -DSPLINE -DCOMM_LAYER=SERIAL_layer constant_mod.F90 | sed '/^#/D' > constant_mod.tmp.f90
/bin/sh: FC: command not found
c -mips4 -O3 -INLINE constant_mod.tmp.f90
make: c: Command not found
make: [constant_mod.o] Error 127 (ignored)
mv constant_mod.tmp.o constant_mod.o
mv: cannot stat `constant_mod.tmp.o': No such file or directory
make: *** [constant_mod.o] Error 1


thanks for attention

0 Kudos
1 Solution
Kevin_D_Intel
Employee
2,542 Views

Ok. First, edit Makefileand change line 92 to add "intel" as is shown below.

TARGET= intelpgi pgi_mpi t3e sp3 o2k generic compaq nag absoft qsw qsw_mpi

Next, download and place a copy of the attached Makefile.intel into the "dlprotein-2.1r2/source" directory and then execute the following commands:

make intel
make


That should produce an executable for you using ifort and the GNU C compiler (cc).

Just to add, cpp was found at /usr/bin/cpp on my system. It may be under /usr/lib/ccp. This app has apparently never been ported to ifort, soyou or the providers will have to judge the correctness of the results.

View solution in original post

0 Kudos
7 Replies
Kevin_D_Intel
Employee
2,542 Views
You should not need to edit the makefile. An alternative is to add "F90=ifort" to the 'make' command line. For example, assuming there's an "all" target, the command line might look like this:

make all F90=ifort

If you want to edit the makefile , then you changethe line

F90=FC

to be

F90=ifort

That expands $(F90) uses in the makefile with ifort.

0 Kudos
hamid_mosaddeghi
Beginner
2,542 Views
Hi Dear Davis

after type "make all F90=ifort" iget this error, I put tail of error:

-----------------------------------

mv srfco3_sw_prot.tmp.o srfco3_sw_prot.o
f90 -E -cpp -macro_expand -DSERIAL -DDEBUG -DSTRESS -DNOENEAT -DPUBFFT -DSPLINE -DCOMM_LAYER=SERIAL_layer srfco3_prot.F90 | sed '/^#/D' > srfco3_prot.tmp.f90
/bin/sh: f90: command not found
ifort -c -mips4 -O3 -INLINE srfco3_prot.tmp.f90
ifort: command line warning #10159: invalid argument for option '-m'
: remark #5133: The input stream is empty

mv srfco3_prot.tmp.o srfco3_prot.o
cc -c -DSERIAL -DDEBUG -DSTRESS -DNOENEAT -DPUBFFT -DSPLINE -DCOMM_LAYER=SERIAL_layer sys_generic.c
cc -c -DSERIAL -DDEBUG -DSTRESS -DNOENEAT -DPUBFFT -DSPLINE -DCOMM_LAYER=SERIAL_layer timer.c
f77 dblstr.f
make: execvp: f77: Permission denied ----------> as root make: f77: Command not found
make: *** [dblstr.o] Error 127

----------------------------------------------

what's your idea?
0 Kudos
Kevin_D_Intel
Employee
2,542 Views

There's a few issues there. FLAGS90 does not contain valid ifort options. The make tried to execute 'f77' which isn't available but I assume ifort would be wanted for that too and CPP appears to have substituted FC with f90 somehow. I need to see the makefile.

Please attach the makefile to this thread so I can better advise on using ifort.

SeeAttaching or Including Files in a Post for instructions.

0 Kudos
hamid_mosaddeghi
Beginner
2,542 Views
Hi

I attach code that be compile

you see source folder, I need use Makefile.generic for compile (i think other makefile don't work for me ).

thanks for attention.
0 Kudos
mecej4
Honored Contributor III
2,540 Views
The customizations for your compiler, OS, etc. are to be made in the file Makefile.machine. This file is used by an "include" directive in the makefile. As distributed, the options in the file are appropriate for the NAG compiler, not IFort.
0 Kudos
Kevin_D_Intel
Employee
2,543 Views

Ok. First, edit Makefileand change line 92 to add "intel" as is shown below.

TARGET= intelpgi pgi_mpi t3e sp3 o2k generic compaq nag absoft qsw qsw_mpi

Next, download and place a copy of the attached Makefile.intel into the "dlprotein-2.1r2/source" directory and then execute the following commands:

make intel
make


That should produce an executable for you using ifort and the GNU C compiler (cc).

Just to add, cpp was found at /usr/bin/cpp on my system. It may be under /usr/lib/ccp. This app has apparently never been ported to ifort, soyou or the providers will have to judge the correctness of the results.

0 Kudos
hamid_mosaddeghi
Beginner
2,540 Views
Hi

I very glad, because with your method I am able to compile it


special thanks
0 Kudos
Reply