mpif90 download on linux and related issues
Hi.
[1]
I have downloaded mpif77, which is a parallel wrapper for g77, onto my 64-bit RHEL workstation. It works ok, after I boot with 'lamboot'.
However, I at some point I seem to have lost the use of gfortran (an f95 compiler) on my machine; when I compile a simple code like:
PROGRAM GGG
DOUBLE PRECISION A
A = 20.D0
PRINT*, A
STOP
END PROGRAM GGG
with:
gfortran -O3 -o ggg ggg.f90
I get:
ld: crtbegin.o: No such file: No such file or directory.
Can someone tell me why? Have I overwritten something important?
Is it safe to re-install gfortran?
How do I re-install gfortran?
Incidentally, I had previously downloaded ifort, which is also an f95 compiler, and this compiles ok, and my codes run fine.
[2]
I want to install mpif90, or equivalent, which is the f95 version of mpif77 (I think?). At the moment I am using the 'ifort' as the base compiler, hoping that it will compile ok. My make file is as follows:
# MAKEFILE FOR PARALELL EXECUTABLE OBJECT FOR "pards".
F90 = ifort
FFLAGS = -u -O3 -i8 -r8 -align all -check -fast -fp-model fast=1 -funroll-loops
#FFLAGS = -O3 -fno-second-underscore -fno-silent -Wimplicit -Wall
#F90 = /usr/local/encap/mpich-1.2.4..8a-intel/bin/mpif90
#F90LINKER = /usr/local/encap/mpich-1.2.4..8a-intel/bin/mpif90
#LIBS= -lencap -liberty -lptcblas -lgm -lcblas -lblacsCinit -lblacs \
# -lblacsF77init -lscalapack
SRC = nrtype.f90 nr.f90 nrutil.f90 parameters_global.f90 chemical_kinetics.f90 loop_counters.f90 \
general_variables.f90 scalar_coefficients.f90 mpinpb.f90 \
setup_mpi.f90 initialise.f90 block_begin.f90 fops.f90 plotout.f90 \
CATALYST_FLOW_P4.f90 config.f90 calcp.f90 mesh.f90 read_data.f90 \
lisolv.f90 sites.f90 numsp.f90 strips.f90 bdycon.f90 flows.f90 \
props.f90 transport.f90 lights.f90 corvel.f90 enth.f90 ststep.f90 \
fndkey.f90 specnum.f90 rates.f90 ratec.f90 comrat.f90 comrac.f90 \
numcon.f90 coefuv.f90 etest.f90 stest.f90 mtest.f90 energy.f90 \
dec.f90 decbt.f90 sol.f90 solbt.f90 sweepc.f90 sweeph.f90 sweepv.f90 \
encoef.f90 stephv.f90 specsol.f90 spcoef.f90 ensour.f90 heatf.f90 \
tridag.f90 unstdy.f90 timept.f90 movie.f90 mread.f90 vread.f90
OBJS =$(SRC:.f90=.o)
# target definitions
.SUFFIXES: .f90
.f90.o:
$(F90) $(FFLAGS) -c $<
pards: $(OBJS)
$(F90) $(OBJS) $(FFLAGS) -o pards
There are several problems:
(1) although I have the basic f95 libraries nrtype.f90, nrutil.f90, nr.f90, I have to copy them into the working directory and compile every time together with my source code. This is unsatisfactory -- how do I get it automatically into my codes?
(2) I get a series of warnings (not errors) regarding subroutines in nr.f90. For example,
ifort -u -O3 -i8 -r8 -align all -check -fast -fp-model fast=1 -funroll-loops -c nr.f90
fortcom: Warning: nr.f90, line 953: The type/rank/keyword signature for this specific procedure match es another specific procedure that shares the same generic-name. [FOUR1_SP]
SUBROUTINE four1_sp(data,isign)
---------------------------^
fortcom: Warning: nr.f90, line 1030: The type/rank/keyword signature for this specific procedure matc hes another specific procedure that shares the same generic-name. [FOURROW_SP]
SUBROUTINE fourrow_sp(data,isign)
---------------------------^
What does this mean?
(3) All my subroutines compile ok; but when it is linking all together I get:
ifort nrtype.o nr.o nrutil.o parameters_global.o chemical_kinetics.o loop_counters.o general_variables.o scalar_coefficients.o mpinpb.o setup_mpi.o initialise.o block_begin.o fops.o plotout.o CATALYST_FLOW_P4.o config.o calcp.o mesh.o read_data.o lisolv.o sites.o numsp.o strips.o bdycon.o flows.o props.o transport.o lights.o corvel.o enth.o ststep.o fndkey.o specnum.o rates.o ratec.o comrat.o comrac.o numcon.o coefuv.o etest.o stest.o mtest.o energy.o dec.o decbt.o sol.o solbt.o sweepc.o sweeph.o sweepv.o encoef.o stephv.o specsol.o spcoef.o ensour.o heatf.o tridag.o unstdy.o timept.o movie.o mread.o vread.o -u -O3 -i8 -r8 -align all -check -fast -fp-model fast=1 -funroll-loops -o pards
ipo: warning #11041: unresolved mpi_init_
Referenced in /tmp/ipo_ifortA9f4Bz.o
ipo: warning #11041: unresolved mpi_comm_rank_
Referenced in /tmp/ipo_ifortA9f4Bz.o
ipo: warning #11041: unresolved mpi_comm_split_
Referenced in /tmp/ipo_ifortA9f4Bz.o
ipo: warning #11041: unresolved mpi_comm_size_
Referenced in /tmp/ipo_ifortA9f4Bz.o
ipo: warning #11041: unresolved mpi_comm_dup_
Referenced in /tmp/ipo_ifortA9f4Bz.o
ipo: warning #11041: unresolved mpi_finalize_
Referenced in /tmp/ipo_ifortA9f4Bz.o
ipo: warning #11041: unresolved mpi_reduce_
Referenced in /tmp/ipo_ifortA9f4Bz.o
ipo: warning #11041: unresolved mpi_bcast_
Referenced in /tmp/ipo_ifortA9f4Bz.o
ipo: warning #11041: unresolved mpi_barrier_
Referenced in /tmp/ipo_ifortA9f4Bz.o
ipo: remark #11000: performing multi-file optimizations
ipo: remark #11005: generating object file /tmp/ipo_ifortA9f4Bz.o
Clearly, it is not recognising the mpi parallel instructions, like mpi_comm_rank, and mpi_bcast etc.
This is repeated at the very end,
/tmp/ipo_ifortA9f4Bz.o(.text+0xf4d): In function `MAIN__':
: undefined reference to `mpi_finalize_'
/tmp/ipo_ifortA9f4Bz.o(.text+0x5590e): In function `stest_':
: undefined reference to `mpi_reduce_'
/tmp/ipo_ifortA9f4Bz.o(.text+0x55947): In function `stest_':
: undefined reference to `mpi_reduce_'
/tmp/ipo_ifortA9f4Bz.o(.text+0x5597d): In function `stest_':
: undefined reference to `mpi_reduce_'
/tmp/ipo_ifortA9f4Bz.o(.text+0x559b5): In function `stest_':
: undefined reference to `mpi_bcast_'
/tmp/ipo_ifortA9f4Bz.o(.text+0x559ed): In function `stest_':
: undefined reference to `mpi_bcast_'
/tmp/ipo_ifortA9f4Bz.o(.text+0x55a1f): In function `stest_':
: undefined reference to `mpi_bcast_'
/tmp/ipo_ifortA9f4Bz.o(.text+0x68c1c): In function `sweeph_':
: undefined reference to `mpi_bcast_'
/tmp/ipo_ifortA9f4Bz.o(.text+0x68c52): In function `sweeph_':
: undefined reference to `mpi_barrier_'
/tmp/ipo_ifortA9f4Bz.o(.text+0x83633): In function `sweepc_':
: undefined reference to `mpi_bcast_'
/tmp/ipo_ifortA9f4Bz.o(.text+0x83739): In function `sweepc_':
: undefined reference to `mpi_bcast_'
/tmp/ipo_ifortA9f4Bz.o(.text+0x83767): In function `sweepc_':
: undefined reference to `mpi_barrier_'
/tmp/ipo_ifortA9f4Bz.o(.text+0x9c972): In function `sweepv_':
: undefined reference to `mpi_bcast_'
/tmp/ipo_ifortA9f4Bz.o(.text+0x9cb43): In function `sweepv_':
: undefined reference to `mpi_bcast_'
/tmp/ipo_ifortA9f4Bz.o(.text+0x9cb7f): In function `sweepv_':
: undefined reference to `mpi_barrier_'
/tmp/ipo_ifortA9f4Bz.o(.text+0xaa1c8): In function `setup_mpi_':
: undefined reference to `mpi_init_'
/tmp/ipo_ifortA9f4Bz.o(.text+0xaa1dd): In function `setup_mpi_':
: undefined reference to `mpi_comm_size_'
/tmp/ipo_ifortA9f4Bz.o(.text+0xaa1f2): In function `setup_mpi_':
: undefined reference to `mpi_comm_rank_'
/tmp/ipo_ifortA9f4Bz.o(.text+0xaa2cd): In function `setup_mpi_':
: undefined reference to `mpi_comm_split_'
/tmp/ipo_ifortA9f4Bz.o(.text+0xaa2f3): In function `setup_mpi_':
: undefined reference to `mpi_comm_size_'
/tmp/ipo_ifortA9f4Bz.o(.text+0xaa308): In function `setup_mpi_':
: undefined reference to `mpi_comm_dup_'
/tmp/ipo_ifortA9f4Bz.o(.text+0xaa31d): In function `setup_mpi_':
: undefined reference to `mpi_comm_dup_'
make: *** [pards] Error 1
How do I rectify this?
Do I have to download mpif90?
Is it safe to download mpif90 without overwriting anything else, like gfortran, mpif77, etc?
DO I have to swap from lam_mpi to mpich? (Is there much difference.)
Thank you. I apologies for these rather simple questions -- as will note I regard myself as a newbie on linux.
Regards
|