<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <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>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">Am 05.01.2025 um 12:33 schrieb Michael
      Fechtelkord via Wien:<br>
    </div>
    <blockquote type="cite"
      cite="mid:5441ab2b-24c9-427a-af19-6f9f87f9ecf5@ruhr-uni-bochum.de">LAPW0
      works in my ifx compilation (currently 2024.2 because it still
      contains ifort, gcc is 13.2). When I run the following configure
      for fftw3 and compile: <br>
      <br>
      FC=ifort F77=ifort CC=gcc CFLAGS="-O3 -march=native -mavx2"
      FCFLAGS="-O3 -xAVX2 -diag-disable=10448"\ <br>
        ./configure --prefix=/usr/local/ --enable-shared --enable-mpi
      --enable-openmp --enable-threads --enable-avx --enable-avx2 <br>
      <br>
      <br>
      there is no compilation error for 3ddens. Do I change to <br>
      <br>
      FC=ifx F77=ifx CC=gcc CFLAGS="-O3 -march=native -mavx2"
      FCFLAGS="-O3 -xAVX2"\ <br>
        ./configure --prefix=/usr/local/ --enable-shared --enable-mpi
      --enable-openmp --enable-threads --enable-avx --enable-avx2 <br>
      <br>
      I got the error for 3ddens in compilation: <br>
      <br>
      <br>
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld:
      3ddens.o: in function `MAIN__': <br>
      ifxim7AOm.i:(.text+0x4fe9): undefined reference to
      `dfftw_init_threads_' <br>
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld:
      ifxim7AOm.i:(.text+0x5004): undefined reference to
      `dfftw_plan_with_nthreads_' <br>
      <br>
      make: *** [Makefile:65: 3ddens] Fehler 1 <br>
      <br>
      FFTW uses also a fortran part, except you switch it of with <br>
      <br>
      --disable-fortran: Disables inclusion of legacy-Fortran wrapper
      routines (see <br>
      Chapter 8 [Calling FFTW from Legacy Fortran], page 87) in the
      standard FFTW <br>
      libraries. These wrapper routines increase the library size by
      only a negligible amount, <br>
      so they are included by default as long as the configure script
      finds a Fortran <br>
      compiler on your system. (To specify a particular Fortran compiler
      foo, pass F77=foo <br>
      to configure.) <br>
      <br>
      <br>
      So it is possible that the problem is due to different wrappers
      when I specify ifort or ifx as particular Fortran compiler. <br>
      <br>
      <br>
      Best regards, <br>
      <br>
      Michael <br>
      <br>
      <br>
      <br>
      <br>
      Am 05.01.2025 um 09:49 schrieb Fecher, Gerhard: <br>
      <blockquote type="cite">Sorry, ifort was a typo,  fftw3 is pure
        C++ library and does not need any Fortran compiler <br>
        I used for fftw3 both the old icc and the new icx, without
        observing any remarkable difference during run-time.. <br>
        (I iused icx (instead of gcc) already since the 2023 OneAPI
        without problems) <br>
        For ifx (or ifort)   the Fortran wrappers for fftw are in the
        OneAPI include directories <br>
        (for gnu you probably may need the switch --with-g77-wrappers in
        configure) <br>
        <br>
        I wonder why in your case 3ddens fails, but lapw0 succeeds (does
        it ?) <br>
        <br>
        Ciao <br>
        Gerhard <br>
        <br>
        DEEP THOUGHT in D. Adams; Hitchhikers Guide to the Galaxy: <br>
        "I think the problem, to be quite honest with you, <br>
        is that you have never actually known what the question is." <br>
        <br>
        ==================================== <br>
        Dr. Gerhard H. Fecher <br>
        Institut of Physics <br>
        Johannes Gutenberg - University <br>
        55099 Mainz <br>
        ________________________________________ <br>
        Von: Wien [<a
          class="moz-txt-link-abbreviated moz-txt-link-freetext"
          href="mailto:wien-bounces@zeus.theochem.tuwien.ac.at">wien-bounces@zeus.theochem.tuwien.ac.at</a>]
        im Auftrag von Michael Fechtelkord via Wien [<a
          class="moz-txt-link-abbreviated moz-txt-link-freetext"
          href="mailto:wien@zeus.theochem.tuwien.ac.at">wien@zeus.theochem.tuwien.ac.at</a>]
        <br>
        Gesendet: Samstag, 4. Januar 2025 19:49 <br>
        An: A Mailing list for WIEN2k users <br>
        Cc: Michael Fechtelkord <br>
        Betreff: Re: [Wien] ifort classic compiler now discontinued in
        one-api 2025.0 online repositories <br>
        <br>
           Dear Gerhard, <br>
        <br>
        <br>
        thanks for all your hints, they showed no difference. The link
        error <br>
        still occurred. But I saw that you used ifort, instead of ifx
        for <br>
        compiling the fftw3 libraries. And that makes the difference. <br>
        <br>
        When I compile the fftw libraries with ifx and gcc the link
        error occurs <br>
        for 3ddens. When I compile fftw3 with ifort and gcc, no error
        occurs in <br>
        compilation of 3ddens. <br>
        <br>
        I have no idea where the difference is. <br>
        <br>
        In the 2025 oneapi version ifort and icc do not exist any longer
        and <br>
        people cannot use it to compile the fftw3 library. So we have
        now to <br>
        find out what ifort does different compared to ifx when it
        compiles the <br>
        fftw3 code concerning intel threading. <br>
        <br>
        <br>
        Thanks again for your help and happy new year! <br>
        <br>
        <br>
        Best regards, <br>
        <br>
        Michael <br>
        <br>
        <br>
        Am 31.12.2024 um 17:42 schrieb Fecher, Gerhard: <br>
        <blockquote type="cite">Dear Michael, <br>
          as I reported before all routines were successfully compiled
          using <br>
          current:FOPT:-free  -O2 -xHost -fp-model=strict -DINTEL_VML
          -traceback -assume buffered_io -I$(MKLROOT) <br>
          or <br>
          current:FOPT:-free -w -O3 -xHost -fp-model=precise -DINTEL_VML
          -traceback -assume buffered_io -I$(MKLROOT) <br>
          <br>
          the only remaining problem (after updated some routines
          according to Preter and Gavin) that remained is tthat <br>
               lapw0 does not run (produces a segmentation fault) when
          setting OMP_NUM_THREADS other than 1,  however setting of
          MKL_NUM_THREADS works <br>
          (this still remains when using the update of charge.f as
          suggested by Laurence) <br>
          <br>
          In my case  3ddens has no problems with fftw3 <br>
          I suggest to use a local directory for it in your home
          directory, I had problems at runtime with fftw3 from the
          OpenSuse repositories installed in /usr/lib64 <br>
          I also suggest to start with less optimization switches when
          making fftw3 <br>
          I guess you better use  only one of --enable-openmp
          --enable-threads and you should check that make uses intel
          threading <br>
          maybe your configure is not complete and you need also to set
          a correct LD <br>
          I compiled it with ifort and icc <br>
          I used at least something like <br>
               configure --prefix=/myhomepath/lib/FFTW3 \ <br>
               CC=icc CFLAGS="-O3 -xHost -diag-disable=10441" \ <br>
               --enable-shared --enable-openmp <br>
          and for mpi in addition: <br>
              MPICC=mpiicc  --enable-mpi  LDFLAGS=-L/path/to/mpi/libs
          CPPFLAGS=-I/path/to/mpi/include ...’ <br>
          <br>
          check the available configuration switches using configure
          --help=short <br>
          If making different optimized versions, you can also give a
          version --comand-suffix=SUFFIX <br>
          <br>
          for lapw0 you can check wether you use the correct fftw3
          using: ldd lapw0 <br>
          is it the one you intended to be used ? Check also your
          LD_LIBRARY_PATH <br>
          <br>
          <br>
          Ciao <br>
          Gerhard <br>
          <br>
          DEEP THOUGHT in D. Adams; Hitchhikers Guide to the Galaxy: <br>
          "I think the problem, to be quite honest with you, <br>
          is that you have never actually known what the question is." <br>
          <br>
          ==================================== <br>
          Dr. Gerhard H. Fecher <br>
          Institut of Physics <br>
          Johannes Gutenberg - University <br>
          55099 Mainz <br>
        </blockquote>
      </blockquote>
    </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 moz-txt-link-freetext"
    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>