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

PostQE is now building with CMake, removed the QE download. #5

Merged
merged 10 commits into from
Jun 9, 2023

Conversation

enricosiagri
Copy link
Collaborator

@enricosiagri enricosiagri commented May 23, 2023

PostQE is now building with CMake

  • Now you MUST specify the QE_TOPDIR variable which means you need to have QE downloaded somewhere

  • Some files in the build/temp*/postqe-fortran folder have been rearranged.

  • The Makefile responsible for the f90utils module has been renambed f90utils_Makefile

  • The Makefile responsibile for the pyqe module has been renamed pyqe_Makefile

  • The pyqe_Makefile has been modified to link the libraries and include the modules files generated by CMake

  • For now the F90 variable in the pyqe_Makefile has been hardcoded to gfortran (since the following command is using the -E flag)

  • The setup.py file has been modified to use cmake.

  • The setupy.py _build_pyqe_module now also search for the FFT, LAPACK and BLAS libraries paths in the CMakeCache.txt file generated by CMake which are then passed when calling cmake on pyqe_Makefile

  • The compilation is done using the target qe_pp which probably is compiling more stuff that what is actually needed

Tested installation process:

  • python 3.8 (with newer python versions there are some errors)
  • QE 7.2
  • latest ASE, numpy and qeschemas packages
pip install -r requirements.txt
QE_TOPDIR=/path/to/your/qe_source_code python setup.py install

@enricosiagri enricosiagri requested a review from brunato May 23, 2023 12:18
@brunato
Copy link
Collaborator

brunato commented May 23, 2023

I was not able to install using the gfortran compiler. In particular fftw libs were not detected by cmake. After installing fftw-devel package the fftw libs has been detected and the installation works.

@brunato
Copy link
Collaborator

brunato commented May 23, 2023

With Python 3.11 running the tests produce this error:

$ python tests/test_postqe.py 
Traceback (most recent call last):
  File "/home/brunato/Development/postqe/tests/test_postqe.py", line 19, in <module>
    from postqe import EspressoCalculator, PostqeCalculator, get_band_structure
  File "/home/brunato/.virtualenvs/postqe-dev/lib/python3.11/site-packages/postqe/__init__.py", line 11, in <module>
    from .calculator import EspressoCalculator, PostqeCalculator
  File "/home/brunato/.virtualenvs/postqe-dev/lib/python3.11/site-packages/postqe/calculator.py", line 11, in <module>
    from modulefinder import EXTENDED_ARG
ImportError: cannot import name 'EXTENDED_ARG' from 'modulefinder' (/usr/lib64/python3.11/modulefinder.py)

Trying with Python 3.8 works but many tests fails.

@enricosiagri
Copy link
Collaborator Author

enricosiagri commented May 23, 2023 via email

@enricosiagri
Copy link
Collaborator Author

from modulefinder import EXTENDED_ARG
ImportError: cannot import name 'EXTENDED_ARG' from 'modulefinder' (/usr/lib64/python3.11/modulefinder.py)

I commented out the import of EXTENDED_ARGS as it was imported but never used. Now it shoudl work with python 3.11

@enricosiagri
Copy link
Collaborator Author

I was not able to install using the gfortran compiler. In particular fftw libs were not detected by cmake. After installing fftw-devel package the fftw libs has been detected and the installation works.

Yes, I think, this might be a problem related to how I parsed the CMakeCache.txt file. I assumed that the LIBRARY PATHS where always displayed in the same way. We will fix it.

@brunato
Copy link
Collaborator

brunato commented May 24, 2023

from modulefinder import EXTENDED_ARG
ImportError: cannot import name 'EXTENDED_ARG' from 'modulefinder' (/usr/lib64/python3.11/modulefinder.py)

I commented out the import of EXTENDED_ARGS as it was imported but never used. Now it shoudl work with python 3.11

Maybe remove instead, if it's not used it's useless ...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add QE source f90 files to postqe repo?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that file comes directly from QE source, it was probably changed and adapted

Copy link
Collaborator

@brunato brunato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe some changes are needed.

pietrodelugas and others added 8 commits May 30, 2023 17:35
1. refactoring get_eigenvalues for efficiency:
   * all eigenvalues are read from xml and chached in an array
   * get_eigevalues retrieves a slice of the cache array

2. If schema is not provided in input the calculator looks for the
   data-file-schema.xml file and fetches the schema indicated therein
forgotten things about calculator
@brunato brunato merged commit 16f0f2c into develop Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants