[CP2K-user] CP2K compile error undefined reference

h...@gmail.com hf.... at gmail.com
Fri Jan 8 09:07:38 UTC 2021


Hello Teri,

thank you for posting into the CP2K forum!

I had a quick look into your ARCH-file, and found it somewhat inconsistent. 
At least your LIBS variable (line #78) is worrisome, it not only contains 
several libraries (-l) that are not given by directory (-L) but also 
somewhat contradictory combinations, e.g., -lscalapack and MKL (which 
usually delivers ScaLapack as well), same goes for -lfftw3_mpi -lfftw3 
-lfftw3_omp (which is part of MKL as well), and also -lxsmmf -lxsmm vs. 
-lsmm_dnn. Some of the libraries are not enabled at build-time, e.g., 
-lxsmmf -lxsmm should correspond with -D__LIBXSMM (DFLAGS). If you want to 
use the Intel Compiler etc., you may start with 
arch/Linux-x86-64-intel-minimal.psmp. Of course, this minimal ARCH-file 
lacks some of the libraries that are typically desired (but still optional 
libraries hence it is called minimal ARCH-file). You may also look into 
arch/Linux-x86-64-intel-regtest.psmp, which contains more of the desired 
libraries.

( Please note, I did not check if your reported issue is also present in 
case of a valid ARCH-file. )

Best wishes,
Hans

el... at ucsd.edu schrieb am Freitag, 8. Januar 2021 um 06:03:50 UTC+1:

> Hi,
>
> I am compiling CP2K and pretty far into the compilation,  I get the error 
> below: (the full error and my arch file are attached)
>
> /p/work1/elambros/cp2k/lib/Linux-x86-64-intel-minimal/psmp/exts/dbcsr/libdbcsr.a(dbcsr_machine_internal.o): 
> In function `dbcsr_machine_internal_mp_m_getlog_':
> /p/work1/elambros/cp2k/exts/dbcsr/src/base/dbcsr_machine_posix.f90:318: 
> undefined reference to `for_getenv_err'
> /p/work1/elambros/cp2k/exts/dbcsr/src/base/dbcsr_machine_posix.f90:321: 
> undefined reference to `for_getenv_err'
> /p/work1/elambros/cp2k/lib/Linux-x86-64-intel-minimal/psmp/exts/dbcsr/libdbcsr.a(dbcsr_machine_internal.o): 
> In function `dbcsr_machine_internal_mp_m_getarg_':
> /p/work1/elambros/cp2k/exts/dbcsr/src/base/dbcsr_machine_posix.f90:363: 
> undefined reference to `for_getcmd_arg_err'
> make[3]: *** 
> [/p/work1/elambros/cp2k/exe/Linux-x86-64-intel-minimal/cp2k.psmp] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [psmp] Error 2
> make: *** [all] Error 2
>
> I think this may be related to the "get_environment_variable" and 
> "GET_COMMAND_ARGUMENT" calls in 
> exts/dbcsr/src/base/dbcsr_machine_posix.f90, but I haven't been able to 
> find anything about the "for_getenv_err" and "for_getcmd_arg_err" variables 
> online. I'm not sure if I'm missing a library, or if I've made a silly 
> mistake, but any advice would be appreciated.
>
> My fortran compiler is mpiifort, and my c and c++ compilers are mpiicc and 
> mpiicpc.
>
> Thanks,
> Teri
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20210108/fcd83640/attachment.htm>


More information about the CP2K-user mailing list