Skip to content

Commit a30bd69

Browse files
committed
Improve documentation
1 parent a4f4b93 commit a30bd69

File tree

5 files changed

+57
-3
lines changed

5 files changed

+57
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/build/
12
# Prerequisites
23
*.d
34

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ project(Flibcpp VERSION 0.1.0 LANGUAGES CXX Fortran)
1212
# SWIG setup
1313
#---------------------------------------------------------------------------#
1414

15-
option(USE_SWIG "Enable SWIG generation" ON)
15+
option(USE_SWIG "Enable SWIG generation" OFF)
1616
if (USE_SWIG)
1717
find_package(SWIG)
1818
endif()

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ recent version of CMake:
2929
3.8 or higher)
3030
3. Install using `make install`
3131

32-
More detailed installation instructions will be {are?} available in the
33-
documentation. An example Fortran application that depends only on Flibcpp is
32+
More detailed installation instructions are available [in the
33+
documentation](https://flibcpp.readthedocs.io/en/latest/introduction.html#installation).
34+
An example Fortran application that depends only on Flibcpp is
3435
available [on Github](https://github.com/swig-fortran/flibcpp-example-app).
3536

3637
## Documentation

doc/introduction.rst

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,57 @@ Introduction
99
The purpose of this library is to provide access to efficient and robust
1010
algorithms and data types commonly used in scientific applications.
1111

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+
1263
.. ############################################################################
1364
.. end of doc/introduction.rst
1465
.. ############################################################################

doc/modules/algorithm.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ the first index will be the point at which the element would be located if it
111111
were present.
112112

113113
Example::
114+
114115
use flc_algorithm, only : equal_range, INDEX_INT
115116
implicit none
116117
integer(INDEX_INT) :: first, last

0 commit comments

Comments
 (0)