| <p>Disclaimer: This might not be the best solution to this problem. I arrived here after a lot of googling and stumbling across this thread with a similar problem for an unrelated project: https://github.com/xtensor-stack/xtensor-fftw/issues/52. If you're someone who actually knows cmake, maybe you have a better solution.</p>
<p>When compiling both pueoBuilder and anitaBuildTools, I have run into a cmake error that looks like:</p>
<pre>
<code>CMake Error at /apps/cmake/3.17.2/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
Could NOT find FFTW (missing: FFTW_LIBRARIES)</code></pre>
<p>(potentially also missing FFTW_INCLUDES). Directing CMake to the pre-existing FFTW installations on OSC does not seem to do anything to resolve this error. From what I can tell, this <em>might </em>be related to how FFTW is built, so to get around this we need to build our own installation of FFTW using cmake instead of the recommended build process. To do this, grab the whatever version of FFTW you need from here: http://www.fftw.org/download.html (for example, I needed 3.3.9). Untar the source file into whatever directory you're working in:</p>
<p><code> tar -xzvf fftw-3.3.9.tar.gz</code></p>
<p>Then make a build directory and cd into it:<br />
<br />
<code> mkdir install<br />
cd install</code></p>
<p>Now build using cmake, using the flags shown below.</p>
<p><code> cmake -DCMAKE_INSTALL_PREFIX=$(path_to_install_loc) -DBUILD_SHARED_LIBS=ON -DENABLE_OPENMP=ON -DENABLE_THREADS=ON ../fftw-3.3.9</code></p>
<p>For example, I downloaded and untarred the source file in `/scratch/wluszczak/fftw/`, and my install prefix was `/scratch/wluszczak/fftw/install/`. In principle this installation prefix can be anywhere you have write access, but for the sake of organization I usually try to keep everything in one place.</p>
<p>Once you have configured cmake, go ahead and install:</p>
<p><code> make install -j $(nproc)</code></p>
<p>Where $(nproc) is the number of threads you want to use. On OSC I used $(nproc)=4 for compiling the ANITA tools and it finished in a reasonable amount of time.</p>
<p>Once this has finished, cd to your install directory and remove everything except the `include` and `lib64` folders:</p>
<p><code> cd $(path_to_install_dir) #You might already be here if you never left<br />
rm *<br />
rm -r CMakeFiles</code></p>
<p>Now we need to rebuild with slightly different flags:</p>
<p><code> cmake -DCMAKE_INSTALL_PREFIX=$(path_to_install_loc) -DBUILD_SHARED_LIBS=ON -DENABLE_OPENMP=ON -DENABLE_THREADS=ON -DENABLE_FLOAT=ON ../fftw-3.3.9<br />
make install -j $(nproc)</code></p>
<p>At the end of the day, your fftw install directory should have the following files:</p>
<p><code> include/fftw3.f <br />
include/fftw3.f03<br />
include/fftw3.h <br />
include/fftw3l.f03 <br />
include/fftw3q.f03 <br />
lib64/libfftw3f.so <br />
lib64/libfftw3f_threads.so.3 <br />
lib64/libfftw3_omp.so.3.6.9 <br />
lib64/libfftw3_threads.so<br />
lib64/libfftw3f_omp.so <br />
lib64/libfftw3f.so.3 <br />
lib64/libfftw3f_threads.so.3.6.9 <br />
lib64/libfftw3.so <br />
lib64/libfftw3_threads.so.3<br />
lib64/libfftw3f_omp.so.3 <br />
lib64/libfftw3f.so.3.6.9 <br />
lib64/libfftw3_omp.so <br />
lib64/libfftw3.so.3 <br />
lib64/libfftw3_threads.so.3.6.9<br />
lib64/libfftw3f_omp.so.3.6.9 <br />
lib64/libfftw3f_threads.so <br />
lib64/libfftw3_omp.so.3 <br />
lib64/libfftw3.so.3.6.9</code></p>
<p>Once fftw has been installed, export your install directory (the one with the include and lib64 folders) to the following environment variable:</p>
<p><code> export FFTWDIR=$(path_to_install_loc)</code></p>
<p>Now you should be able to cd to your anitaBuildTools directory (or pueoBuilder directory) and run their associated build scripts:</p>
<p><code> ./buildAnita.sh</code></p>
<p>or:</p>
<p><code> ./pueoBuilder.sh</code></p>
<p>And hopefully your tools will magically compile (or at least, you'll get a new set of errors that are no longer related to this problem).</p>
<p>If you're running into an error that looks like:<br />
<code> <br />
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.<br />
Please set them or make sure they are set and tested correctly in the CMake files:<br />
FFTWF_LIB (ADVANCED)</code></p>
<p>then pueoBuilder/anitaBuildTools can't seem to find your fftw installation (or files that are supposed to be included in that installation), try rebuilding FFTW with different flags according to which files it seems to think are missing.</p>
<p>If it seems like pueoBuilder can't seem to find your FFTW installation at all (i.e. you're getting some error that looks like <code>missing: FFTW_LIBRARIES</code> or <code>missing: FFTW_INCLUDES</code>, check the environment variables that are supposed to point to your local FFTW installation (`$FFTWDIR`) and make sure there are the correct files in the `lib` and `include` subdirectories. </p> |