TRIQS / cthyb_matrix

DEPRECATED -- CTQMC Hybridisation expansion
1 stars 4 forks source link

Error while installing CTHYB Matrix solver #12

Closed hbaromega closed 9 years ago

hbaromega commented 9 years ago

Hi,

I have successfully installed TRIQS in the following directory:

/home/hbar/Documents/CODES_DMFT/TRIQS

and I have used the following steps in order to install cthyb-matrix .

Download package from the git repos

git clone https://github.com/TRIQS/cthyb_matrix.git src2

Create build directory

mkdir -p build2 && cd build2

Install CT-Hyb matrix solvers now

cmake -DCMAKE_INSTALL_PREFIX=/home/hbar/Documents/CODES_DMFT/TRIQS ../src2 make make test make install

Unfortunately, I am encountering the following error message:

CMake Error: The source "/home/hbar/Documents/CODES_DMFT/TRIQS/src2/CMakeLists.txt" does not match the source "/home/hbar/Documents/CODES_DMFT/TRIQS/src/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory. make: *** No targets specified and no makefile found. Stop. make: *** No rule to make targettest'. Stop. make: *** No rule to make target install'. Stop.

What was I supposed to do?

Note that I have followed the command lines given in http://ipht.cea.fr/triqs/1.1/applications/cthyb_matrix/install.html . Only the change that I made are the directory names "src2" and "build2" since the names "src" and "build" I have already used while installing TRIQS.

pseth commented 9 years ago

If you are using TRIQS version 1.2, you should use the cthyb solver (https://github.com/TRIQS/cthyb). As a more efficient version of the older cthyb_matrix, cthyb replaces cthyb_matrix for versions 1.0 onwards.

hbaromega commented 9 years ago

The cthyb/CMakeLists.txt contains the line set (CTHYB_VERSION "1.2").

Doesn't it mean that it's the same version?

aichhorn commented 9 years ago

The error message says that you have most probably a problem with your directories. cmake complains that there are already some cache files in our build directory which don't fit to the source directory that you are specifying. So I think your error has nothing to do with using cthyb matrix or what version it is. It does not even reach the point where the versions are checked. So try to delete your build directory completely. And yes, you should use the new cthyb, the old cthyb_matrix will not be maintained in the future, with no guarantee that it works.

aichhorn commented 9 years ago

By the way, when installing a TRIQS application you do NOT specify an install path as you did, but the path to the installed TRIQS library. Please check carefully the install instructions of cthyb. And again, when doing so, switch to the new cthyb.

hbaromega commented 9 years ago

Okay, now I have downloaded the cthyb package in src2 directory. Still I obtain errors, I am pasting a major part of the whole message.

`CMake Error at /home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS/share/triqs/cmake/TRIQSConfig.cmake:205 (list): list sub-command REMOVE_DUPLICATES requires list to be present. Call Stack (most recent call first): python/CMakeLists.txt:9 (triqs_prepare_local_pytriqs_merged_with_my_python)

▽ list(APPEND local_files "${python_destination}/${new_f}") -- Preparing extension module cthyb ln: failed to create symbolic link ‘/home/hbar/Documents/CODES_DMFT/TRIQS/build2/pytriqs/applications/impurity_solvers/cthyb’: No such file or directory

CMake Warning at test/c++/CMakeLists.txt:2 (find_package): By not providing "FindTriqsTest.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "TriqsTest", but CMake did not find one.

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

TriqsTestConfig.cmake
triqstest-config.cmake

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

CMake Error at test/c++/CMakeLists.txt:12 (triqs_add_test_C_simple): Unknown CMake command "triqs_add_test_C_simple".`

Do I require a fresh installation of TRIQS as well?

aichhorn commented 9 years ago

Did you remove your build2 directory before completely? Can you tell us: What are your source, build, and install directories? It is a problem with cmake caches and screwed up directory combinations, I assume. Did you use cmake -DTRIQS_PATH=/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS ../src2 From you message I read that your install path is /home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS, isn't it?

hbaromega commented 9 years ago

Yes, I did remove the build2 directory before installing.

Yes, I have used cmake -DTRIQS_PATH=/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS ../src2

So in summary: Working directory: /home/hbar/Documents/CODES_DMFT/TRIQS Pytriqs installation directory: TRIQS/PY_TRIQS Build directory: TRIQS/build2 Source directory for CT-Hyb: src2 Installation path: /home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS

pseth commented 9 years ago

As a reply to your previous question "Do I require a fresh installation of TRIQS as well?", you should in general pull the then-present version of the TRIQS library at the same time that you pull the CTHYB code, dft_tools, etc, to ensure that they are compatible. These tools are constantly evolving, and so need to be synced.

Can you please try doing this (git pull in your TRIQS src directory and CTHYB src dir too for good measure) and then do a clean install from the start? You should not in principle have any problems then.

hbaromega commented 9 years ago

Well, I don't know why, but now I'm getting python conflict while doing re-installation of TRIQS:

-- -------- Python detection ------------- -- Python interpreter /home/hbar/opt/anaconda/bin/python Traceback (most recent call last): File "", line 1, in ImportError: No module named mako.template CMake Error at cmake/FindPython.cmake:43 (MESSAGE): The script : import mako.template

did not run properly in the Python interpreter. Check your python installation. Call Stack (most recent call first): cmake/FindPython.cmake:57 (EXEC_PYTHON_SCRIPT) CMakeLists.txt:116 (find_package)

aichhorn commented 9 years ago

This is not a conflict, it is just a missing python module. See the issue #177 on the TRIQS issues list. Easiest fix is to install mako with root access.

hbaromega commented 9 years ago

How should I search issue #177 ? Sorry, I am sort of newbie here.

hbaromega commented 9 years ago

Well, the hashtag probably didn't hyperlink https://github.com/TRIQS/triqs/issues/177 . I guess, I have managed to install Mako.

However, now I come across an error related to mpi

-- -------- MPI detection ------------- -- Unable to determine MPI from MPI driver /usr/bin/mpicc -- Could NOT find MPI_C (missing: MPI_C_LIBRARIES MPI_C_INCLUDE_PATH) -- Unable to determine MPI from MPI driver /usr/bin/mpicxx -- Could NOT find MPI_CXX (missing: MPI_CXX_LIBRARIES MPI_CXX_INCLUDE_PATH) CMake Error at CMakeLists.txt:159 (message): TRIQS requires MPI

I think, I have already installed all the prerequisites mentioned in http://ipht.cea.fr/triqs/1.2/installation/ubuntu.html . Doesn't it take care of mpi ? Do I need ipython upgrade through vitualenv?

aichhorn commented 9 years ago

If you installed openmpi-bin, then you should have some mpi compiler available. Do you have mpicc and mpic++ in your PATH? What does which mpicc which mpic++ give? If that works, then you might have a problem with the mpi libraries (libmpi.so, libmpi_cxx.so, and so on). Do you find them in /usr/lib/? By the way, this error is not related to your python setup.

hbaromega commented 9 years ago

which mpicc shows /usr/bin/mpicc and which mpic++ shows /usr/bin/mpic++.

And libmpi*.so files are inside /usr/lib.

I once tried to install openmpi from openmpi.org. Can that cause a conflict?

I know, it's not related to the earlier one. But once one error gets sorted out, another pops up. :(

parcollet commented 9 years ago

which machine is it ? distribution ?

hbaromega commented 9 years ago

It is Ubuntu 14.04.3 with Intel Quad-core processor.

parcollet commented 9 years ago

We have Ubuntu 14.04 here too. Do you have all the packages from http://ipht.cea.fr/triqs/1.2/installation/ubuntu.html ? If you have reinstalled openmpi yourself (i.e. not from the distribution), yes it can very easily cause trouble.

hbaromega commented 9 years ago

Yes, I had installed all the dependencies. I had been trying to test some parallel programming a few days ago. However, earlier I was successful in running IPT code from TRIQS.

This time with the latest version of TRIQS, I am probably encountering these issues.

Let me check once and get back to this.

hbaromega commented 9 years ago

Hi, I have uninstalled earlier openmpi by using make uninstall in the installation directory and by removing the openmpi directory.

However, no improvement at all!

Why does such messages arise -- Unable to determine MPI from MPI driver /usr/bin/mpicc -- Could NOT find MPI_C (missing: MPI_C_LIBRARIES MPI_C_INCLUDE_PATH)

where I can clearly see /usr/bin/mpicc exists in my system?

Is there a way to forcefully declare the path? Something like what instructed in issue #155?

mferrero commented 9 years ago

Well, try to execute the following: /usr/bin/mpicc --version What do you get?

hbaromega commented 9 years ago

I get the following.

Cannot open configuration file /usr/share/openmpi/mpicc-wrapper-data.txt Error parsing data file mpicc: Not found

Does it mean mpicc not installed correctly?

mferrero commented 9 years ago

I see. You have removed you own openmpi, but you still need one. Please make sure you have installed all the packages described here: http://ipht.cea.fr/triqs/1.2/installation/ubuntu.html

You are obviously missing openmpi-common and maybe some others.

parcollet commented 9 years ago

It seems that by installing openmpi by hand, you have badly broken your Ubuntu distribution.

mferrero commented 9 years ago

Yes, installing delicate software like openmpi is always very risky. One should never do this until you really know what you are doing.

parcollet commented 9 years ago

Indeed, an important rule is to never install manually what is in the distribution. Or in /usr/local, /opt/local only ! Specially mpi, or the compilers... You may try to force the reinstallation openmpi-common and co (remove the package and reinstall them). If it does not work, you may have to fully reinstall a clean Ubuntu...

hbaromega commented 9 years ago

I think, some of the earlier openmpi remain in /usr/lib/openmpi and that conflicts reinstallation. Can I dare to remove them?

hbaromega commented 9 years ago

Well, now I uninstalled openmpi by using sudo apt-get remove openmpi* and then reinstalled. Now it seems installing nicely! :)

Though cthyb installation has to be verified yet (main post in the thread).

hbaromega commented 9 years ago

A bit update from side (towards the goal of successful installation of CT-HYB):

I was initially getting this error:

-- Hash: dd2a5a1d9d0cda38981eac4213245c33df7e0d5c CMake Error at /home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS/share/triqs/cmake/TRIQSConfig.cmake:205 (list): list sub-command REMOVE_DUPLICATES requires list to be present.

Then I modified the PYTHONPATH in my ~/.bashrc file in the following way.

export PYTHONPATH=/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS/bin:/home/hbar/opt/anaconda/lib/python2.7:$PYTHONPATH

But I still have one final error :

99% tests passed, 1 tests failed out of 139

Total Test time (real) = 13.20 sec

The following tests FAILED: 134 - dos (Failed) Errors while running CTest make: *\ [test] Error 8 -- Installation directory is /home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS -- Compiler is gcc with version 4.9.2 -- Compiling in C++11 mode -- DYNAMIC Built -- -------- Python detection ------------- -- Python interpreter /home/hbar/opt/anaconda/bin/python Traceback (most recent call last): File "", line 1, in ImportError: No module named mpi4py CMake Error at cmake/FindPython.cmake:43 (MESSAGE): The script : import mpi4py

did not run properly in the Python interpreter. Check your python installation. Call Stack (most recent call first): cmake/FindPython.cmake:63 (EXEC_PYTHON_SCRIPT) CMakeLists.txt:116 (find_package)

I'm quite close to the success. Any help?

pseth commented 9 years ago

As the message says, you don't have mpi4py installed. Retry installation/tests after installing it.

hbaromega commented 9 years ago

Okay, so I thought that mpi4py got installed when installed python-mpi4py through apt-get (following http://ipht.cea.fr/triqs/1.2/installation/ubuntu.html).

I did pip install mpi4py and installation got completed. :)

Now do I need to declare some PATH in .bashrc to get access to cthyb files?

pseth commented 9 years ago

You should be installing CTHYB in the same place as TRIQS, so if your TRIQS install/bin directory is in your PYTHONPATH already, you do not need to do anything else.

hbaromega commented 9 years ago

I have PYTHONPATH=/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS/bin and my path for CTHYB is /home/hbar/Documents/CODES_DMFT/TRIQS/cthyb_1.2.

Is it okay?

pseth commented 9 years ago

1) You probably want to append to your pythonpath rather than overwriting it, 2) Your CTHYB src path doesn't matter, just make sure that you do

cmake -DTRIQS_PATH=/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS ...etc...

when you install, as explained on the install page of CTHYB (http://ipht.cea.fr/triqs/1.2/applications/cthyb/install.html). Please work through the instructions there.

hbaromega commented 9 years ago

I think, I have done this as per the instructions. The only difference is that I have used

cmake -DTRIQS_PATH=/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS src2

instead of

cmake -DTRIQS_PATH=/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS src

since I thought it may conflict with earlier pulled src directory for TRIQS installation.

Also do I need to check the version compatibility? Is the command git co 1.0.0 correct?

pseth commented 9 years ago

If you are on the latest branches of TRIQS and CTHYB, the compilation should run. If there is a version compatibility problem the code with complain. Please try installing and running the tests. If something is missing, an error message will indicate as much.

hbaromega commented 9 years ago

I am having the following problem while compiling single_site_bethe.py from the test directory.

Traceback (most recent call last): File "cthyb_1.2/test/python/single_site_bethe.py", line 5, in from pytriqs.applications.impurity_solvers.cthyb import * ImportError: No module named applications.impurity_solvers.cthyb

Is it a PYTHONPATH related issue?

pseth commented 9 years ago

Hm, can you try things in this order?

make
make install
make test
hbaromega commented 9 years ago

Sorry, I later realized that I have used

cmake -DTRIQS_PATH=/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS src

where src was my previous TRIQS source directory and hence it didn't install CTHYB, rather reinstalled TRIQS.

However, now I am using

cmake -DTRIQS_PATH=/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS src2

(CTHYB source directory is src2) and I get the following error before make, make install etc take place.

CMake Warning at test/c++/CMakeLists.txt:2 (find_package): By not providing "FindTriqsTest.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "TriqsTest", but CMake did not find one.

I can see that, in src2/test/c++/CMakeLists.txt find_package(TriqsTest) command exists. I have also noticed that FindTriqsTest.cmake file is inside PY_TRIQS/share/triqs/cmake.

Do I need to mention this path? If yes, how?

aichhorn commented 9 years ago

Looks like you have a completely screwed up TRIQS installation. This is an error that is not related to any package problem of your system. My suggestion: You have to remove all TRIQS build and install directories. I would even remove the sources and clone it again. And start again from scratch with the compilation and installation, including the installation of TRIQS.

hbaromega commented 9 years ago

From your answer, it seems that there's no way of debugging ! I thought, the error messages hint us to do that. :(

Anyway I am pasting the content of my installation script file. Please let me know if you find anything wrong here.

#!/bin/sh # # Remove old builds and sources # ----------------------------- rm -rf src* build*

### TRIQS INSTALLATION ### # # Pull TRIQS git # ------------------------- git clone https://github.com/TRIQS/triqs.git src

# Create build directory # ------------------------- mkdir build && cd build

# Install TRIQS now # -------------------------- # cmake -DCMAKE_INSTALL_PREFIX=/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS ../src

make make test make install

echo TRIQS installation Done !

### CTHYB INSTALLATION ###

# Pull CTHYB git git clone https://github.com/TRIQS/cthyb.git src2

# Create build directory # ------------------------- mkdir build2 && cd build2

# Install CT-Hyb solver now # ---------------------------------- # cmake -DCMAKE_INSTALL_PREFIX=/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS ../src2

make make test make install

echo CTHYB installation Done !

And my .bashrc contains

export PYTHONPATH=/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS/bin:/home/hbar/opt/anaconda/lib/python2.7:$PYTHONPATH

export PATH=/home/hbar/opt/anaconda/bin:/opt/intel/Compiler/11.1/064/bin/intel64:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/intel/Compiler/11.1/064/bin/intel64/:/usr/local/MATLAB/R2013b/bin/:/usr/local/MATLAB/R2013b/bin/:/usr/bin/mpicc:/usr/bin/mpic++:/usr/bin:/home/hbar/opt/openmpi/bin:/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS/bin:/home/hbar/Documents/CODES_DMFT/TRIQS/src:/home/hbar/Documents/CODES_DMFT/TRIQS/src2

aichhorn commented 9 years ago

Hi, As a suggestion, I would not put installation of TRIQS and CTHYB into one script. Please note that in your case the src2 directory is a subdirectory of the TRIQS build directory. You should keep it cleanly separated. As mentioned earlier in this thread, the cmake command of the CTHYB installation is wrong! You have to give -DTRIQS_PATH and not CMAKE_INSTALL_PREFIX!

krivenko commented 9 years ago

After reading this discussion I came to a conclusion that the names of source and build directories in the installation guides of the library and cthyb should be different. Something like triqs.src, triqs.build and cthyb.src, cthyb.build.

pseth commented 9 years ago

Also another point -- CMake can get upset about stale files. If you ever run into install problems, start from a clean set of build and install directories. That is what the developers do too.

There make scripts are set up to work smoothly, and they do on Ubuntu (quite thoroughly tested by us!) when following instructions on the install pages. There should be no need to "debug" the make scripts..

hbaromega commented 9 years ago

Finally I could install CTHYB successfully. :smile: Yes, removing old build and source directories certainly resolve the issue. Apart from this, I did two mistakes (as @aichhorn pointed out) : 1) Forgetting to change directory after installing TRIQS from build. 2) Typing -CMAKE_INSTALL_PREFIX instead -DTRIQS_PATH.

So the corrected version of my script (to install freshly TRIQS and then CTHYB) :

#!/bin/sh # # Remove old builds and sources # ----------------------------- rm -rf src* build*

### TRIQS INSTALLATION ### # # Pull TRIQS git # ------------------------- git clone https://github.com/TRIQS/triqs.git src

# Create build directory # ------------------------- mkdir build && cd build

# Install TRIQS now # -------------------------- # cmake -DCMAKE_INSTALL_PREFIX=/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS ../src

make make test make install cd .. echo TRIQS installation Done !

### CTHYB INSTALLATION ###

# Pull CTHYB git git clone https://github.com/TRIQS/cthyb.git src2

# Create build directory # ------------------------- mkdir build2 && cd build2

# Install CT-Hyb solver now # ---------------------------------- # cmake -DTRIQS_PATH=/home/hbar/Documents/CODES_DMFT/TRIQS/PY_TRIQS ../src2

make make test make install

echo CTHYB installation Done !


Thanks to the TRIQS team. Specially @pseth , @aichhorn , @mferrero , @parcollet , and @krivenko : thanks for your patience and sparing time for the issue.

The case can be closed now (unless there are important comments to be made).