<div dir="ltr">Hello,<br><br>I've encountered an error when trying to build pw on macOS 15.6.1 using FFTW3;<br>It seems that running the ./configure script with the IFLAGS parameter specified somehow breaks the build process.<br><br>I started by trying to build pw.x using the following command:<br><br><blockquote style="margin:0 0 0 40px;border:none;padding:0px">     ./configure --enable-parallel=no CC=/opt/homebrew/bin/gcc-15 CPP=/opt/homebrew/bin/cpp-15</blockquote><br>but this doesn't find the version of FFTW installed by homebrew, since I see in the ./configure output the message "using internal copy of FFTW" and "FFT_LIBS= " indicating that no FFT library was found.<br>Running "make pw.x" afterwards succeeds and I can run PWscf, but I want to build it with FFTW3.<br><br>I first tried to resolve this by including the option LIBDIRS="/opt/homebrew/lib" in my ./configure command.<br>This partially worked, because I saw in the configure script:<br><br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"> in /opt/homebrew/lib:  checking for library containing dfftw_execute_dft... -lfftw3<br>  -L/opt/homebrew/lib -lfftw3 </blockquote><br>and in the list of libraries that was found I see "FFT_LIBS=-L/opt/homebrew/lib -lfftw3".<br>However this obviously won't work because I'm not including the necessary files from FFTW:<br>when I run "make pw", compilation of fft_scalar.FFTW3.f90 fails as follows:<br><br><blockquote style="margin:0 0 0 40px;border:none;padding:0px">       gfortran -O3 -g -fallow-argument-mismatch -cpp -D__FFTW3  -I/Users/jamestelzrow/Documents/Junk_Drawer/custom_qe_build/q-e//external/devxlib/src -I. -I/Users/jamestelzrow/Documents/Junk_Drawer/custom_qe_build/q-e//include  -c fft_scalar.FFTW3.f90 -o fft_scalar.FFTW3.o<br> fft_scalar.FFTW3.f90:41:2:<br>       41 |<br>        |  1          <br>    Fatal Error: fftw3.f03: No such file or directory<br>     compilation terminated.</blockquote><br>While it isn't included in the error messsage, line 40 is "#include "fftw3.f03"".<br>Obviously, gfortran needs to include the directory "/opt/homebrew/include".<br>It seems that the correct way to do this is to specify "IFLAGS=-I/opt/homebrew/include" when calling ./configure, as follows:<br><br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"> ./configure --enable-parallel=no CC=/opt/homebrew/bin/gcc-15 CPP=/opt/homebrew/bin/cpp-15 LIBDIRS="/opt/homebrew/lib" IFLAGS="-I/opt/homebrew/include"</blockquote><br>But when running "make pw" afterwards, although all the components of FFTXlib are compiled successfully, compilation of write_upf_new.f90 fails as follows:<br><br><blockquote style="margin:0 0 0 40px;border:none;padding:0px">  gfortran -O3 -g -fallow-argument-mismatch -cpp -D__FFTW3  -I/Users/jamestelzrow/Documents/Junk_Drawer/custom_qe_build/q-e//external/devxlib/src -I/opt/homebrew/include -I../UtilXlib -I. -c write_upf_new.f90 -o write_upf_new.o<br>    write_upf_new.f90:176:2:<br>        176 |     INTEGER :: nw, nb<br>        |  1  ~~~~~~~~~~~<br>     Fatal Error: qe_version.h: No such file or directory<br>  compilation terminated.</blockquote><br>Line 175 in this file is #include "qe_version.h".<br>As I can see by looking at the output of "make pw" when building with QE's internal copy of FFTW, this gfortran invocation should include "-I/Users/jamestelzrow/Documents/Junk_Drawer/custom_qe_build/q-e//include", as the header file "qe_version.h" lies in that directory.<br>Again, this directory is included when I run "make pw" after configuring using the command<br><br><blockquote style="margin:0 0 0 40px;border:none;padding:0px">      ./configure --enable-parallel=no CC=/opt/homebrew/bin/gcc-15 CPP=/opt/homebrew/bin/cpp-15</blockquote><br>but not when running "make pw" after using the command<br><br><blockquote style="margin:0 0 0 40px;border:none;padding:0px">        ./configure --enable-parallel=no CC=/opt/homebrew/bin/gcc-15 CPP=/opt/homebrew/bin/cpp-15 LIBDIRS="/opt/homebrew/lib" IFLAGS="-I/opt/homebrew/include"</blockquote><br>so it seems to me that including the IFLAGS parameter when calling ./configure breaks something.<br>I tried to resolve this by including "-I/Users/jamestelzrow/Documents/Junk_Drawer/custom_qe_build/q-e//include" in IFLAGS, running:<br><br><blockquote style="margin:0 0 0 40px;border:none;padding:0px">        ./configure --enable-parallel=no CC=/opt/homebrew/bin/gcc-15 CPP=/opt/homebrew/bin/cpp-15 LIBDIRS="/opt/homebrew/lib" IFLAGS="-I/opt/homebrew/include -I/Users/jamestelzrow/Documents/Junk_Drawer/custom_qe_build/q-e//include"</blockquote><br>However, when running "make pw" after doing this, compilation of cegterg.f90 fails as follows:<br><br><blockquote style="margin:0 0 0 40px;border:none;padding:0px">      gfortran -O3 -g -fallow-argument-mismatch -cpp -D__FFTW3  -I/Users/jamestelzrow/Documents/Junk_Drawer/custom_qe_build/q-e//external/devxlib/src -I/opt/homebrew/include -I/Users/jamestelzrow/Documents/Junk_Drawer/custom_qe_build/q-e//include -I ../../LAXlib -I ../../UtilXlib -I. -c cegterg.f90 -o cegterg.o<br>   cegterg.f90:38:7:<br>        38 |   USE device_memcpy_m, ONLY : dev_memcpy, dev_memset<br>       |       1<br>       Fatal Error: Cannot open module file 'device_memcpy_m.mod' for reading at (1): No such file or directory<br>      compilation terminated.</blockquote><br>Looking in the "q-e/external/devxlib/src" directory I see the file "device_memcpy_mod.f90" where the "device_memcpy_m" module is defined, but this directory doesn't contain any ".mod" or ".o" files, seemingly indicating that nothing here was compiled.<br>However, in the output of "make pw" after running "./configure --enable-parallel=no CC=/opt/homebrew/bin/gcc-15 CPP=/opt/homebrew/bin/cpp-15" (without any LIBDIRS or IFLAGS parameters) I can see that these files do get compiled, once again making it seem like the build process is broken somehow.<br><br>Is there some other way that I should be trying to build this, or is there a problem with the configuration scripts or makefiles?<br><br>Thank you,<br><br>James Telzrow<br></div>