orex / supercell

The program allows you to create regular structure supercell from cif file with partial occupancy and/or substitutions.
GNU General Public License v2.0
96 stars 56 forks source link

supercell does not read cif file correctly #7

Closed sprock closed 6 years ago

sprock commented 7 years ago

supercell -d -i Ca2Al2SiO7.cif -m

Open Babel Warning in Parse
Warning: one line could not be interpreted while reading a CIF file:
-> line contents:oop_
==============================
Open Babel Error in CIFReadValue
Warning: Trying to read a value but found a new CIF tag !
==============================
Open Babel Warning in Parse
Warning: one line could not be interpreted while reading a CIF file:
-> line contents:+2
==============================
Open Babel Warning in Parse
Warning: one line could not be interpreted while reading a CIF file:
-> line contents:AlT1 +3
==============================
Open Babel Warning in Parse
Warning: one line could not be interpreted while reading a CIF file:
-> line contents:AlT2 +3
==============================
Open Babel Warning in Parse
Warning: one line could not be interpreted while reading a CIF file:
-> line contents:SiT2 +4
==============================
Open Babel Warning in Parse
Warning: one line could not be interpreted while reading a CIF file:
-> line contents:O1 -2
==============================
Open Babel Warning in Parse
Warning: one line could not be interpreted while reading a CIF file:
-> line contents:O2 -2
==============================
** Open Babel Warning in Parse
Warning: one line could not be interpreted while reading a CIF file:
-> line contents:O3 -2
Initial system:
Chemical Formula:
4 Al6 O14 Si4

Compilation details:

  1. Get supercell: git clone --recursive https://github.com/orex/supercell.git
  2. Get openbabel: git clone https://github.com/openbabel/openbabel
  3. Build openbabel a. cd openbabel b. mkdir -p 64-bit && cd 64-bit c. cmake .. -DCMAKE_INSTALL_PREFIX=/opt/openbabel d. gmake -j4 e. sudo gmake install
  4. Build supercell a. cd supercell b. mkdir -p 64-bit && cd 64-bit c. cmake .. -DOpenBabel2_DIR=/opt/openbabel/lib/cmake/openbabel2 \ -DCMAKE_INSTALL_PREFIX=/opt/supercell -DCMAKE_BUILD_TYPE=Release d. gmake -j4 e. sudo gmake install

Tools: CC --version FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 Target: x86_64-unknown-freebsd10.3 Thread model: posix

orex commented 7 years ago

Thanks for an opening the issue. Can you try to run command openbabel Ca2Al2SiO7.cif -O Ca2Al2SiO7.xyz and paste the result. This can exclude supercell program.

sprock commented 7 years ago

I don't have an 'openbabel' binary but:

obabel Ca2Al2SiO7.cif -O Ca2Al2SiO7.xyz

*** Open Babel Warning in Parse Warning: one line could not be interpreted while reading a CIF file: -> line contents:oop_

*** Open Babel Error in CIFReadValue Warning: Trying to read a value but found a new CIF tag !

*** Open Babel Warning in Parse Warning: one line could not be interpreted while reading a CIF file: -> line contents:+2

*** Open Babel Warning in Parse Warning: one line could not be interpreted while reading a CIF file: -> line contents:AlT1 +3

*** Open Babel Warning in Parse Warning: one line could not be interpreted while reading a CIF file: -> line contents:AlT2 +3

*** Open Babel Warning in Parse Warning: one line could not be interpreted while reading a CIF file: -> line contents:SiT2 +4

*** Open Babel Warning in Parse Warning: one line could not be interpreted while reading a CIF file: -> line contents:O1 -2

*** Open Babel Warning in Parse Warning: one line could not be interpreted while reading a CIF file: -> line contents:O2 -2

*** Open Babel Warning in Parse Warning: one line could not be interpreted while reading a CIF file: -> line contents:O3 -2 1 molecule converted

orex commented 7 years ago

https://github.com/openbabel/openbabel/issues/1659

baoilleach commented 7 years ago

Hi @sprock. I'm from the Open Babel project. Before I try to follow this up, can you clarify a few things:

  1. Can you confirm (or deny!) that you are compiling against the GitHub cloned version of Open Babel (and not a version provided by your package manager, for example).
  2. What is the output of "ldd" when run on the supercell executable? (e.g. "ldd /opt/bin/supercell")
  3. If you run "make test" after building Open Babel, do all the tests pass? If not, which fail?
sprock commented 7 years ago

Hi baoilleach,

baoilleach notifications@github.com writes:

Hi @sprock. I'm from the Open Babel project. Before I try to follow this up, can you clarify a few things:

1 Can you confirm (or deny!) that you are compiling against the GitHub cloned version of Open Babel (and not a version provided by your package manager, for example).

Yes, the github version.

2 What is the output of "ldd" when run on the supercell executable? (e.g. "ldd /opt/bin/supercell")

ldd /opt/supercell/bin/supercell /opt/supercell/bin/supercell: libopenbabel.so.5 => /opt/openbabel/lib/libopenbabel.so.5 (0x280d6000) libboost_regex.so.1.64.0 => /usr/local/lib/libboost_regex.so.1.64.0 (0x28315000) libboost_program_options.so.1.64.0 => /usr/local/lib/libboost_program_options.so.1.64.0 (0x28422000) libboost_filesystem.so.1.64.0 => /usr/local/lib/libboost_filesystem.so.1.64.0 (0x28488000) libboost_system.so.1.64.0 => /usr/local/lib/libboost_system.so.1.64.0 (0x2849e000) libboost_random.so.1.64.0 => /usr/local/lib/libboost_random.so.1.64.0 (0x284a2000) libarchive.so.13 => /usr/local/lib/libarchive.so.13 (0x284a8000) libm.so.5 => /lib/libm.so.5 (0x28558000) libz.so.6 => /lib/libz.so.6 (0x2857f000) libc++.so.1 => /usr/lib/libc++.so.1 (0x28593000) libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x28641000) libgcc_s.so.1 => /usr/local/lib/gcc5//libgcc_s.so.1 (0x2865b000) libc.so.7 => /lib/libc.so.7 (0x28678000) libicudata.so.58 => /usr/local/lib/libicudata.so.58 (0x287ee000) libicui18n.so.58 => /usr/local/lib/libicui18n.so.58 (0x287f0000) libicuuc.so.58 => /usr/local/lib/libicuuc.so.58 (0x28a7e000) libthr.so.3 => /lib/libthr.so.3 (0x28c08000) libcrypto.so.7 => /lib/libcrypto.so.7 (0x28c29000) libexpat.so.1 => /usr/local/lib/libexpat.so.1 (0x28dba000) liblzo2.so.2 => /usr/local/lib/liblzo2.so.2 (0x28dde000) liblzma.so.5 => /usr/lib/liblzma.so.5 (0x28dfd000) liblz4.so.1 => /usr/local/lib/liblz4.so.1 (0x28e23000) libbz2.so.4 => /usr/lib/libbz2.so.4 (0x28e37000)

3 If you run "make test" after building Open Babel, do all the tests pass? If not, which fail?

100% tests passed, 0 tests failed out of 171

Thanks for looking into this.

Cheers, Roger

baoilleach commented 7 years ago

One last question, as I need to be certain that I have the correct test file. Does the error occur with this test file? https://github.com/orex/supercell/blob/master/data/examples/Ca2Al2SiO7/Ca2Al2SiO7.cif

sprock commented 7 years ago

Hello baoilleach,

baoilleach notifications@github.com writes:

One last question, as I need to be certain that I have the correct test file. Does the error occur with this test file? https://github.com/orex/supercell/blob/master/data/examples/Ca2Al2SiO7/Ca2Al2SiO7.cif

Yes, that is the correct file to test.

Cheers, Roger

baoilleach commented 7 years ago

Hi there, I can't reproduce this on FreeBSD 10.3 with clang 3.4.1. That is to say, the conversion works fine for me without any error message. I installed openbabel locally and ran it from there to avoid any potential conflicts with the ports provided openbabel. If you are certain that that is the test file, then I cannot explain this difference.

orex commented 7 years ago

Did you delete mmcifformat.so file from plugin folder?

baoilleach commented 7 years ago

If that question is for me, the answer is no, and I just did "obabel thatfile.cif -osmi". Perhaps @sprock could try downloading the test file again to rule out any differences.

orex commented 7 years ago

Hi, Noel!

That question was for you. Please, refer to my post here https://github.com/openbabel/openbabel/issues/1659 to reproduce the bug. We had a long e-mail conversion with @sprock before he open the issue. The conclusion is that the mmcifformat.so drops some data silently. But cifformat.so puts some warnings to terminal. I guess that the attached file will fails with mmciffformat plugin also. Ca2Al2SiO7_simplifyed.cif.txt

sprock commented 7 years ago

Hello baoilleach,

baoilleach notifications@github.com writes:

If that question is for me, the answer is no, and I just did "obabel thatfile.cif -osmi". Perhaps @sprock could try downloading the test file again to rule out any differences.

I copied the file from https://github.com/orex/supercell/blob/master/data/examples/Ca2Al2SiO7/Ca2Al2SiO7.cif as 'Gehlenite.cif' and ran it:

~/Software/SuperCell/supercell/32-bit/src/sc_cli/supercell -i Gehlenite.cif -m

segmentation fault (core dumped) ...

Cheers, Roger

baoilleach commented 7 years ago

...and running it through obabel?

sprock commented 7 years ago

baoilleach notifications@github.com writes:

...and running it through obabel?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

/opt/openbabel/bin/obabel Gehlenite.cif -ocif -Ogit_obabel.cif 1 molecule converted

Cheers, Roger

orex commented 7 years ago

Please, try the file Ca2Al2SiO7_simplifyed.cif.txt

baoilleach commented 7 years ago

I will as soon as I can get it into my VM.

On 23 October 2017 at 13:03, orex notifications@github.com wrote:

Please, try the file Ca2Al2SiO7_simplifyed.cif.txt

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/orex/supercell/issues/7#issuecomment-338637094, or mute the thread https://github.com/notifications/unsubscribe-auth/AACxGS7HIaWTaXNhNtYNF9m1WsrNBW_jks5svICQgaJpZM4Pw6_w .

sprock commented 7 years ago

orex notifications@github.com writes:

Please, try the file Ca2Al2SiO7_simplifyed.cif.txt

Where is it?

orex commented 7 years ago

6 posts before.

baoilleach commented 7 years ago

I have tried it, and it works fine.

So now I'm confused. @sprock originally reported that obabel produced errors when reading the test file, but now it's not.

orex commented 7 years ago

Obabel produces the errors only if you use cifformat.so plugin. By default, the mmcifformat.so plugin is used. Can you delete mmcifformat.so file from the plugin folder and try again obabel conversion with original Ca2Al2SiO7 file? If the case is not produce the error, the problem can be with @sprock installation/customization of FreeBSD system. If the error appears also for you, I will extract a code from my program, which can show the bug in mmcifformat.so. I'm believe that bugs in both plugins are strongly related to each other.

sprock commented 7 years ago

orex notifications@github.com writes:

Obabel produces the errors only if you use cifformat.so plugin. By default, the mmcifformat.so plugin is used. Can you delete mmcifformat.so file from the plugin folder and try again obabel conversion with original Ca2Al2SiO7 file? If the case is not produce the error, the problem can be with @sprock installation/customization of FreeBSD system. If the error appears also for you, I will extract a code from my program, which can show the bug in mmcifformat.so. I'm believe that bugs in both plugins are strongly related to each other.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

mmcifformat.so removed: ls /opt/openbabel/lib/openbabel/2.4.1/cif /opt/openbabel/lib/openbabel/2.4.1/cifformat.so

*.cif.txt /opt/openbabel/bin/obabel Ca2Al2SiO7_simplifyed.cif.txt -o xyz -Ogit_Ca2Al2SiO7_simplifyed.xyz.txt 73 molecules converted

*.cif /opt/openbabel/bin/obabel Ca2Al2SiO7_simplifyed.cif -o xyz -Ogit_Ca2Al2SiO7_simplifyed.xyz

*** Open Babel Error in OpenAndSetFormat Cannot open Ca2Al2SiO7_simplifyed.cif 0 molecules converted

Cheers, sprock

orex commented 7 years ago

@sprock did you renamed Ca2Al2SiO7_simplifyed.cif.txt to Ca2Al2SiO7_simplifyed.cif before running the second command? The file named Ca2Al2SiO7_simplifyed.cif.txt because GitHub is not allowing to upload files with cif extension.

sprock commented 7 years ago

orex notifications@github.com writes:

@sprock did you renamed Ca2Al2SiO7_simplifyed.cif.txt to Ca2Al2SiO7_simplifyed.cif before running the second command? The file named Ca2Al2SiO7_simplifyed.cif.txt because GitHub is not allowing to upload files with cif extension.

I ran Ca2Al2SiO7_simplifyed.cif.txt, which did not crash.

I then renamed it to Ca2Al2SiO7_simplifyed.cif, which failed.

baoilleach commented 7 years ago

After deleting mmciff format, I have for Ca2_etc.cif (sorry cut+paste not working), lots of errors message (starting with line contents: _oop) and an xyz file that has an asterisk instead of Ca.

For Ca2_etc_simplifyed.cif, it creates the error messages but just keeps running. I killed it after 2 minutes.

Is this the bug you wish to report? The original bug report over at Open Babel didn't mention deleting mmciff. But if so, isn't the fix not to delete it? Again, I feel like I'm missing something here.

orex commented 7 years ago

Can you try obabel Ca2Al2SiO7.cif -o cif -O Ca2Al2SiO7_conv.cif with mmcifformat.so plugin (usual installation). On linux it will store partial occupancies to output file (see part of the output file below) (0.500), but on FreeBSD I think, it produces different result.

loop_
    _atom_site_label
    _atom_site_type_symbol
    _atom_site_fract_x
    _atom_site_fract_y
    _atom_site_fract_z
    _atom_site_occupancy
    Ca1     Ca   0.33750   0.16250   0.51100   1.000
    AlT1    Al   0.00000   0.00000   0.00000   1.000
    AlT2    Al   0.14310   0.35690   0.95280   0.500
    SiT2    Si   0.14310   0.35690   0.95280   0.500
    O1      O    0.50000   0.00000   0.18840   1.000
    O2      O    0.14180   0.35820   0.28320   1.000
    O3      O    0.08720   0.17060   0.80330   1.000
baoilleach commented 7 years ago

I've just done as you asked, and the results are identical to yours.

I think I need to move onto other things now. It seems that Open Babel is working as intended on FreeBSD, or at least, there is no problem that I can find.

sprock commented 7 years ago

baoilleach notifications@github.com writes:

I've just done as you asked, and the results are identical to yours.

I think I need to move onto other things now. It seems that Open Babel is working as intended on FreeBSD, or at least, there is no problem that I can find.

Thank you for looking into this. I have no idea why your results differ from mine. I will build a debug version and hope that sheds light on the matter.

orex commented 6 years ago

Closed due to inactivity for a year.