Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Building interfaces for DFTI for fortran

masayan24
Beginner
625 Views
Building interfaces for DFTI for fortran seems require c compiler.
This brings difficulties for fortran user, since one does not have c compiler but fortran compiler.

I was trying to build interfaces for DFTI (which has to be build separately).
They should be built under "interfaces" directory.
However when one "make" the program the error message appear as:
---------- error messgae ----------
make clean libfftw3xf_intel.a _IA=em64t
rm -rf obj
rm -f ../../lib/em64t/libfftw3xf_intel.a
mkdir -p obj
make -f makefile objects
icc -c -w -I../../include -I../../include/fftw wrappers/fftw_version.c -o obj/fftw_version.o
make[2]: icc: Command not found
make[2]: *** [obj/fftw_version.o] Error 127
make[1]: *** [libfftw3xf_intel.a] Error 2
make: *** [libem64t] Error 2
----------

It seems requiring icc compiler.

I am now using intel fortran compiler and do not have c compiler, even I need to use interfaces for fortran.

OS: Mac OS X 10.5
Compiler: Intel fortran compiler 10.1
wanted file: libfftw3xf_intel.a
0 Kudos
1 Solution
ArturGuzik
Valued Contributor I
625 Views
Quoting - masayan24
hi Artur,
Maybe I misunderstood at the start point...

Originally I wanted to just use MKL DFTI.
And I had errors (which is not shown here.).
And somehow I thought I need some kind of interfaces for it, since the error seems that it can't find some routines or functions. And I was searching on the web.

And I realize by your question that the interface I was trying to have is for FFTW.
So it will not what I need to have. (I'm not very confident.)

In this case, I probably need search (probably need to ask again) how to use DFTI and what the real problem is...

That's what I was afraid of (that we were not "on the same page"). And that's why my first reply was partially wrong. I had impression you want to use MKL DFTI and in that case you don't need C compiler, while FFTW is a C library, so it's hard to interface it without a bit of C code. Anyway, examples are provided in the folder fortranmklexamplesdftf.

If you already tried it and have problems with them just post some description of what went wrong and I'm sure somebody will be able to help you.

A.

View solution in original post

0 Kudos
10 Replies
ArturGuzik
Valued Contributor I
625 Views
Quoting - masayan24
Building interfaces for DFTI for fortran seems require c compiler.
This brings difficulties for fortran user, since one does not have c compiler but fortran compiler.



Hi,

You do NOT need a C compiler. My guess is you run the makefile from interfaces/xxxxxc folder, which contains, well, wrappers in C (yes you do have them even if you installed Fortran version, only). Check interfaces/xxxxxf folder makefiles.

A.

0 Kudos
Gennady_F_Intel
Moderator
625 Views
Quoting - ArturGuzik

Hi,

You do NOT need a C compiler. My guess is you run the makefile from interfaces/xxxxxc folder, which contains, well, wrappers in C (yes you do have them even if you installed Fortran version, only). Check interfaces/xxxxxf folder makefiles.

A.

hi masahiro,
as Artur mentioned, for building wrapper library, you don need to use intel compiler. Intel compiler is used as a default compiler. Please try to use gnu compiler instead of icc:
make libem64t compiler=gnu
--Gennady

0 Kudos
masayan24
Beginner
625 Views
Quoting - ArturGuzik

Hi,

You do NOT need a C compiler. My guess is you run the makefile from interfaces/xxxxxc folder, which contains, well, wrappers in C (yes you do have them even if you installed Fortran version, only). Check interfaces/xxxxxf folder makefiles.

A.

Thank you Artur,
However I tried under interfaces/xxxxxf/
So I guess I'm doing wright in this point...
Should I check inside of "makefile"?
0 Kudos
masayan24
Beginner
625 Views
hi masahiro,
as Artur mentioned, for building wrapper library, you don need to use intel compiler. Intel compiler is used as a default compiler. Please try to use gnu compiler instead of icc:
make libem64t compiler=gnu
--Gennady

Thank you Gennady,

Yes, I already tried what you suggest, and be able to get interface.
However, the created file is something like xxx_gnu.a
And it is because of the gnu compiler.
I would like to have intel version which is xxx_intel.a
Otherwise I can not use "ifort"

Do you have any better suggestions?
0 Kudos
ArturGuzik
Valued Contributor I
625 Views
Quoting - masayan24
Thank you Gennady,

Yes, I already tried what you suggest, and be able to get interface.
However, the created file is something like xxx_gnu.a
And it is because of the gnu compiler.
I would like to have intel version which is xxx_intel.a
Otherwise I can not use "ifort"

Do you have any better suggestions?
OK. Gennady definitely will help you with that, but let's make oursleves sure: you're trying to make interfaces to FFTW library instead of using MKL DFTI functionality. right?

A.
0 Kudos
masayan24
Beginner
625 Views
Quoting - ArturGuzik
OK. Gennady definitely will help you with that, but let's make oursleves sure: you're trying to make interfaces to FFTW library instead of using MKL DFTI functionality. right?

A.
hi Artur,
Maybe I misunderstood at the start point...

Originally I wanted to just use MKL DFTI.
And I had errors (which is not shown here.).
And somehow I thought I need some kind of interfaces for it, since the error seems that it can't find some routines or functions. And I was searching on the web.

And I realize by your question that the interface I was trying to have is for FFTW.
So it will not what I need to have. (I'm not very confident.)

In this case, I probably need search (probably need to ask again) how to use DFTI and what the real problem is...
0 Kudos
ArturGuzik
Valued Contributor I
626 Views
Quoting - masayan24
hi Artur,
Maybe I misunderstood at the start point...

Originally I wanted to just use MKL DFTI.
And I had errors (which is not shown here.).
And somehow I thought I need some kind of interfaces for it, since the error seems that it can't find some routines or functions. And I was searching on the web.

And I realize by your question that the interface I was trying to have is for FFTW.
So it will not what I need to have. (I'm not very confident.)

In this case, I probably need search (probably need to ask again) how to use DFTI and what the real problem is...

That's what I was afraid of (that we were not "on the same page"). And that's why my first reply was partially wrong. I had impression you want to use MKL DFTI and in that case you don't need C compiler, while FFTW is a C library, so it's hard to interface it without a bit of C code. Anyway, examples are provided in the folder fortranmklexamplesdftf.

If you already tried it and have problems with them just post some description of what went wrong and I'm sure somebody will be able to help you.

A.
0 Kudos
Dmitry_B_Intel
Employee
625 Views

Looks like you are using MKL 10.1.x or earlier. In that case compiling the FFTW3 wrappers with compiler=gnu will add an extra underscore to the names toconform to g77 name decoration scheme. This conflicts with ifort indeed.

One solution is to build the wrappers library with gcc compiler without adding the underscore. The following should work:

examples/fftw3xf$ make libem64t compiler=gnu FC=ifort COPTS=-U_GNU

This command will use gcc to build the wrappers (because compiler=gnu), but it won't add extra underscore (because of COPTS=-U_GNU), and it will use ifort to compile examples and will link them to libfftw3xf_gnu.a

I hope this helps.
Dima

0 Kudos
masayan24
Beginner
625 Views

Looks like you are using MKL 10.1.x or earlier. In that case compiling the FFTW3 wrappers with compiler=gnu will add an extra underscore to the names toconform to g77 name decoration scheme. This conflicts with ifort indeed.

One solution is to build the wrappers library with gcc compiler without adding the underscore. The following should work:

examples/fftw3xf$ make libem64t compiler=gnu FC=ifort COPTS=-U_GNU

This command will use gcc to build the wrappers (because compiler=gnu), but it won't add extra underscore (because of COPTS=-U_GNU), and it will use ifort to compile examples and will link them to libfftw3xf_gnu.a

I hope this helps.
Dima

Dear Dima,

Thank you for the useful information.
As I wrote previously, I will try to use MKL DFTI, however this information gives me additional choice of routines.

Thanks.

MasaYan
0 Kudos
Dmitry_B_Intel
Employee
625 Views

Dear MasaYan,

Whether you decide to use DFTI or FFTW interface, Ifeel obliged to recommend you to upgrade your copy of MKL to the latest MKL release. Ithas FFTW3 interface integrated and wouldrelieve you from the need of building the wrappers. Please refer to theknowledge base article explaining what FFT interfaces MKL provides.

Sincerely,
Dima
0 Kudos
Reply