<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>I found the solution for getting rid of that configure error
(when ifx is the Fortran compiler) in fftw 3.10 by using
autoreconf version 2.70 or higher (see below):<br>
</p>
<p><a class="moz-txt-link-freetext" href="https://www.intel.com/content/www/us/en/developer/articles/release-notes/oneapi-fortran-compiler-release-notes.html#solution-for-package-maintainers">https://www.intel.com/content/www/us/en/developer/articles/release-notes/oneapi-fortran-compiler-release-notes.html#solution-for-package-maintainers</a><strong><br>
</strong></p>
<p><strong>Configure Script Reports: "linking to Fortran libraries
from C fails"</strong></p>
<p><strong>Symptom</strong></p>
<p>When compiling with ifx, a <span class="code-simple">./configure</span> script
generated by GNU Autconf reports an error message similar to:</p>
<p><span class="code-simple"> checking for Fortran 77 libraries
of ifx... -loopopt=0 -L/lib/../lib64 -L/lib/../lib64/
-L/usr/lib/../lib64 -L/usr/lib/../lib64/ -L/lib64 -L/lib/
-L/usr/lib64 -L/usr/lib -lifport -lifcoremt -limf -lsvml -lm
-lipgo -lirc -lpthread -lirc_s -ldl<br>
configure: WARNING: FLIBS does not work<br>
checking for ifx flag to add single underscore to external
names... none<br>
checking for dummy main to link with Fortran 77 libraries...
unknown<br>
configure: error: in '/path/to/build/dir':<br>
configure: error: linking to Fortran libraries from C fails<br>
See `config.log' for more details<br>
make: *** [build/config.status] Error 1</span></p>
<p>Examining the <span class="code-simple">config.log</span> file
shows that the error causing <span class="code-simple">./configure</span> to
exit was:</p>
<p><span class="code-simple"> ld: cannot find -loopopt=0</span></p>
<p><strong>Problem </strong></p>
<p>In trying to determine libraries needed to link Fortran code with
C or C++ code, GNU Autoconf 2.69 and earlier mistakenly interprets
<span class="code-simple">-loopopt=0</span> in <span
class="code-simple">-mllvm -loopopt=0</span> in verbose compiler
output as a linker flag. GNU Autoconf then adds <span
class="code-simple">-loopopt=0</span> to the FLIBS variable,
which is passed to the linker. The linker then looks for a
non-existent library causing the test to fail.</p>
<p><strong>Solution for Users Downloading Source Code</strong></p>
<p>Please inform the maintainers of packages impacted by this error
about the problem and refer them to this release note. Projects
vary in how they handle configure scripts; however, some general
rules apply. Users who need a solution before the package
maintainer can respond can update the configure script themselves.
The difficulty of updating depends on how the package is
distributed.</p>
<p>To update, first, install GNU Autoconf-2.70 or newer, as
described in <a
href="https://www.intel.com/content/www/us/en/developer/articles/release-notes/oneapi-fortran-compiler-release-notes.html#solution-for-package-maintainers">Solution
for Package Maintainers</a>, below.</p>
<p>After installing the updated autoconf in the user's path,
packages that distribute the <span class="code-simple">configure.ac</span>
file along with the <span class="code-simple">configure</span>
script can be updated simply by running:</p>
<p><span class="code-simple"> autoreconf -if</span></p>
<p>The resulting <span class="code-simple">configure</span> script
should complete without the above error in FLIBS.</p>
<p>It is not uncommon for project maintainers to remove the <span
class="code-simple">configure.ac</span> file from a source
distribution in a tar or zip archive. In that case, the user
usually needs to download the project from its code repository,
and build according to the project's instructions. Sometimes a
version of the <span class="code-simple">configure</span> script
is committed to version control and not automatically regenerated.
In that case, either running <span class="code-simple">autoreconf
-if</span> as described above, or deleting the configure script
often trigger it to be regenerated. Ideally, documentation for
the project will describe how to rebuild the <span
class="code-simple">configure</span> script.</p>
<p><br>
</p>
<p></p>
<div class="moz-cite-prefix">Am 05.01.2025 um 15:37 schrieb Michael
Fechtelkord via Wien:<br>
</div>
<blockquote type="cite"
cite="mid:a52c8c02-3717-4c20-8481-2a05eee031e9@ruhr-uni-bochum.de">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p>The problem seems to be that FFTW configure if using ifx as
default Fortran compiler does not know how to link C and FORTRAN
and then it uses default Fortran wrappers. Setting ifort as
default, configure finds all links. <br>
</p>
<p>I copy here the essential output for both ifort and ifx:</p>
<p><br>
</p>
<p>ifx:</p>
<p>checking for Fortran 77 libraries of ifx... -lm -loopopt=1
-L/opt/intel/oneapi/tbb/2021.13/env/../lib/intel64/gcc4.8
-L/opt/intel/oneapi/mpi/2021.13/lib
-L/opt/intel/oneapi/mkl/2024.2/lib/ <br>
-L/opt/intel/oneapi/dpl/2022.6/lib
-L/opt/intel/oneapi/compiler/2024.2/lib
-L/opt/intel/oneapi/compiler/2024.2/lib/clang/19/lib/x86_64-unknown-linux-gnu
<br>
-L/usr/lib64/gcc/x86_64-suse-linux/13/
-L/usr/lib64/gcc/x86_64-suse-linux/13/../../../../lib64
-L/usr/lib64/gcc/x86_64-suse-linux/13/../../../../lib64/
-L/lib/../lib64 -L/lib/../lib64/ -L/usr/lib/../lib64 <br>
-L/usr/lib/../lib64/
-L/opt/intel/oneapi/tbb/2021.13/env/../lib/intel64/gcc4.8/
-L/opt/intel/oneapi/mpi/2021.13/lib/
-L/opt/intel/oneapi/dpl/2022.6/lib/
-L/opt/intel/oneapi/compiler/2024.2/lib/ <br>
-L/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/lib/
-L/usr/lib64/gcc/x86_64-suse-linux/13/../../../ -L/lib64 -L/lib/
-L/usr/lib64 <br>
-L/usr/lib -limf -lifport -lifcoremt -lsvml -lipgo -lirc
-lpthread -lirc_s -ldl<br>
checking for dummy main to link with Fortran 77 libraries...
unknown<br>
<b>configure: WARNING: *** Couldn't figure out how to link C and
Fortran; using default Fortran wrappers.</b><br>
checking for OpenMP flag of C compiler... -fopenmp<br>
checking whether a cycle counter is available... yes<br>
checking that generated files are newer than configure... done</p>
<p>ifort:</p>
<p>checking for Fortran 77 libraries of ifort...
-L/opt/intel/oneapi/tbb/2021.13/env/../lib/intel64/gcc4.8
-L/opt/intel/oneapi/mpi/2021.13/lib
-L/opt/intel/oneapi/mkl/2024.2/lib/ <br>
-L/opt/intel/oneapi/dpl/2022.6/lib
-L/opt/intel/oneapi/compiler/2024.2/lib
-L/opt/intel/oneapi/compiler/2024.2/bin/../lib
-L/opt/intel/oneapi/compiler/2024.2/bin/../opt/compiler/lib <br>
-L/usr/lib64/gcc/x86_64-suse-linux/13/
-L/usr/lib64/gcc/x86_64-suse-linux/13/../../../../lib64
-L/usr/lib64/gcc/x86_64-suse-linux/13/../../../../lib64/
-L/lib/../lib64 -L/lib/../lib64/ -L/usr/lib/../lib64 <br>
-L/usr/lib/../lib64/
-L/opt/intel/oneapi/tbb/2021.13/env/../lib/intel64/gcc4.8/
-L/opt/intel/oneapi/mpi/2021.13/lib/
-L/opt/intel/oneapi/dpl/2022.6/lib/
-L/opt/intel/oneapi/compiler/2024.2/lib/ <br>
-L/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/lib/
-L/usr/lib64/gcc/x86_64-suse-linux/13/../../../ -L/lib64 -L/lib/
-L/usr/lib64 <br>
-L/usr/lib -limf -lm -lifport -lifcoremt -lsvml -lipgo -lirc
-lpthread -lirc_s -ldl<br>
checking for dummy main to link with Fortran 77 libraries...
none<br>
checking for Fortran 77 name-mangling scheme... lower case,
underscore, no extra underscore<br>
checking for OpenMP flag of C compiler... -fopenmp<br>
checking for Win32 threads... no<br>
checking for the pthreads library -lpthreads... no<br>
checking whether pthreads work without any flags... yes<br>
checking for joinable pthread attribute...
PTHREAD_CREATE_JOINABLE<br>
checking if more special flags are required for pthreads... no<br>
checking whether a cycle counter is available... yes<br>
checking that generated files are newer than configure... done<br>
</p>
<p>Best regards,</p>
<p>Michael<br>
</p>
<pre wrap="" class="moz-quote-pre">
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Dr. Michael Fechtelkord
Institut für Geologie, Mineralogie und Geophysik
Ruhr-Universität Bochum
Universitätsstr. 150
D-44780 Bochum
Phone: +49 (234) 32-24380
Fax: +49 (234) 32-04380
Email: <a class="moz-txt-link-abbreviated" href="mailto:Michael.Fechtelkord@ruhr-uni-bochum.de">Michael.Fechtelkord@ruhr-uni-bochum.de</a>
Web Page: <a class="moz-txt-link-freetext" href="https://www.ruhr-uni-bochum.de/kristallographie/kc/mitarbeiter/fechtelkord/">https://www.ruhr-uni-bochum.de/kristallographie/kc/mitarbeiter/fechtelkord/</a>
</pre>
</body>
</html>