Enumeration error

Dear Pymatgen community,

I got the error “ValueError: Unable to enumerate” when using EnumerateStructureTransformation on my new Macbook pro. I actually used this class a lot on my old laptop but never saw this error. One of my colleagues also reproduces this error on his new Macbook pro, which makes us think this error is related to the new model or new system. I could be wrong, but I have no idea to resolve this problem at the moment. Any suggestions are welcoming. For your references, I also listed my system configurations and a few things we have tried below.


1. Configuration of the two laptops:

(a) The old laptop (works fine on this laptop):
MacBook Pro (Retina, 13-inch, Early 2015)
Version 10.12.6
Python 3.7.3
(b) The new laptop:
MacBook Pro (13-inch, 2018, Four Thunderbolt 3 Ports)
Version 10.14.4
Python 3.7.3

2. Test code.

The following is a a simple enumeration and its output should be 1. This gives “ValueError: Unable to enumerate” on the new laptop.

from pymatgen import MPRester
from pymatgen.transformations.advanced_transformations import EnumerateStructureTransformation

mp = MPRester()
est = EnumerateStructureTransformation()

cu = mp.get_structure_by_material_id("mp-30")
cu.make_supercell([1, 1, 2])
cu.replace_species({"Cu": {"Cu": 1/2, "Au": 1/2}})

structures = est.apply_transformation(cu, 10)

3. Things we have tried to fix this error

(1) Copying “enum.x” and “makestr.x” from “pymatgen/cmd_line/enum/Darwin_64bit”, which works on old laptop.
(2) Download enumlib repository and compile “enum.x” using gfortran; use “makeStr.py” provided in this repository.
(3) Conda install using “conda install --channel matsci enumlib”
(4) “pmg config --install enumlib”, which is “step 4” on pymatgen documentation page. However, this ended up with some new errors and I didn’t give it a further try. I paste the error message below.

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../symlib/src
make: *** ../symlib/src: No such file or directory.  Stop.
make: *** [pre_comp] Error 2
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../symlib/src
make: *** ../symlib/src: No such file or directory.  Stop.
make: *** [pre_comp] Error 2
[Errno 2] No such file or directory: 'enum.x'


From our side, we do not have a clear idea about where this error is coming from, which could be Pymatgen, enumlib, new mac system, Xcode or from other packages. We may need your suggestions.


Ruby Lee

When you compile enum.x, did you make sure the new version is in your path? Usually if you are able to compile enum.x from the original repo, you should be able to get it to work.

Thanks @shyuep for the prompt reply!
Yes, I always make sure the newest executables are the only ones present on this machine by path checking like “which -a enum.x”. If I further remove the enum.x, I will get another error telling me the executables are not found.

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 generally have no idea what the problem can be. Since my laptop is about the same version as yours, can you download the following and try it? These are compiled fairly recently.