-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathINSTALL
147 lines (98 loc) · 5.5 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
Installation instructions for the libfins library.
The libfins library is a library with routines written in C to communicate as
a client with remote PLCs over the Omron FINS protocol.
The library is licensed according to the MIT license. You can find more details
about this license in the LICENSE file and in the header of each source file.
The routines can be used on a variety of hardware and software configurations.
This has influenced the way the installation takes place.
Installing the source files
===========================
First of all make sure that the library source files will be placed in a
directory separate from your other files. This ensures that creating the
library will not overwrite any of your existing files.
Cloning the repository
----------------------
The easiest way is to get all up-to-date sources is to clone the full
repository from github with the command
git clone https://github.com/lammertb/libfins.git path-to/libfins
This will create the subdirectory libfins in the given path, and create the
file structure inside it. Using git ensures that you have an easy way to update
the library when the master library is updated.
Forking the repository
----------------------
Another option is to first for the repository on github to your own account
and from there clone working copies. These are more steps, but give you an
easier road to send pull requests back to the master repository if you have
made usefull additions or bug fixes in your local copy.
Downloading a pre-packaged zip or tar file with sources
-------------------------------------------------------
Some snapshots of the libfins library source files will be available as packaged
compressed files in zip and tar format.
Downloading a pre-compiled static library for your OS
-----------------------------------------------------
Binary versions of the library are periodically compiled for Windows, Linux and
FreeBSD for x86 and ARM architectures and are available for download. In this
case you can just link the library at link time, instead of compiling the
sources yourself. Each library is packaged with the proper header file.
Library format
==============
The library is provided as a statically linked library. Many libraries you find
on the net are for dynamic linking, but it is a deliberate choice to make that
option not available for libfins. One reason is the size of the routines. They
are relatively small and the code size needed to load the routines at run-time
from a dynamic library would be comparable in size as the routines themselves.
The second reason is version compatibility. Dynamically linked libraries are
provided independently from the using application and functionality and ABIs
may differ between those versions. By having the code statically linked to your
application, you are assured that the version of the routines in the library
always match the version needed by your application.
Make tool chain
===============
Cross-platform compatibility was a major point when creating the library and
selecing the tools around it. Many source code libraries are distributed based
on the autoconf, automake, libtool toolchain. Although this toolchain is
widely accepted in the *nix world and has been developed for cross-platform
compatibility, my personal experience is that it often works against
compatibility.
The autoconf, automake, libtool toolchain is not available under
Windows and for that you will often see that developers add a number of Visual
Studio project directories in their project, one for each Visual Studio version
they support.
A second point is that this library runs on many versions of *nix flavors and
autoconf versions on older but still supported OS versions (Centos 6.x as an
example) are not fully compatible with newer bleeding edge operating systems.
For that reason the toolchain uses the make utility. The Makefile has been
specifically designed for GNU make, although other make implementations may
work. If you encounter make problems with your make implementation, the best
bet is to download a source or precompiled binary version of GNU make for your
operating system.
Dependencies in the Makefile were created and are maintained manually where all
depencencies including those for header files are properly mentioned. Because
of this it is safe to speed op compilation with parallel jobs using the -j
parameter of GNU make.
Besides the Makefile, a CMake configuration and a Visual Studio project
for the current Visual Studio release. These build options can be used where
the use of the Makefile is not giving the desired results.
Both the CMake and MSVC project files are used in the CI workflow on Github,
so for the operating systems Windows, Ubuntu and MacOS, they should be
fairly uptodate.
Tested compilers
================
The source files are currently compiled as part of the test and build cycles
with various compilers including Visual Studio 2015, multiple versions of gcc
multiple versions of clang and Embarcadero C++ builder 10.1. This is no
guarantee that the source code will work without flaws on other compilers, but
incompatbilities shouldn't be big.
Result files
============
The result file is a libfins.a or libfins.lib file in the lib subdirectory of
the project. This file can be statically linked with your projects.
Make command options
====================
You can call make with options to change the behavior of the process.
make
make all
creates both the library and the example programs
make clean
cleans up the object files, library file and example programs
Lammert Bies