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

Error: Input file cannot be opened #3

Closed Traecp closed 8 years ago

Traecp commented 8 years ago

Dear developers, I've just discovered your potentially great program Supercell that could help me to build disordered supercell crystal. I have installed it without any issue. But when I test it by running the examples you provided along side with the software, I always have this error: "Input file cannot be opened". For more information:

linux-vdso.so.1 =>  (0x00007ffcc1593000)
libopenbabel.so.4 => /users/thnguyen/bin/usr/local/lib/libopenbabel.so.4 (0x00007f951558b000)
libboost_regex.so.1.49.0 => /usr/lib/libboost_regex.so.1.49.0 (0x00007f9515a8d000)
libboost_program_options.so.1.49.0 => /usr/lib/libboost_program_options.so.1.49.0 (0x00007f9515a26000)
libboost_filesystem.so.1.49.0 => /usr/lib/libboost_filesystem.so.1.49.0 (0x00007f9515a05000)
libboost_system.so.1.49.0 => /usr/lib/libboost_system.so.1.49.0 (0x00007f9515a01000)
libboost_random.so.1.49.0 => /usr/lib/libboost_random.so.1.49.0 (0x00007f95159fd000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9515387000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9515170000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9514e69000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9514be7000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f95149d1000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9514646000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f951442a000)
libicuuc.so.48 => /usr/lib/x86_64-linux-gnu/libicuuc.so.48 (0x00007f95140bb000)
libicui18n.so.48 => /usr/lib/x86_64-linux-gnu/libicui18n.so.48 (0x00007f9513cf0000)
libicudata.so.48 => /usr/lib/x86_64-linux-gnu/libicudata.so.48 (0x00007f9512980000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9512778000)
/lib64/ld-linux-x86-64.so.2 (0x00007f95159cb000)

Could you please help me out to fix this? All the best, Tra Nguyen

orex commented 8 years ago

Hello, Tra!

Thank you very much for your report. First of all, if you want to compile supercell with Eigen library in custom location you can run cmake with option "-DEIGEN3_INCLUDE_DIR=/path/to/eigen3/library" and you don't need to modify the code. But your solution is also OK. It will be just a little additional work, each time you update the supercell code with github.

You install openbabel in custom location and the supercell program is linked to libopenbabel in the location. But openbabel has a plugin system for reading/writing chemical formats. Probably, the problem can be with libopenbabel plugin load. Can you run the line: strace supercell 2>&1 | grep -i openbabel and put the output to the thread.

Traecp commented 8 years ago

Thank you for the guide. I ran the command

And this is the output:

rnice7-0207:/mntdirect/_users/thnguyen % strace supercell 2>&1 | grep -i openbabel open("/users/thnguyen/bin/usr/local/lib/tls/x86_64/libopenbabel.so.4", O_RDONLY) = -1 ENOENT (No such file or directory) open("/users/thnguyen/bin/usr/local/lib/tls/libopenbabel.so.4", O_RDONLY) = -1 ENOENT (No such file or directory) open("/users/thnguyen/bin/usr/local/lib/x86_64/libopenbabel.so.4", O_RDONLY) = -1 ENOENT (No such file or directory) open("/users/thnguyen/bin/usr/local/lib/libopenbabel.so.4", O_RDONLY) = 3

Hope you found something related to this. Best, Tra

orex commented 8 years ago

By unknown reason libopenbabel don't load plugins. Please check plugins exists in folder "/users/thnguyen/lib/openbabel/2.3.90". if it is exists there do export BABEL_LIBDIR="/users/thnguyen/bin/usr/local/lib/openbabel/2.3.90" Did you specify openbabel installation path when compile openbabel cmake -DCMAKE_INSTALL_PREFIX=/users/thnguyen/ and install openbabel with command? make install

Traecp commented 8 years ago

I see the openbabel library in /users/thnguyen/bin/usr/local/lib/openbabel/2.3.90 So I exported the BABEL_LIBDIR to that folder, then I execute a simple command supercell -d -i Ca2Al2SiO7.cif, and I have this output:

// ============================== * Open Babel Warning in Init Cannot open element.txt defaulting to compiled data. //============================== * Open Babel Warning in Init Unable to open data file 'space-groups.txt' //============================== * Open Babel Warning in Init Cannot initialize database 'space-groups.txt' which may cause further errors. //============================== * Open Babel Warning in Init Cannot open bondtyp.txt defaulting to compiled data. //============================== * Open Babel Warning in Init Cannot open atomtyp.txt defaulting to compiled data. //============================== * Open Babel Warning in Init Cannot open aromatic.txt defaulting to compiled data.

For the installation of openbabel, I did add -DCMAKE_INSTALL_PREFIX to the cmake command.

Traecp commented 8 years ago

I think this is somehow related to the path or permission. Because I've tried to install supercell on another computer (Debian 7) that I have sudo permission, I could run it without any problem. So for now I'm running supercell on that computer. But if you can solve this problem I would very appreciate it. By the way, I have another question which maybe not in the right forum, please forgive me if such: when I run supercell with -q option to calculate Coulomb energy, I have all of the outputs have the same energy. Do you have an idea why? Thaks a lot, Tra

orex commented 8 years ago

Please, refer to [(https://openbabel.org/docs/dev/Installation/install.html)] for local installation of openbabel. It is not permission problem, but local path problem. It looks like that you should setup BABEL_DATADIR environmental variable. Another way to solve the problem is to build openbabel library statically.

Just some question to you: 1) Do you still want to install an openbabel properly on your system and recompile supercell program or not. If not, I have to close the issue. 2) The information you provided about supercell run with "-q" option is definitely not enough for me to make any conclusion. Can you make a new thread with the problem description? Problematic file, and exact command you run.

Traecp commented 8 years ago

Yes, it works perfectly now when I export the environment variable BABEL_DATADIR. Please close this issue. I think anyway it's a good idea to have a proper instruction to install Supercell to a customized place. But the installation by default works very well. Thanks a lot for your help. Tra

orex commented 8 years ago

This bug is related to OpenBabel installation. Please refer to OB installation manual here https://openbabel.org/docs/dev/Installation/install.html Please, check, that openbabel is properly installed: run obabel tool with cif input file. After that you can compile and install supercell program.

orex commented 8 years ago

A standard-alone executable of supercell program, compatible with all linux platforms, can be obtained form https://orex.github.io/supercell/