jabbaqin / p3dfft

Automatically exported from code.google.com/p/p3dfft
GNU General Public License v3.0
0 stars 0 forks source link

Compiling p3dfft with Intel compilers (ifort/icc) #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently trying to compile p3dfft using the Intel compilers. Ran into
compile error:

mpif90 -DHAVE_CONFIG_H -I. -I. -I.. -I/opt/fftw/3.2.1/intel/include  
-DESTIMATE -DFFTW  -O3 -xW -132 -fpp -c -o module.o module.F90
./init_plan.F90(10): error #6415: This name cannot be assigned this data
type because it conflicts with prior uses of the name.   [N1]
      integer(8) n1
-----------------^
compilation aborted for module.F90 (code 1)

Original issue reported on code.google.com by d4p...@ucsd.edu on 2 Jun 2010 at 1:49

GoogleCodeExporter commented 9 years ago
Fix attempted. Please test. 

Original comment by dmitry...@gmail.com on 2 Jun 2010 at 6:47

GoogleCodeExporter commented 9 years ago
I recently attempted to compile with the following configure options:

./configure --enable-intel --enable-fftw --enable-dstride1 
--with-fftw="$FFTWHOME" FCFLAGS="-O3 -xW -132 -fpp" CFLAGS="-O3 -xW" 
LDFLAGS="-lmpi_f90 -lmpi_f77 -lmyriexpress"

Unfortunately I am still running into the same compile error.

Original comment by d4p...@ucsd.edu on 23 Jun 2010 at 11:11

GoogleCodeExporter commented 9 years ago
Intel will now compile p3dfft. There is an additional linker flag required 
(-limf which an optimized Intel math library) when running configure in order 
to suppress a warning about 'feupdateenv.' --enable-intel has been fully 
defined.

The following configure arguments should compile Intel:

./configure --enable-intel --enable-fftw --enable-dstride1 
--with-fftw="$FFTWHOME" FCFLAGS="-O3 -xW -132 -fpp" CFLAGS="-O3 -xW" 
LDFLAGS="-lmpi_f90 -lmpi_f77 -lmyriexpress -limf"

Needs to be tested on other platforms.

Original comment by d4p...@ucsd.edu on 6 Jul 2010 at 10:02

GoogleCodeExporter commented 9 years ago
I'm using p3dfft with Intelcompilers, too. And it's working fine with OpenMPI.
First you have to change the lines 487-489, where integer n1 is declared after 
being used, into following:

    integer(8) n1
    complex(mytype) A(n1)
    real(mytype) B(n1*2)

The Intelcompiler doesn't like using n1 with A and B before declaring it.
Then I set the openmpi-intelcompiler flags:
export OMPI_CC=icc
export OMPI_CXX=icpc
export OMPI_FC=ifort

After that configure with
./configure FCFLAGS='-nofor-main -132 -implicitnone' --disable-single 
--enable-measure --enable-dimsc
--disable-stride1 --with-fftw=/usr/lib/libfftw3.so 
--libdir=$HOMEBASE/theorie/lib/Linux-amd64-corei7/
--includedir=$HOMEBASE/theorie/include/

make and make install.
Compiling with:
mpicxx -g -O2 -Zp8 -DDOUBLE_PREC -c myexample.cpp  -I ~/theorie/include/
mpicxx -g -O2 -Zp8 -DDOUBLE_PREC -c p3dfft_cpp.cpp  -I ~/theorie/include/
Linking with:
mpif90 -nofor-main -L ~/theorie/lib/Linux-amd64-corei7/  myexample.o  
p3dfft_cpp.o -o myexample -lstdc++ -lmpi_cxx -lfftw3 -lp3dfft

Where I'm using the p3dfft header I posted in Issue 47 but it should also work 
with the default headerfile.
\\seb

Original comment by sla...@astro.uni-wuerzburg.de on 8 Jul 2010 at 11:16

GoogleCodeExporter commented 9 years ago

Original comment by dmitry...@gmail.com on 15 Jul 2010 at 10:53