Hello,
I’m trying to use the double precision fftpack
routines in a simple program of mine. I have built the fftpack
package with fpm
with no problems, and the compiler seems to find the needed module and object files (I provide the right include path to the compiler to find those).
Even though the program compiles with no issue, when trying to execute my program I get the following error. The main program seems unable to find the functions I include from fftpack
. I’m working on MacOS 11.7 (BigSur) using gfortran 12.2.
Undefined symbols for architecture x86_64:
"_dfftf_", referenced from:
_MAIN__ in cckgQ0YM.o
"_dffti_", referenced from:
_MAIN__ in cckgQ0YM.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
The program I’m trying to execute is the following.
program main
use, intrinsic :: iso_fortran_env, only: real64
use fftpack, only: dffti, dfftf
implicit none
integer, parameter :: rk = real64
integer, parameter :: n = 8
integer, parameter :: nsave = 2*n+15
real(rk), parameter :: pi = 4*atan(1.0_rk)
integer :: i
real(rk), dimension(n) :: xvec
real(rk), dimension(nsave) :: wsave
do i = 1, n
xvec(i) = cos(2*pi*(i-1)/n)
end do
call dffti(n, wsave)
call dfftf(n, xvec, wsave)
end program