- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to compile a simple piece of code using ifort 11 and a local installation of mpich.
This is on an IBM e1350 cluster running SuSE Linux Enterprise 9 SP3.
It is basically the 'hello world' for mpi.
I cannot seem to compile this using ifort, i.e.
ifort hello_mpi.f -o hello-mpi.out -I/
I get:
/tmp/ifort3DEBtP.o(.text+0x3f): In function `MAIN__':
: undefined reference to `mpi_init_'
/tmp/ifort3DEBtP.o(.text+0x5b): In function `MAIN__':
: undefined reference to `mpi_comm_size_'
/tmp/ifort3DEBtP.o(.text+0x77): In function `MAIN__':
: undefined reference to `mpi_comm_rank_'
/tmp/ifort3DEBtP.o(.text+0x152): In function `MAIN__':
: undefined reference to `mpi_finalize_'
I've tried many variations of adding or removing underscores etc but nothing seems to work.
The code does however compile via the pathscale compiler. And mpich is built with pathscale.
Sorry i'm new to MPI. Do I have to have an ifort version of mpich? Is there no other way?
regards,
Tanksnr.
I am trying to compile a simple piece of code using ifort 11 and a local installation of mpich.
This is on an IBM e1350 cluster running SuSE Linux Enterprise 9 SP3.
It is basically the 'hello world' for mpi.
[plain] program main include 'mpif.h' integer myrank, mysize, rc call MPI_INIT( ierr ) call MPI_COMM_SIZE(MPI_COMM_WORLD,mysize,ierr) call MPI_COMM_RANK(MPI_COMM_WORLD,myrank,ierr) print *, 'Hello World! I am ', myrank, ' of ', mysize, '.' call MPI_FINALIZE(rc) stop end [/plain]
I cannot seem to compile this using ifort, i.e.
ifort hello_mpi.f -o hello-mpi.out -I/
I get:
/tmp/ifort3DEBtP.o(.text+0x3f): In function `MAIN__':
: undefined reference to `mpi_init_'
/tmp/ifort3DEBtP.o(.text+0x5b): In function `MAIN__':
: undefined reference to `mpi_comm_size_'
/tmp/ifort3DEBtP.o(.text+0x77): In function `MAIN__':
: undefined reference to `mpi_comm_rank_'
/tmp/ifort3DEBtP.o(.text+0x152): In function `MAIN__':
: undefined reference to `mpi_finalize_'
I've tried many variations of adding or removing underscores etc but nothing seems to work.
The code does however compile via the pathscale compiler. And mpich is built with pathscale.
Sorry i'm new to MPI. Do I have to have an ifort version of mpich? Is there no other way?
regards,
Tanksnr.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At a minimum, you must build the mpi Fortran library with the same compiler you are using for your application, and link against that library. If you aren't on speaking terms with your sysadmin, you have serious obstacles, but you could certainly make you own copy of mpi libraries. What do other people do on your cluster? It may be understandable when a cluster has only an obsolete version of gfortran installed, but why a partly commercial compiler from an organization which has been disbanded?
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tanksnr
Hi,
I am trying to compile a simple piece of code using ifort 11 and a local installation of mpich.
This is on an IBM e1350 cluster running SuSE Linux Enterprise 9 SP3.
It is basically the 'hello world' for mpi.
I cannot seem to compile this using ifort, i.e.
ifort hello_mpi.f -o hello-mpi.out -I/
I get:
/tmp/ifort3DEBtP.o(.text+0x3f): In function `MAIN__':
: undefined reference to `mpi_init_'
/tmp/ifort3DEBtP.o(.text+0x5b): In function `MAIN__':
: undefined reference to `mpi_comm_size_'
/tmp/ifort3DEBtP.o(.text+0x77): In function `MAIN__':
: undefined reference to `mpi_comm_rank_'
/tmp/ifort3DEBtP.o(.text+0x152): In function `MAIN__':
: undefined reference to `mpi_finalize_'
I've tried many variations of adding or removing underscores etc but nothing seems to work.
The code does however compile via the pathscale compiler. And mpich is built with pathscale.
Sorry i'm new to MPI. Do I have to have an ifort version of mpich? Is there no other way?
regards,
Tanksnr.
I am trying to compile a simple piece of code using ifort 11 and a local installation of mpich.
This is on an IBM e1350 cluster running SuSE Linux Enterprise 9 SP3.
It is basically the 'hello world' for mpi.
[plain] program main
include 'mpif.h'
integer myrank, mysize, rc
call MPI_INIT( ierr )
call MPI_COMM_SIZE(MPI_COMM_WORLD,mysize,ierr)
call MPI_COMM_RANK(MPI_COMM_WORLD,myrank,ierr)
print *, 'Hello World! I am ', myrank, ' of ', mysize, '.'
call MPI_FINALIZE(rc)
stop
end
[/plain]
I cannot seem to compile this using ifort, i.e.
ifort hello_mpi.f -o hello-mpi.out -I/
I get:
/tmp/ifort3DEBtP.o(.text+0x3f): In function `MAIN__':
: undefined reference to `mpi_init_'
/tmp/ifort3DEBtP.o(.text+0x5b): In function `MAIN__':
: undefined reference to `mpi_comm_size_'
/tmp/ifort3DEBtP.o(.text+0x77): In function `MAIN__':
: undefined reference to `mpi_comm_rank_'
/tmp/ifort3DEBtP.o(.text+0x152): In function `MAIN__':
: undefined reference to `mpi_finalize_'
I've tried many variations of adding or removing underscores etc but nothing seems to work.
The code does however compile via the pathscale compiler. And mpich is built with pathscale.
Sorry i'm new to MPI. Do I have to have an ifort version of mpich? Is there no other way?
regards,
Tanksnr.
you should use a mpich version compiled with the intel compilers and the use mpif90 to compile your code...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - rreis
you should use a mpich version compiled with the intel compilers and the use mpif90 to compile your code...
Ricardo is correct: the mpich compiler wrappers such as mpif90 when mpich is built with the Intel Fortran compiler will include all the necessary libraries.
Otherwise, your compiler line will require -L
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Ronald W. Green (Intel)
Ricardo is correct: the mpich compiler wrappers such as mpif90 when mpich is built with the Intel Fortran compiler will include all the necessary libraries.
Otherwise, your compiler line will require -L
ron
Is this all mpif90 does? i.e. just add more flags?
So if I include all the libraries in my ifort compiler line it should work?
It doesn't though.
And my mpif90 uses pathscale (since mpich was built with pathscale), but I really need to use ifort.
Sorry i'm really looking for ways to do this without rebuilding mpich with Intel compiler since I don't have that much control of our cluster.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At a minimum, you must build the mpi Fortran library with the same compiler you are using for your application, and link against that library. If you aren't on speaking terms with your sysadmin, you have serious obstacles, but you could certainly make you own copy of mpi libraries. What do other people do on your cluster? It may be understandable when a cluster has only an obsolete version of gfortran installed, but why a partly commercial compiler from an organization which has been disbanded?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tanksnr
Is this all mpif90 does? i.e. just add more flags?
So if I include all the libraries in my ifort compiler line it should work?
It doesn't though.
And my mpif90 uses pathscale (since mpich was built with pathscale), but I really need to use ifort.
Sorry i'm really looking for ways to do this without rebuilding mpich with Intel compiler since I don't have that much control of our cluster.
So if I include all the libraries in my ifort compiler line it should work?
It doesn't though.
And my mpif90 uses pathscale (since mpich was built with pathscale), but I really need to use ifort.
Sorry i'm really looking for ways to do this without rebuilding mpich with Intel compiler since I don't have that much control of our cluster.
The problem here not in flags only but in libraries also. For fortran programs binding libraries are needed.
The simplest way is to install Intel MPI Library and you'll get native support of all Intel tools. In this case you just need to compile your application by mpiifort - all needed options and libraries will be used automatically.
Best wishes,
Dmitry

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page