Install CP2K@9.1 with intel compilers

139 views
Skip to first unread message

Yuankun Fu

unread,
Aug 7, 2022, 10:14:54 PM8/7/22
to Spack
Hi,
I am currently having trouble to install cp2k@9.1 with intel-oneap...@2022.1.0 on Rocky Linux 8.5.
I am receiving  
Error: UnboundLocalError: local variable 'fftw_header_dir' referenced before assignment .
Any idea how to solve that? 

Here is my current environment
```
$ spack find
-- linux-rocky8-cascadelake / in...@2021.6.0 --------------------
auto...@2.69 diffutils@3.6 g...@6.2.1 lib...@3.4.2 lib...@2.9.13 pe...@5.34.1 py-w...@0.37.0 x...@5.2.5
auto...@1.16.1 el...@2021.11.001 g...@2.7.1 libi...@1.16 lib...@1.17 pkg...@1.4.2 pyt...@3.9.12 zl...@1.2.12
berke...@18.1.40 ex...@2.4.8 intel-on...@2022.1.0 lib...@2.6.0 m...@1.4.18 plu...@2.8.0 readline@8.1
bo...@1.79.0 ff...@3.3.10 intel-on...@2021.6.0 li...@1.0.4 ncurses@6.2 py-c...@0.29.30 sql...@3.38.5
bz...@1.0.8 gd...@1.19 intel-on...@2021.6.0 lib...@2.4.6 netlib-s...@2.2.0 py-...@21.3.1 t...@1.30
cm...@3.23.1 get...@0.21 lib...@0.11.5 li...@5.1.7 ope...@1.1.1o py-set...@59.4.0 util-li...@2.37.4
```
Here is my command to install
```
spack install intel-oneapi-compilers 
spack install intel-on...@2021.6.0 % intel 
spack install intel-on...@2022.1.0 % intel 
 ICC_VERSION=2021.6.0 
IMPI_VERSION=2021.6.0 
CP2K_VERSION=9.1 
IMPI_SPEC="" 
 spack load intel-oneap...@2022.1.0
 spack load intel-on...@2021.6.0 
 spack load intel-on...@2022.1.0 
spack install cp2k@${CP2K_VERSION} %intel@${ICC_VERSION} +elpa +libint +libxc smm=libxsmm +plumed ^intel-oneapi-mpi@${IMPI_VERSION} ${IMPI_SPEC}
```

Then I passed all the dependent package installations, e.g., libint, libxc, libxsmm, plumed, etc.
When it is try to install cp2k, I am seeing:
==> Installing cp2k-9.1-awtvbqu2o3xhfnkmohiupckpv5kcmgla
==> No binary for cp2k-9.1-awtvbqu2o3xhfnkmohiupckpv5kcmgla found: installing from source
==> Using cached archive: /mnt/home/yuankun/opt/spack-0.18.1/var/spack/cache/_source-cache/archive/fe/fedb4c684a98ad857cd49b69a3ae51a73f85a9c36e9cb63e3b02320c74454ce6.tar.bz2
==> No patches needed for cp2k
==> cp2k: Executing phase: 'edit'
==> Error: UnboundLocalError: local variable 'fftw_header_dir' referenced before assignment

/mnt/home/yuankun/opt/spack-0.18.1/var/spack/repos/builtin/packages/cp2k/package.py:279, in edit:
        276        dflags = ['-DNDEBUG']
        277        cppflags = [
        278            '-D__FFTW3',
  >>    279            '-I{0}'.format(fftw_header_dir),
        280        ]
        281
        282        if '^mpi@3:' in spec:
 
Any idea how to solve it?

Yuankun Fu

unread,
Aug 7, 2022, 10:22:01 PM8/7/22
to Spack
Hi,

I find that the format is not showing correctly. Let me make it clear with the screenshot.
Screen Shot 2022-08-07 at 10.21.24 PM.png

Davide DelVento

unread,
Aug 15, 2022, 10:33:49 AM8/15/22
to Spack
I don't know specifically about this error, but often times these are things you need to patch the source code or add compiler flags to let it be a bit sloppier with standard enforcement. In fact I end up doing both myself all the time, for example the last one I did was for  py-cvxopt v1.2.5 which was lacking parenthesis around macro definitions and gcc 12 refused to compile it.
Reply all
Reply to author
Forward
0 new messages