Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIEN2k 24.1 #455

Open
boegel opened this issue Nov 14, 2024 · 5 comments · May be fixed by easybuilders/easybuild-easyconfigs#22133
Open

WIEN2k 24.1 #455

boegel opened this issue Nov 14, 2024 · 5 comments · May be fixed by easybuilders/easybuild-easyconfigs#22133
Assignees
Labels
difficulty: easy software that should be easy to support priority: ASAP site:t1_ugent_hortense Software installation request for Tier-1 Hortense site:ugent Software installation request for UGent Tier-2 sources-only Only sources available (no conda, binaries, container) update

Comments

@boegel
Copy link
Contributor

boegel commented Nov 14, 2024

  • link to support ticket: #2024110860000772
  • website: https://www.wien2k.at
  • installation docs: (see existing easyconfigs for WIEN2k)
  • toolchain: intel/2023a (or newer)
  • easyblock to use: (see existing easyconfigs for WIEN2k)
  • required dependencies:
    • (see existing easyconfigs for WIEN2k)
  • notes:
    • update of WIEN2k-23.2-intel-2021b.eb
    • this is licensed software, so sources are not freely available
  • effort: (TBD)
  • other install methods
    • conda: no
    • container image: no
    • pre-built binaries (RHEL8 Linux x86_64): no
    • easyconfig outside EasyBuild: no
@boegel boegel added difficulty: easy software that should be easy to support priority: high update site:ugent Software installation request for UGent Tier-2 site:t1_ugent_hortense Software installation request for Tier-1 Hortense sources-only Only sources available (no conda, binaries, container) labels Nov 14, 2024
@PetrKralCZ PetrKralCZ self-assigned this Nov 14, 2024
PetrKralCZ added a commit that referenced this issue Nov 19, 2024
PetrKralCZ added a commit that referenced this issue Nov 27, 2024
@boegel
Copy link
Contributor Author

boegel commented Dec 17, 2024

@PetrKralCZ What's the status of this?

PetrKralCZ added a commit that referenced this issue Dec 17, 2024
@boegel
Copy link
Contributor Author

boegel commented Dec 17, 2024

siteconfig_lapw output includes:

 Your LIBXC options are:    -DLIBXC -I/scratch/gent/vo/001/gvo00117/easybuild/RHEL8/cascadelake-ampere-ib/software/libxc/6.2.2-intel-compilers-2023.1.0/include/
 Your LIBXC libraries are:  -L/scratch/gent/vo/001/gvo00117/easybuild/RHEL8/cascadelake-ampere-ib/software/libxc/6.2.2-intel-compilers-2023.1.0/lib// -lxcf03 -lxc

But linking of lapw0_mpi fails with errors like:

ld: libxc_mod.o: in function `libxc_mod_mp_libxc_end_':
libxc_mod.F:(.text+0x67): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_end_'
ld: libxc_mod.F:(.text+0xc2): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_end_'

because -lxcf03 -lxc is not actually being used for some reason?!

@boegel
Copy link
Contributor Author

boegel commented Jan 6, 2025

@PetrKralCZ Can you give a status update on this (incl. an estimate of how much time you've spent on this already)?

@PetrKralCZ
Copy link
Collaborator

PetrKralCZ commented Jan 6, 2025

I spent about 5 days on WIEN2k already.
The problem I am having now is the following:
The only binary (out of 19) which fails to build is lapw0_mpi because for some reason the flags -lxcf03 -lxc are not included in the compile command.
In the Makefile.ifort it seems the compile commands for lapw0 and lapw0_mpi should end the same way:
Note that R_LIBS have nothing to do with the R language. It stands for "real libraries" in here.

R_LIBS     = $(FFTW_LIBS) -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core $(LIBXC_LIBS) 
RP_LIBS = $(FFTW_PLIBS) $(R_LIBS) 
...Makefile
$(S_EXEC): $(OBJS)
	$(FORT) -o $(S_EXEC) $(OBJS) $(LDFLAGS) $(R_LIBS)

$(P_EXEC): $(OBJS)
	$(FORT) -o $(P_EXEC) $(OBJS) $(LDFLAGS)  $(RP_LIBS) 

But they don't:

@@ -1,6 +1,6 @@
-ifort
+mpiifort
 -o
-./lapw0
+./lapw0_mpi
 cputim.o
 modules.o
 libxc_mod.o
@@ -181,9 +181,22 @@
 -L/apps/gent/RHEL8/cascadelake-ib/software/Python/3.11.3-GCCcore-12.3.0/lib
 -L/apps/gent/RHEL8/cascadelake-ib/software/imkl/2023.1.0/mkl/2023.1.0/lib/intel64
 -L/apps/gent/RHEL8/cascadelake-ib/software/intel-compilers/2023.1.0/compiler/2023.1.0/linux/compiler/lib/intel64
--L/scratch/gent/vo/001/gvo00117/easybuild/RHEL8/cascadelake-ampere-ib/software/FFTW/3.3.10-intel-compilers-2023.1.0/lib64
+
+-lfftw3_mpi
+
+-lfftw3_mpi
 -lfftw3
--lfftw3_omp
+-Wl,-Bdynamic
+-Wl,--start-group
+-lmkl_scalapack_lp64
+-lmkl_blacs_intelmpi_lp64
+-lmkl_intel_lp64
+-lmkl_intel_thread
+-lmkl_core
+-Wl,--end-group
+-Wl,-Bdynamic
+-liomp5
+-lpthread
 -Wl,-Bdynamic
 -Wl,--start-group
 -lmkl_intel_lp64
@@ -193,7 +206,3 @@
 -Wl,-Bdynamic
 -liomp5
 -lpthread
--qopenmp
--L/scratch/gent/vo/001/gvo00117/easybuild/RHEL8/cascadelake-ampere-ib/software/libxc/6.2.2-intel-compilers-2023.1.0/lib/
--lxcf03
--lxc

I guess the only thing which is modifying those env vars is the wien2k.py easyblock here:

# libraries
liblapack = os.getenv('LIBLAPACK_MT').replace('static', 'dynamic')
libscalapack = os.getenv('LIBSCALAPACK_MT').replace('static', 'dynamic')
rlibs = "%s %s" % (liblapack, self.toolchain.get_flag('openmp'))
rplibs = [libscalapack, liblapack]
fftwver = get_software_version('FFTW')
if fftwver:
    suff = ''
    if LooseVersion(fftwver) >= LooseVersion("3"):
        suff = '3'
    rplibs.insert(0, "-lfftw%(suff)s_mpi -lfftw%(suff)s" % {'suff': suff})
else:
    rplibs.append(os.getenv('LIBFFT'))

rplibs = ' '.join(rplibs)

vars = {
    'FC': '%s' % os.getenv('F90'),
    'FOPT': '%s' % os.getenv('FFLAGS'),
    'MPF': '%s' % os.getenv('MPIF90'),
    'FPOPT': '%s' % os.getenv('FFLAGS'),
    'CC': os.getenv('CC'),
    'LDFLAGS': '$(FOPT) %s ' % os.getenv('LDFLAGS'),
    'R_LIBS': rlibs,  # libraries for 'real' (not 'complex') binary
    'RP_LIBS': rplibs,  # libraries for 'real' parallel binary
    'MPIRUN': '',
}

Note that R_LIBS and rlibs have nothing to do with the R language. It stands for "real libraries" in here.
I would expect this only appends stuff without possibly removing -lxcf03 -lxc but when I comment out the 'R_LIBS': ... line in wien2k.py easyblock, the compile command for lapw0_mpi changes like this:

@@ -184,19 +184,9 @@
 
 -lfftw3_mpi
 
--lfftw3_mpi
+-L/scratch/gent/vo/001/gvo00117/easybuild/RHEL8/cascadelake-ampere-ib/software/FFTW/3.3.10-intel-compilers-2023.1.0/lib64
 -lfftw3
--Wl,-Bdynamic
--Wl,--start-group
--lmkl_scalapack_lp64
--lmkl_blacs_intelmpi_lp64
--lmkl_intel_lp64
--lmkl_intel_thread
--lmkl_core
--Wl,--end-group
--Wl,-Bdynamic
--liomp5
--lpthread
+-lfftw3_omp
 -Wl,-Bdynamic
 -Wl,--start-group
 -lmkl_intel_lp64
@@ -206,3 +196,7 @@
 -Wl,-Bdynamic
 -liomp5
 -lpthread
+-qopenmp
+-L/scratch/gent/vo/001/gvo00117/easybuild/RHEL8/cascadelake-ampere-ib/software/libxc/6.2.2-intel-compilers-2023.1.0/lib/
+-lxcf03
+-lxc

So that line really is responsible for removing linking of xc.
Unfortunately some test cases run after generating the modulefile fail:

== 2024-12-19 13:05:34,323 build_log.py:171 ERROR EasyBuild crashed with an error (at easybuild/easybuild-framework/easybuild/base/exceptions.py:126 in __init__): Failed to find pattern ^:FGL002.*15.*total forces in TiO2.scf (at easybuild/easybuild-easyblocks/easybuild/easyblocks/w/wien2k.py:556 in test_cases_step)

Most of the flags the easyblock adds are duplicite. The only ones necessary to add seem to be -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64. But when trying this:

        # libraries
        liblapack = os.getenv('LIBLAPACK_MT').replace('static', 'dynamic')
        libscalapack = os.getenv('LIBSCALAPACK_MT').replace('static', 'dynamic') 
        rlibs = "%s %s" % (liblapack, self.toolchain.get_flag('openmp'))
        rplibs = [libscalapack, liblapack]
        fftwver = get_software_version('FFTW')
#        if fftwver:
#            suff = ''
#            if LooseVersion(fftwver) >= LooseVersion("3"):
#                suff = '3'
#            rplibs.insert(0, "-lfftw%(suff)s_mpi -lfftw%(suff)s" % {'suff': suff})
#        else:
#            rplibs.append(os.getenv('LIBFFT'))

        rplibs = ' '.join(rplibs)

        vars = {
            'FC': '%s' % os.getenv('F90'),
            'FOPT': '%s' % os.getenv('FFLAGS'),
            'MPF': '%s' % os.getenv('MPIF90'),
            'FPOPT': '%s' % os.getenv('FFLAGS'),
            'CC': os.getenv('CC'),
            'LDFLAGS': '$(FOPT) %s ' % os.getenv('LDFLAGS'),
            'R_LIBS': rlibs,  # libraries for 'real' (not 'complex') binary
            'RP_LIBS': rplibs,  # libraries for 'real' parallel binary
            'MPIRUN': '',
        }

It still makes more changes to the compile command then expected including removing --lxcf03 --lxc.

PetrKralCZ added a commit that referenced this issue Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy software that should be easy to support priority: ASAP site:t1_ugent_hortense Software installation request for Tier-1 Hortense site:ugent Software installation request for UGent Tier-2 sources-only Only sources available (no conda, binaries, container) update
Projects
None yet
2 participants