materialsproject / pymatgen

Python Materials Genomics (pymatgen) is a robust materials analysis code that defines classes for structures and molecules with support for many electronic structure codes. It powers the Materials Project.
https://pymatgen.org
Other
1.51k stars 863 forks source link

enumlib error #1914

Closed haesunpark87 closed 4 years ago

haesunpark87 commented 4 years ago

Describe the bug Error when modules from pymatgen.analysis.magnetism.analyzer are used.

To Reproduce Steps to reproduce the behavior:

  1. execute the following python script

!/usr/bin/env python3 -- coding: utf-8 -- from pymatgen.core import Lattice, Structure from pymatgen.analysis.magnetism.analyzer import *

latt = Lattice.cubic(4.17) species = ["Ni", "O"] coords = [[0.00000, 0.00000, 0.00000], [0.50000, 0.50000, 0.50000]] NiO = Structure.from_spacegroup(225, latt, species, coords) print(NiO)

enumerator = CollinearMagneticStructureAnalyzer(NiO)

enumerator = MagneticStructureEnumerator(NiO,strategies='ferromagnetic')

  1. Then it seems the structure is generated but magnetic analyzing module dose not work

Full Formula (Ni4 O4) Reduced Formula: NiO abc : 4.170000 4.170000 4.170000 angles: 90.000000 90.000000 90.000000 Sites (8) SP a b c 0 Ni 0 0 0 1 Ni 0 0.5 0.5 2 Ni 0.5 0 0.5 3 Ni 0.5 0.5 0 4 O 0.5 0.5 0.5 5 O 0.5 0 0 6 O 0 0.5 0 7 O 0 0 0.5 Illegal instruction (core dumped)

*Expected behavior** A clear and concise description of what you expected to happen.

Screenshots image

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

mkhorton commented 4 years ago

Hi @haesunpark87, this code works for me, a core dump is likely some serious issue with your installation -- have you tried installing pymatgen using conda? Does enumlib work outside of pymatgen? (e.g. if you call enum.x directly?)

haesunpark87 commented 4 years ago

Dear Matthew,

It seems you are right. I ran the following code,

!/usr/bin/env python3

-- coding: utf-8 --

from pymatgen.core import Lattice, Structure from pymatgen.transformations.advanced_transformations import EnumerateStructureTransformation

specie = {"Cu": 0.5, "Au": 0.5} cuau = Structure.from_spacegroup("Fm-3m", Lattice.cubic(3.677), [specie], [[0, 0, 0]])

trans = EnumerateStructureTransformation(max_cell_size=3) ss = trans.apply_transformation(cuau, return_ranked_list=1000)

And the error message saying "RuntimeError: EnumlibAdaptor requires the executables 'enum.x' or 'multienum.x' and 'makestr.x' or 'makeStr.py' to be in the path. Please download the library at http://enum.sourceforge.net/ and follow the instructions in the README to compile these two executables accordingly. “

I have the same error in my desktop and the question is where is the path to put the executables.

Best, Haesun

On Jul 27, 2020, at 7:53 PM, Matthew Horton notifications@github.com wrote:

Hi @haesunpark87 https://github.com/haesunpark87, this code works for me, a core dump is likely some serious issue with your installation -- have you tried installing pymatgen using conda? Does enumlib work outside of pymatgen? (e.g. if you call enum.x directly?)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/materialsproject/pymatgen/issues/1914#issuecomment-664713216, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKN477FDIDHYT2XQKEHJ47TR5YOQNANCNFSM4PJFZ4FA.

mkhorton commented 4 years ago

You can install enumlib following the instructions here: https://github.com/msg-byu/enumlib

You put it into your PATH meaning that it's available when you type a command in a terminal; the specific instructions to do this vary from Linux, Mac, Windows etc.

Will close this issue since it's not a pymatgen bug but good luck!