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

Building TEM with cmake-built QE not supported #468

Open
elcorto opened this issue Jul 27, 2023 · 0 comments
Open

Building TEM with cmake-built QE not supported #468

elcorto opened this issue Jul 27, 2023 · 0 comments

Comments

@elcorto
Copy link
Member

elcorto commented Jul 27, 2023

mala/external_modules/total_energy_module/build_total_energy_module.sh needs to be adapted to work with a QE built with cmake. Note that the traditional configure + make works, this is just for documenting the issue.

Below are the build steps (HZDR hemera cluster) and things that need to be fixed.

$ srun --time=02:00:00 -A haicu -p haicu_a100,gpu,defq -n16 --pty bash -l -i
$ ml gcc/7.3.0 openmpi/4.1.1 fftw/3.3.10-ompi411 cmake/3.26.1 openblas/haswell/0.3.6

$ cd soft/git
$ git clone git@gitlab.com:QEF/q-e.git
$ cd q-e
$ git checkout qe-7.2
$ rm -rf build
$ find . -regextype posix-extended -regex '.+\.(so|o|a|mod)$' | xargs rm
$ mkdir build
$ cd build
$ cmake ../ -DCMAKE_Fortran_COMPILER=mpif90 -DCMAKE_C_COMPILER=gcc -DBUILD_SHARED_LIBS=yes -DQE_FFTW_VENDOR=FFTW3 -DBLA_VENDOR=OpenBLAS
$ make -j16 pw
$ ctest -j16

Check lib paths.

$ grep -E '^(LAPACK|BLAS|FFTW)' CMakeCache.txt | grep -v :INTERNAL
BLAS_openblas_LIBRARY:FILEPATH=/trinity/shared/pkg/numlib/openblas/0.3.6/haswell/gcc/7.3.0/lib/libopenblas.so
FFTW3_DOUBLE:FILEPATH=/trinity/shared/pkg/numlib/fftw/3.3.10/gcc/7.3.0/openmpi/4.1.1/lib/libfftw3.so
FFTW3_INCLUDE_DIRS:PATH=/trinity/shared/pkg/numlib/fftw/3.3.10/gcc/7.3.0/openmpi/4.1.1/include
LAPACK_openblas_LIBRARY:FILEPATH=/trinity/shared/pkg/numlib/openblas/0.3.6/haswell/gcc/7.3.0/lib/libopenblas.so

Adapt build_total_energy_module.sh

linalg="-L/trinity/shared/pkg/numlib/openblas/0.3.6/haswell/gcc/7.3.0/lib/ -I/trinity/shared/pkg/numlib/openblas/0.3.6/haswell/gcc/7.3.0/include/ -lopenblas"
fftw="-L/trinity/shared/pkg/numlib/fftw/3.3.10/gcc/7.3.0/openmpi/4.1.1/lib/ -I/trinity/shared/pkg/numlib/fftw/3.3.10/gcc/7.3.0/openmpi/4.1.1/include -lfftw3"

Issues:

  • all compiled object files are in q-e/build, need to adapt paths in build_total_energy_module.sh
  • using $root_dir/build instead of $root_dir is not enough, e.g. there is no $root_dir/build/PW/src
  • check if all linker -L and and include -I paths need to be adapted
  • not sure where to copy the src=${mod_name}.f90 file as we do in cp -v $src $pw_src_path/ where $pw_src_path=$root_dir/PW/src
  • $root_dir/XClib/xc_lib.a is not build, also not in $root_dir/build/XClib, what to link instead?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant