Voro++ failed due to a: java.lang.Exception: Parsing failed: First line not "Basis:"
I tried to run the code from this paper: "Including crystal structure attributes in machine learning models of formation energies via Voronoi tessellations". I want to generate the attributes only so I tried to run voro-ml-si/scripts/csv-output/generate-attributes.in. Then it comes with this error: Voro++ failed due to a: java.lang.Exception: Parsing failed: First line not "Basis:". The csv file generated has many lines as NaN.
Comments (17)
-
-
Thank you for your reply!
Yes, I am running on OS X. I have tried to compile Vassal and Magpie on my Mac but ended up with the same error. It is highly appreciated if you could provide me a Mac version :-)
-
Are you familiar with compiling C++ on Mac?
What you would need to do is:
- Download Voro++, unpack it in the
voro++
folder of Vassal, and then compile the voro++ library (make all
) - Compile voroExt.cpp (also found in the
voro++
folder) by calling: g++ voroExt.cpp -I src/ src/libvoro++.a -o voroExt.exe. - Copy voroExt.cpp to Magpie’s “exes” folder, and Magpie should run after you recompile it.
If this would be a problem, I can ask around to see if one of my coworkers with a Mac can compile Voro++ for you.
- Download Voro++, unpack it in the
-
Thank you!
I followed your instruction. In the second step, the only voroExt.cpp file I could find was already in the voro++ folder of Vassal, not in the Voro++ source code I just downloaded. I think you mean voroExt.exe in the third step. After I recompiled Magpie, I had another error when I ran it: "Voro++ failed due to a: java.lang.Exception: Voro++ ran the wrong kind of tessellation". I am not sure if it has already solved the previous error.
-
You are correct about
voroExt.exe
. Sorry about the typo.I haven't seen this 'wrong kind of tessellation' error before. Could you run the
test.file
program in thevoro++
folder of Vassal by feedingtest.file
viastdin
(i.e.,./voroExe.exe < test.file
), and tell me whether it contains the line "Polydisperse: True"? -
Yes. The output contains this line.
-
Great, that's what it should do. If you change line 4 of
test.file
from "poly true" to "poly False"? The output should change to "Polydisperse: False".It sounds like the previous error of Voro++ not running on your system is solved. I'm not sure why it seems to be reading the incorrect options
-
I found that when I changed the line 4 from True to False, the output didn't change correspondingly.
-
Great! So, we found the problem. I just verified that
voroExt.exe
works on my computer.This is pretty weird. It seems your
voroExt.exe
is detecting a 'T' in 'False' when it shouldn't. I'll put together some debugging code, and an alternative implementation of voroExt soon to help figure this out. Since I haven't yet been able to reproduce this problem on my computer, would you be alright with running that debug code for me?Just to confirm, does your
test.file
look like this:basis 2.88 0 2.88 0 0 2.88 periodicity True true True nAtoms 2 poly False 0 0 0 1 0.5 0.5 0.5 1
-
Sure, I will be happy to.
Yes, that's exactly what I see on my end.
-
Thanks! I think the problematic part of
voroExt.cpp
starts at Line 114. Could you replace the following code:if (strchr(temp, 'T') != NULL || strchr(temp, 't') != NULL) { poly = true; }
with this? As you'll likely notice, I changed how we detect what the user input is, and I added a debugging statement.
std::cerr << "Polydisperse, read: " << temp << std::endl; if (strcmp(temp, "True") == 0 || strcmp(temp, "true") == 0) { poly = true; } else if (strcmp(temp, "False") == 0 || strcmp(temp, "false") == 0) { poly = false; } else { std::cerr << "Polydispersity choice not recognized: " << temp << std::endl; return 4; }
Could you let me know what the "Polydisperse, read:" line says when you change the "poly" line in the input?
-
Thank you! After modifying, Polydisperse output changes corresponding to the input and Magpie runs smoothly after recompiling now.
-
Glad to hear it worked! Thanks for your patience about this and for testing the changed code!
I'll update Vassal/Magpie to use this newer version, in case someone else has this problem!
-
- changed status to resolved
-
Sounds great. Thank you for your kindly help! By the way, what's a good way to contact you if I have some questions about your paper?
-
Feel free to email me at loganw@uchicago.edu.
-
- Log in to comment
Thanks for reaching out!
The "First line not 'Basis'" error happens when the Voro++ executable provided with Magpie does not start. I have seen this problem for users running Magpie on OS X before. Are you using OS X? If so, we can fix this by getting you a version of Voro++ compiled for Macs.