Question

I am attempting to compile a test program to test my implementation of fftw. I have built and installed fftw as is described in the tutorial and configured my compiler to gfortran using ./configure g77=gfortran. I am on Ubuntu 13.10.

Here is my makefile:

INCLUDES=-I. -I/opt/local/include

  fftwTest: fftwTest.f90
    gfortran $^ $(INCLUDES) -O3 -fbounds-check -l fftw3 -L /usr/local/lib -o $@

And here is the program itself:

program fftwTest
    implicit none

    include 'fftw3.f'   

    double complex in, out
        dimension in(N), out(N)
        integer*8 plan

        call fftw_f77_create_plan(plan,N,FFTW_FORWARD,FFTW_ESTIMATE)
        call fftw_f77_one(plan,in,out)
        call fftw_f77_destroy_plan(plan)

   end program fftwTest

When I do make fftwTest, here is the error I get:

gfortran fftwTest.f90 -I. -I/opt/local/include -O3 -fbounds-check -l fftw3 -L /usr/local/lib -o fftwTest
Warning: Nonexistent include directory "/opt/local/include"
fftwTest.f90:4: Error: Can't open included file 'fftw3.f03'
make: *** [fftwTest] Error 1
Was it helpful?

Solution

In your makefile change:

INCLUDES=-I. -I/opt/local/include

to:

INCLUDES=-I. -I/usr/local/include
                ^^^
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top