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

gfortran:command not found error while I use intel compiler

yh_h_
Beginner
2,291 Views
Hi,

I've install parallel studio XE 2016 in my machine, and I try to install other software.

When I type 'make', then got this error: 

root@yh:/home/yh/PhonTS-1.1.5/src# make
mpif90 -c -autodouble -unroll -fno-alias -I/opt/intel/compilers_and_libraries_2016.3.210/linux/mkl:/opt/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/include -O3 variables.f90
/opt/intel/compilers_and_libraries_2016.3.210/linux/mpi/intel64/bin/mpif90: line 596: gfortran:command not found
/opt/intel/compilers_and_libraries_2016.3.210/linux/mpi/intel64/bin/mpif90: line 795: gfortran:command not found
make: *** [variables.o] Error 127

I've add directory of compilervars.sh and mklvars.sh in my .bashrc, and I also chek ifort is installed completely,which part I should modify?

Here is my Makefile

--

 #!/bin/bash

Build    = PhonTS
.SUFFIXES: .f90 .o

####   Your favorite fortran compiler
FF      =       mpif90
LD      =       $(FF) 

####   Compilation flag: -autodouble is the only one very important here
FFLAGS    =   -autodouble -unroll -fno-alias -I$(MKLROOT)/include

####   Linking flags - for the LAPACK library. This is 10.0.011 setup
LDFLAGS   = -Wl,--start-group $(MKLROOT)/intel64/libmkl_intel_lp64.a $(MKLROOT)/intel64/libmkl_core.a $(MKLROOT)/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm
#LDFLAGS   = -L/opt/intel/mkl/10.0.011/lib/em64t -Wl,--start-group -lmkl_sequential -lmkl_lapack -lmkl_em64t -lmkl_core -Wl,--end-group 

####   Optimization flags
(Build): FFLAGS += -O3

####   Debugging flags
debug: FFLAGS += -g -pg -check all -traceback -w -fpe0

####   Source files here
SRCS = variables.f90             \
       constants.f90             \
       mpi.f90                   \
       math_utils.f90            \
       pdos.f90                  \
       strgen.f90                \
       input.f90                 \
       D3_neighbours.f90         \
       tc_utils.f90              \
       symmetry.f90              \
       D0_interface.f90          \
       D1_interface.f90          \
       fp_interface.f90          \
       potential.f90             \
       kpoints.f90               \
       ewald_dyn.f90             \
       D2_D3_at_kpoint.f90       \
       allocate_data.f90         \
       phonons.f90               \
       perturbation.f90          \
       trans_rates.f90           \
       force_ewald.f90           \
       force_direct.f90          \
       force_tersoff.f90         \
       force_SW.f90              \
       force_wrapper.f90         \
       checks.f90                \
       conj_grad.f90             \
       integral.f90              \
       variational_univ.f90      \
       variational_univ_cons.f90 \
       iterative.f90             \
       twopdos.f90               \
       approx.f90                \
       iterative_sp.f90          \
       gruneisen.f90             \
       bte_driver.f90            \
       qha_driver.f90            \
       raman_driver.f90          \
       fit_driver.f90            \
       tab_driver.f90            \
       memory.f90                \
       main.f90       

OBJ     = $(SRCS:.f90=.o)

####   Default rule: build PhonTS
(Build): exe

####   Debugging rule: same thing
debug: exe

####   Linking rule
exe :       $(OBJ)
$(LD) -o $(Build) $(OBJ) $(LDFLAGS) 

####   Compiling rule
.f90.o:
$(FF) -c $(FFLAGS) $(OPT) $<

####   Cleaning
clean:
rm -f *.o *.mod $(Build)

0 Kudos
5 Replies
Kevin_D_Intel
Employee
2,291 Views

Change FF in your makefile to FF = mpiifort

0 Kudos
yh_h_
Beginner
2,291 Views

FF=mpiifort works but got another error:

--

D2_D3_at_kpoint.f90(126): error #6401: The attributes of this name conflict with those made accessible by a USE statement. [NDIM] 
integer ndim 
--------------^ 
D2_D3_at_kpoint.f90(163): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
allocate(work(ndim*ndim+2*ndim),rwork(2*ndim*ndim+5*ndim+1),iwork(5*ndim+3)) 
--------------------^ 
D2_D3_at_kpoint.f90(163): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
allocate(work(ndim*ndim+2*ndim),rwork(2*ndim*ndim+5*ndim+1),iwork(5*ndim+3)) 
-------------------------^ 
D2_D3_at_kpoint.f90(163): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
allocate(work(ndim*ndim+2*ndim),rwork(2*ndim*ndim+5*ndim+1),iwork(5*ndim+3)) 
--------------------------------^ 
D2_D3_at_kpoint.f90(163): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
allocate(work(ndim*ndim+2*ndim),rwork(2*ndim*ndim+5*ndim+1),iwork(5*ndim+3)) 
----------------------------------------------^ 
D2_D3_at_kpoint.f90(163): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
allocate(work(ndim*ndim+2*ndim),rwork(2*ndim*ndim+5*ndim+1),iwork(5*ndim+3)) 
---------------------------------------------------^ 
D2_D3_at_kpoint.f90(163): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
allocate(work(ndim*ndim+2*ndim),rwork(2*ndim*ndim+5*ndim+1),iwork(5*ndim+3)) 
----------------------------------------------------------^ 
D2_D3_at_kpoint.f90(163): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
allocate(work(ndim*ndim+2*ndim),rwork(2*ndim*ndim+5*ndim+1),iwork(5*ndim+3)) 
--------------------------------------------------------------------------^ 
D2_D3_at_kpoint.f90(216): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
lwork = ndim*ndim+2*ndim 
--------------^ 
D2_D3_at_kpoint.f90(216): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
lwork = ndim*ndim+2*ndim 
-------------------^ 
D2_D3_at_kpoint.f90(216): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
lwork = ndim*ndim+2*ndim 
--------------------------^ 
D2_D3_at_kpoint.f90(217): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
lrwork = 2*ndim*ndim+5*ndim+1 
-----------------^ 
D2_D3_at_kpoint.f90(217): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
lrwork = 2*ndim*ndim+5*ndim+1 
----------------------^ 
D2_D3_at_kpoint.f90(217): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
lrwork = 2*ndim*ndim+5*ndim+1 
-----------------------------^ 
D2_D3_at_kpoint.f90(218): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
liwork = 5*ndim+3 
-----------------^ 
D2_D3_at_kpoint.f90(733): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
call zheevd("V", "U", ndim, gm, ndim, freq, work, lwork, rwork, lrwork, iwork, liwork, info) 
----------------------------^ 
D2_D3_at_kpoint.f90(733): error #6405: The same named entity from different modules and/or program units cannot be referenced. [NDIM] 
call zheevd("V", "U", ndim, gm, ndim, freq, work, lwork, rwork, lrwork, iwork, liwork, info) 
--------------------------------------^ 
D2_D3_at_kpoint.f90(112): error #6404: This name does not have a type, and must have an explicit type. [NDIM] 
subroutine get_omega(k_point,kx,ky,kz,freq,zr,zi,ndim,print_out) 
-------------------------------------------------------^ 
compilation aborted for D2_D3_at_kpoint.f90 (code 1) 
make: *** [D2_D3_at_kpoint.o] Error 1 
-- 

0 Kudos
Kevin_D_Intel
Employee
2,291 Views

Somehow there are multiple module (.mod) files available to the compiler where more than one of those contains a definition of the variable NDIM.

I can't advise on how exactly to fix this. I'm guessing you are perhaps modifying source in some way and perhaps accidentally introduced this. You should scan your source files for definitions of NDIM within specific modules as a first step. Perhaps try to determine if multiple definitions within different modules is appropriate and if not remove unnecessary definitions. If multiple definitions in different modules is expected then another possibility is to inspect the source file D2_D3_at_kpoint.f90 and determine if the USE statements are appropriate or if they require  refinement in some way using the ONLY option.

0 Kudos
Steven_L_Intel1
Employee
2,291 Views

In this particular case, the problem is the local declaration of NDIM when a module that is USEd also defines NDIM.

0 Kudos
Kevin_D_Intel
Employee
2,291 Views

Thank you Steve. So the Error #6041 suggests the insertion of line 126 in D2_D3_at_kpoint.f90 was perhaps in error and where to start looking then.

0 Kudos
Reply