mirror of
https://github.com/triqs/dft_tools
synced 2024-12-25 13:53:40 +01:00
[doc] install and exceptions
This commit is contained in:
parent
dfe1948d38
commit
56820a9493
@ -45,3 +45,23 @@ In order to use clang when building TRIQS::
|
|||||||
On OS X, the options -std=c++11 and -stdlib=libc++ are automatically added by the TRIQS
|
On OS X, the options -std=c++11 and -stdlib=libc++ are automatically added by the TRIQS
|
||||||
installation script.
|
installation script.
|
||||||
|
|
||||||
|
libclang
|
||||||
|
----------
|
||||||
|
|
||||||
|
Some tools for developers (e.g. automatically C++/Python wrapper generation), use libclang
|
||||||
|
(delivered with clang), and its python bindings (usually not given).
|
||||||
|
|
||||||
|
The latest version is necessary.
|
||||||
|
|
||||||
|
A pip package, updated to the latest version, is on github.
|
||||||
|
Install it simply with ::
|
||||||
|
|
||||||
|
pip install -e git+https://github.com/parcollet/python-clang.git#egg=clang
|
||||||
|
|
||||||
|
To uninstall it (or another version) ::
|
||||||
|
|
||||||
|
pip uninstall clang
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,16 +19,13 @@ A recent compiler is therefore mandatory.
|
|||||||
|
|
||||||
* Standard compliant C++ compilers (recommended and supported).
|
* Standard compliant C++ compilers (recommended and supported).
|
||||||
|
|
||||||
* :ref:`clang 3.2<install_clang>` and higher (in particular the default clang on OS X 10.8).
|
* :ref:`clang 3.3<install_clang>` and higher (in particular the default clang on OS X >= 10.8).
|
||||||
* g++ 4.8.1 and higher
|
* g++ 4.8.1 and higher
|
||||||
|
|
||||||
* The intel icc 14.0 is close to be C++11 compliant, but presents currently too many bugs to be supported
|
* The intel icc 15.0 is close to be C++11 compliant, but presents currently too many bugs to be supported
|
||||||
at present. It compiles 99% of TRIQS, but we do not have the ressources to write and
|
at present. It compiles 99% of TRIQS, but we do not have the ressources to write and
|
||||||
maintains all necessary workarounds.
|
maintains all necessary workarounds.
|
||||||
|
|
||||||
Besides, for *our codes*, icc does not provide a significant speed gain (unlike MKL),
|
|
||||||
so we do not recommend it for TRIQS.
|
|
||||||
|
|
||||||
* C++98 compilers
|
* C++98 compilers
|
||||||
|
|
||||||
* g++ before 4.8.1
|
* g++ before 4.8.1
|
||||||
@ -67,12 +64,16 @@ Libraries
|
|||||||
+------------------------+----------+------------------------------------------------------------------------+
|
+------------------------+----------+------------------------------------------------------------------------+
|
||||||
| cmake | >= 2.8.7 | CMake is used to control the software compilation process |
|
| cmake | >= 2.8.7 | CMake is used to control the software compilation process |
|
||||||
+------------------------+----------+------------------------------------------------------------------------+
|
+------------------------+----------+------------------------------------------------------------------------+
|
||||||
|
| mako | >= 0.9.1 | mako templates are used to generate the C++/python wrapper |
|
||||||
|
+------------------------+----------+------------------------------------------------------------------------+
|
||||||
| pyparsing | >= ? | Tool for sphinx (to compile documentation) |
|
| pyparsing | >= ? | Tool for sphinx (to compile documentation) |
|
||||||
+------------------------+----------+------------------------------------------------------------------------+
|
+------------------------+----------+------------------------------------------------------------------------+
|
||||||
| sphinxcontrib-doxylink | >= ? | Tool for sphinx (to compile documentation) |
|
| sphinxcontrib-doxylink | >= ? | Tool for sphinx (to compile documentation) |
|
||||||
+------------------------+----------+------------------------------------------------------------------------+
|
+------------------------+----------+------------------------------------------------------------------------+
|
||||||
| matplotlib | >= 0.99 | Python 2D plotting library |
|
| matplotlib | >= 0.99 | Python 2D plotting library |
|
||||||
+------------------------+----------+------------------------------------------------------------------------+
|
+------------------------+----------+------------------------------------------------------------------------+
|
||||||
|
| libclang | 3.4 | python bindings of the clang lib (for TRIQS developers ONLY) |
|
||||||
|
+------------------------+----------+------------------------------------------------------------------------+
|
||||||
|
|
||||||
(1) Since standard linux distributions (and macports on OS X) now provides openmpi, even on laptops, we avoid the unnecessary complication of maintaining a non-parallel version of TRIQS
|
(1) Since standard linux distributions (and macports on OS X) now provides openmpi, even on laptops, we avoid the unnecessary complication of maintaining a non-parallel version of TRIQS
|
||||||
|
|
||||||
|
@ -10,13 +10,17 @@ Exceptions
|
|||||||
TRIQS defines special exceptions, with the following characteristics :
|
TRIQS defines special exceptions, with the following characteristics :
|
||||||
|
|
||||||
* they derives from std::exceptions
|
* they derives from std::exceptions
|
||||||
* their .what() contains:
|
* their method .what() returns :
|
||||||
|
|
||||||
|
* the date and time of the exception (useful in long QMC computations...).
|
||||||
* the file and line where the exception occurred
|
* the file and line where the exception occurred
|
||||||
* an additionnal error message (see example below). The error behaves like a std::stringstream,
|
* an additionnal error message (see example below). The error behaves like a std::stringstream, one can accumulate any message
|
||||||
one can accumulate any message
|
|
||||||
|
* their method .what() returns :
|
||||||
* a complete stack strace of the C++ code at the exception point, with demangling of the function name (on gcc and clang).
|
* a complete stack strace of the C++ code at the exception point, with demangling of the function name (on gcc and clang).
|
||||||
|
|
||||||
|
In addition, we provide a TRIQS_RUNTIME_ERROR macro to throw exception easily, Cf example below.
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
For uniformity, it is highly recommended to use these macros when developing for TRIQS.
|
For uniformity, it is highly recommended to use these macros when developing for TRIQS.
|
||||||
|
@ -7,7 +7,8 @@ void f() {
|
|||||||
if (2 != 3) TRIQS_RUNTIME_ERROR << " The condition is false because " << 2 << "!=" << 3;
|
if (2 != 3) TRIQS_RUNTIME_ERROR << " The condition is false because " << 2 << "!=" << 3;
|
||||||
}
|
}
|
||||||
catch (triqs::runtime_error const& e) {
|
catch (triqs::runtime_error const& e) {
|
||||||
std::cout << "caught error " << e.what() << std::endl;
|
std::cout << "caught error \n" << e.what() << std::endl;
|
||||||
|
std::cout << "C++ trace = \n" << e.trace() << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user