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
91 stars 56 forks source link

Supercell cmake error #2

Closed zbwang closed 8 years ago

zbwang commented 8 years ago

Dear Supercell developers,

I am now trying to install Supercell on my Mac. But I meet the following issue when "cmake ../". I know this error arise from Eigen3(the failure of locating Eigen3). But I do not know how to solve this problem even after googling for a long time. I am not familiar with CMake. Could you give me some instructions on this issue? Thanks for your help. ---------------------------------Error log listed below---------------------------

CMake Error at src/CMakeLists.txt:9 (find_package): By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Eigen3", but CMake did not find one.

Could not find a package configuration file provided by "Eigen3" with any of the following names:

Eigen3Config.cmake
eigen3-config.cmake

Add the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set "Eigen3_DIR" to a directory containing one of the above files. If "Eigen3" provides a separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred! See also "/Users/wzb/repos/supercell/build/CMakeFiles/CMakeOutput.log".

WeiLiPenguin commented 8 years ago

Hi, FindEigen3.cmake is in the lib/common_utils/cmake/modules, common_utils is a submodule of this repository. maybe you need

git clone --recursive

or copy the FindEigen3.cmake to a place

Best Regards!

zbwang commented 8 years ago

Hi Wei Li,

Thanks for your help. It works. But when I type "make" to go to the next step. A new error shows up.

The error log is shown below.

Scanning dependencies of target supercell [ 10%] Building CXX object src/sc_cli/CMakeFiles/supercell.dir/**/core/common_types.cpp.o In file included from /Users/wzb/repos/supercell/src/core/common_types.cpp:8: In file included from /Users/wzb/repos/supercell/src/core/common_types.h:16: /Users/wzb/repos/supercell/libs/common_utils/assigned_variable/av_base.hpp:15:10: fatal error: 'boost/lexical_cast.hpp' file not found

include <boost/lexical_cast.hpp>

     ^

1 error generated. make[2]: * [src/sc_cli/CMakeFiles/supercell.dir//core/common_types.cpp.o] Error 1 make[1]: * [src/sc_cli/CMakeFiles/supercell.dir/all] Error 2 make: * [all] Error 2

Is there any solution for this? Thanks

zbwang commented 8 years ago

It is really weird. I can successfully locate the lexical_cast.hpp on my laptop. But Supercell always fail to find it.

On Mon, May 2, 2016 at 7:10 PM, WeiLi notifications@github.com wrote:

Hi, FindEigen3.cmake is in the lib/common_utils/cmake/modules, common_utils is a submodule of this repository. maybe you need

git clone --recursive

or copy the FindEigen3.cmake to a place

Best Regards!

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/orex/supercell/issues/2#issuecomment-216417508

WeiLiPenguin commented 8 years ago

Hi, zbwang

I have not used a mac in my life, sorry. It seems that the code need the boost library, and it is not in the searching path of your system or for cmake. I could not contribute more help. good luck!

orex commented 8 years ago

Hello, Zbwang.

Unfortunately, I don't have a Mac computer, so I've never compile my program there. Just one question to you, did you compile and install OpenBabel on the machine?

Best, Kirill.

zbwang commented 8 years ago

Hi Kirill,

Thanks for your reply. Yes. I have successfully build the OpenBabel at https://github.com/openbabel/openbabel.

I find that the above error "/Users/wzb/repos/supercell/libs/common_utils/assigned_variable/av_base.hpp:15:10: fatal error: 'boost/lexical_cast.hpp' file not" is due to the failure of finding Boost include files. It seems CMAKE in Supercell only finds includes files at /usr/include or /usr/local/include. If dependencies were installed at none of the above root path, Supercell will fail to find them.

I need to modify the CMAKE variables. But honestly, I am not familiar with CMake language and Supercell. I do not know to edit the CMakeLists.txt to make it work. If possible, could you offer some instructions on how to build Supercell with dependencies compiled at user-folder? This is actually very useful for users on Servers/Clusters, where they generally do not have the root privilege.

BTW, I have successfully built Supercell on Ubuntu. The installation is quite straightforward with apt-get installing all dependencies except OpenBabel, which strictly needs the Github version. But I am still eager to know how to make Supercell work on Mac, as my daily research is heavily done at this machine.

Thanks, Zhenbin

orex commented 8 years ago

Wei Li thank you, for your helpful suggestions!

Zhenbin, It looks, that you install supercell some dependencies to user folders, rather that to system one. If it is like this, you should suggest cmake, where the files is. You can do it by adding switch -DCMAKE_PREFIX_PATH=, where path to the local folder should contains subfolder ./lib, where lib files will be, ./include for headers, etc. Don't forget to set environmental variable DYLD_FALLBACK_LIBRARY_PATH (for mac os x) to point to your local lib path /lib before start supercell program.

To put the dependencies to the local folder, you should change an installation prefix from default (for linux /usr/local) to point to the folder you want and install it there. 1) Boost installation ./bootstrap.sh --prefix=/some/dir/you/would/like/to/prefix 2) cmake -DCMAKE_INSTALL_PREFIX=/some/dir/you/want/to/install

You can install boost to system folders on Mac OS according to this topic http://stackoverflow.com/questions/104322/how-do-you-install-boost-on-macos

I was working with some clusters. All of them, had very old linux system (kernel 2.6). It was really painful to satisfy all dependencies there. So, the best option for such case will be to statically compile supercell on recent distribution (including openbabel) and copy executable there.

Best, Kirill.

zbwang commented 8 years ago

Hi Kirill,

I actually installed boost via homebrew. "brew install boost". (The approach suggested in the webpage you provided) Now, Boost folder is located at /usr/local/Cellar/boost/1.57.0/. But unfortunately, Supercell still can not find it.

I tried the way you suggested by specifying -DCMAKE_PREFIX_PATH=/usr/local/Cellar/boost/1.57.0/ The step is cmake ../ -DCMAKE_PREFIX_PATH=/usr/local/Cellar/boost/1.57.0/ Then, make

The error still appears. "/Users/wzb/repos/supercell/libs/common_utils/assigned_variable/av_base.hpp:15:10: fatal error: 'boost/lexical_cast.hpp' file not found

include <boost/lexical_cast.hpp>"

orex commented 8 years ago

Thank you very much for the information. It looks like, that I've found a bug in compilation script. Can you check the new version?

zbwang commented 8 years ago

Awesome! It works. I successfully built Supercell. The testing of Ca2Al2SiO7 example looks fine. Great thanks for your help, Kirill and Wei Li.

orex commented 8 years ago

Good! Feel free, to contact me, in case of any problems. I will also really appreciate, if you will share with me benchmark of my program (examples FeSbO4 and PbSnTe). You can take my mail from jcheminf paper.