| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a903b3c commit d5561ba
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ New calculator class can thus be readily defined for any quantity that is | |||
| 22 | 22 | obtained by iteration over atom pairs. | |
| 23 | 23 | ||
| 24 | 24 | For more information see user manual at | |
| 25 | - http://www.diffpy.org/doc/libdiffpy/. | ||
| 25 | + http://www.diffpy.org/doc/libdiffpy. | ||
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | 28 | ## REQUIREMENTS | |
@@ -36,18 +36,19 @@ libdiffpy library requires C++ compiler and the following software: | |||
| 36 | 36 | Recommended software: | |
| 37 | 37 | ||
| 38 | 38 | * `libobjcryst` - C++ library of free objects for crystallography, | |
| 39 | - https://github.com/diffpy/libobjcryst/ | ||
| 40 | - * `cxxtest` - CxxTest Unit Testing Framework, http://cxxtest.com/ | ||
| 39 | + https://github.com/diffpy/libobjcryst | ||
| 40 | + * `cxxtest` - CxxTest Unit Testing Framework, http://cxxtest.com | ||
| 41 | 41 | ||
| 42 | - Required software is usually available in the system package manager, | ||
| 43 | - for example, on Ubuntu Linux the dependencies can be installed as: | ||
| 42 | + On Ubuntu Linux the required software can be installed using the | ||
| 43 | + system package manager: | ||
| 44 | 44 | ||
| 45 | 45 | ```sh | |
| 46 | 46 | sudo apt-get install \ | |
| 47 | 47 | build-essential scons libboost-dev libgsl0-dev | |
| 48 | 48 | ``` | |
| 49 | 49 | ||
| 50 | - For Mac OS X machine with the MacPorts package manager one could do | ||
| 50 | + For Mac OS X machine with the MacPorts package manager the installation | ||
| 51 | + command is | ||
| 51 | 52 | ||
| 52 | 53 | ```sh | |
| 53 | 54 | sudo port install scons boost gsl | |
@@ -68,6 +69,19 @@ This installs libdiffpy for all users under the `/usr/local` directory. | |||
| 68 | 69 | If administrator (root) access is not available, see the usage info from | |
| 69 | 70 | `scons --help` for options to install to a user-writable location. | |
| 70 | 71 | ||
| 72 | + To verify libdiffpy installation, compile and run the included | ||
| 73 | + test code [examples/testlib.cpp](examples/testlib.cpp) | ||
| 74 | + | ||
| 75 | + ```sh | ||
| 76 | + cd examples | ||
| 77 | + c++ testlib.cpp -ldiffpy | ||
| 78 | + ./a.out | ||
| 79 | + ``` | ||
| 80 | + | ||
| 81 | + If compilation fails because of missing header files or missing libdiffpy | ||
| 82 | + library, adjust the `CPATH` and `LIBRARY_PATH` environment variables or | ||
| 83 | + use the `-I` or `-L` compiler options. If the libdiffpy shared library | ||
| 84 | + cannot be found at runtime, adjust the `LD_LIBRARY_PATH` environment variable. | ||
| 71 | 85 | ||
| 72 | 86 | ## DEVELOPMENT | |
| 73 | 87 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,19 @@ | |||
| 1 | + // Test program for checking the installation of libdiffpy shared library. | ||
| 2 | + // Compile and run this code using: | ||
| 3 | + // | ||
| 4 | + // c++ testlib.cpp -ldiffpy | ||
| 5 | + // ./a.out | ||
| 6 | + | ||
| 7 | + | ||
| 8 | + #include <iostream> | ||
| 9 | + #include <diffpy/srreal/ScatteringFactorTable.hpp> | ||
| 10 | + | ||
| 11 | + int main(int argc, char* argv[]) | ||
| 12 | + { | ||
| 13 | + using namespace diffpy::srreal; | ||
| 14 | + ScatteringFactorTablePtr ntbl; | ||
| 15 | + ntbl = ScatteringFactorTable::createByType("neutron"); | ||
| 16 | + ntbl->lookup("Pb"); | ||
| 17 | + std::cout << "Installation of libdiffpy shared library works!\n"; | ||
| 18 | + return 0; | ||
| 19 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments