GithubHelp home page GithubHelp logo

Comments (4)

ghifi37 avatar ghifi37 commented on June 1, 2024

I found gcc works well by the definition: FC=ifort CC=icc CXX=icpc. Does it mean that gcc can not compile the project?

If I install dftd4-python in /home/gp/anaconda3, "from dftd4.ase import DFTD4" will cause:

Traceback (most recent call last):
File "/home/gp/anaconda3/lib/python3.7/site-packages/dftd4/libdftd4.py", line 32, in
from ._libdftd4 import ffi, lib
ImportError: /home/gp/anaconda3/lib/python3.7/site-packages/dftd4/libdftd4.cpython-37m-x86_64-linux-gnu.so: undefined symbol: iso_c_binding_mp_c_null_ptr

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/home/gp/anaconda3/lib/python3.7/site-packages/dftd4/ase.py", line 86, in
from .interface import DispersionModel, DampingParam
File "/home/gp/anaconda3/lib/python3.7/site-packages/dftd4/interface.py", line 22, in
from .libdftd4 import (
File "/home/gp/anaconda3/lib/python3.7/site-packages/dftd4/libdftd4.py", line 34, in
raise ImportError("dftd4 C extension unimportable, cannot use C-API")
ImportError: dftd4 C extension unimportable, cannot use C-API

If I install dftd4-python in other paths, "from dftd4.ase import DFTD4" will cause:

Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'dftd4'

Conda does not finish install because of the inconsistent libs, pip has compilation errors.
How could I install dftd4-python correctly?

from dftd4.

awvwgk avatar awvwgk commented on June 1, 2024

meson setup _build -Dpython_version=3 -Dfortran_link_args=-qopenmp

The option -qopenmp is specific to Intel Fortran compilers, especially adding the option -Dfortran_link_args=-qopenmp to the configuration step is only required when building against the MKL with Intel 2021. Note that you must build against the MKL-RT library to build a Python extension module, therefore this option is not needed here.

ImportError: /home/gp/anaconda3/lib/python3.7/site-packages/dftd4/libdftd4.cpython-37m-x86_64-linux-gnu.so: undefined symbol: iso_c_binding_mp_c_null_ptr

It looks like you are mixing up an Intel compiled binary with a GCC compiled binary, the Fortran runtime will mismatch and therefore you can't find the required symbols. It is important to use the matching C compiler to compile the Python extension module you used for compiling the Fortran library.

from dftd4.

ghifi37 avatar ghifi37 commented on June 1, 2024

Thank you, Sebastian. It should be because that my compiler configuration was confused as you wrote. I am trying to correct it.

from dftd4.

awvwgk avatar awvwgk commented on June 1, 2024

The build system from DFT-D4 got several improvements since this issue was opened. Feel free to open a new issue if this is still relevant.

from dftd4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.