@@ -9,6 +9,57 @@ Introduction
9
9
The purpose of this library is to provide access to efficient and robust
10
10
algorithms and data types commonly used in scientific applications.
11
11
12
+ Installation
13
+ ============
14
+
15
+ Flibcpp is built using modern CMake _, and it has no external dependencies. This
16
+ makes installation quite simple as long as you have a relatively recent
17
+ software stack with a Fortran and compatible C++ compiler.
18
+
19
+ 1. Download and install CMake if it's not already on your system. It is highly
20
+ recommended to use a package manager such as Homebrew _ for Mac or YUM _ for
21
+ Red Hat Linux.
22
+ 2. Download the `Flibcpp source code `_ from GitHub if you haven't already.
23
+ 3. Create a new build directory (for example purposes, create a subdirectory
24
+ named ``build `` inside your downloaded source directory) and ``cd `` to it.
25
+ 4. Run CMake: ``cmake .. ``
26
+ 5. Make and install (by default it will install to ``/usr/local ``):
27
+ ``make install ``.
28
+
29
+ .. _CMake : https://cmake.org
30
+ .. _Homebrew : https://brew.sh
31
+ .. _YUM : https://access.redhat.com/solutions/9934
32
+ .. _Flibcpp source code : https://github.com/swig-fortran/flibcpp/releases .
33
+
34
+ Downstream usage
35
+ ================
36
+
37
+ The Flibcpp library is most easily used when your downstream app is built with
38
+ CMake. It should require a single line to initialize::
39
+
40
+ find_package(Flibcpp REQUIRED CONFIG)
41
+
42
+ and a single line to link against your app or library::
43
+
44
+ target_link_libraries(example_backend Flibcpp::flc_random Flibcpp::flc_algorithm)
45
+
46
+ If your installation prefix for Flibcpp is a system default path (such as
47
+ ``/usr/local ``) or in your ``$CMAKE_PREFIX_PATH `` environment variable, it
48
+ should automatically find the necessary CMake configure file.
49
+
50
+ An `example Fortran application `_ that depends only on Flibcpp is
51
+ available on Github.
52
+
53
+ .. _example Fortran application : https://github.com/swig-fortran/flibcpp-example-app).
54
+
55
+ ----
56
+
57
+ If you're using a simple standalone Makefile to build your Fortran code, you
58
+ will have to inform the compiler of the proper include path, library path, and
59
+ library names. Depending on your system configuration, you might have to
60
+ also explicitly link your app against the compiler's C++ standard libraries
61
+ using ``-lstdc++ ``.
62
+
12
63
.. ############################################################################
13
64
.. end of doc/introduction.rst
14
65
.. ############################################################################
0 commit comments