Skip to content

Commit 446e743

Browse files
committed
update build section in README
1 parent d1e0f27 commit 446e743

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,26 +128,27 @@
128128
<!--Please note that 32-bit binaries have to be compiled from the source, although the use of 64-bit versions is highly recommended.-->
129129
<br />
130130

131-
## Compiling `InChI v.1.07` from source
131+
## Compiling from source
132132

133-
Project files for Microsoft<sup>&reg;</sup> `Visual C++ (MSVC)/Clang/LLVM` users are provided for both command line and API versions of `InChI v.1.07`. The project files are located in the following folders:
133+
InChI library and demo binaries can be easily compiled with cmake out of tree.
134+
For instance, the following will build everything in the `builddir` directory:
134135

135-
- `INCHI-1-SRC/INCHI_EXE/inchi-1/vc14` (command line version)
136-
- `INCHI-1-SRC/INCHI_API/demos/inchi_main/vc14` (API version consisting of `libinchi.dll` and its corresponding executable `inchi_main.exe`)
137-
- `INCHI-1-SRC/INCHI_API/libinchi/vc14` (API version consisting only of `libinchi.dll`).
136+
```
137+
cmake -B builddir
138+
cmake --build builddir
139+
```
138140

139-
For other C compilers, `makefile/makefile32` files are provided in the following folders:
141+
tested on Linux/GCC, Windows/MSVC, OSX/LLVM
140142

141-
- `INCHI-1-SRC/INCHI_EXE/inchi-1/gcc` (command line version)
142-
- `INCHI-1-SRC/INCHI_API/demos/inchi_main/gcc` (API version consisting of `libinchi.dll/libinchi.so.1.07` and its corresponding executable/ELF `inchi_main.exe/inchi_main`)
143-
- `INCHI-1-SRC/INCHI_API/libinchi/gcc` (API version consisting only of `libinchi.dll/libinchi.so.1.07`).
143+
### Compilation options
144144

145-
<a id="MAKEFILE"></a>
145+
the default build creates a shared library, it is possible to have a static library instead by setting `BUILD_SHARED_LIBS` to `OFF` like this:
146146

147-
`makefile/makefile32` files are configured to detect OSs automatically, so it is no longer needed to specify OS explicitly or run batch/bash script(s) before compiling. If both `GCC` and `Clang/LLVM` compilers are detected, `GCC` is used by default; setting `Clang/LLVM` as default compiler can be done simply by changing `CCN` parameter from `1` to `2` in `makefile/makefile32`.
148-
149-
If `makefile/makefile32` is used for compiling `libinchi` on Microsoft<sup>&reg;</sup> Windows, `libinchi.dll` is now generated instead of `libinchi.so.1.07`.
147+
```
148+
cmake -B builddir -D BUILD_SHARED_LIBS=OFF
149+
```
150150

151+
### BCF
151152
<a id="BCF"></a>
152153

153154
In order to further improve code security, [bounds checking functions](https://wiki.sei.cmu.edu/confluence/display/c/Scope) (see Annex K of [C11 standard](https://en.cppreference.com/w/c/11)) can be optionally used in `InChI v.1.07`. Since a number of C compilers (e.g. `GNU GCC`) do not support bounds checking functions, they can be installed using some of the third-party open-source libraries such as:

0 commit comments

Comments
 (0)