-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
148 lines (96 loc) · 4.41 KB
/
README
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
# symbCpp
SymbolicC++ was originally written as a collection of header files
for C++. Many of the functions and classes provided are template
functions and classes and in general cannot be compiled in as part
of a library.
This project attempts to extract the parts of SymbolicC++ that can
be compiled as part of a library and so create the include / library
infrastructure. The src and include directories are populated by
scripts from the SymbolicC++ header files.
== Installation to /usr/local ===============================================
To install to /usr/local:
./configure
make
sudo make install
This stopped working on Sep 10 2021 when ./configure changed.
It did not work due to error: AM_INIT_AUTOMAKE not found
After returning to configure of 01 July 2021 it works somehow
Thus OLDER configure01jul2021 must be used as
./configure
instead of the newer configure10sep21 !!!
In fedora just ./configure works OK.
To compile a program using SymbolicC++ with GCC:
g++ -o program program.cpp -lsymbolicc++
To run the program:
./program
A brief PDF document describing SymbolicC++ is provided
(doc/introsymb.tex, produce doc/introsymb.pdf from it)
and is installed as /usr/local/share/doc/SymbolicC++.pdf.
== Installation elsewhere ===================================================
This section describes installation to a directory "where_to_install".
The directory must be a full path, i.e. it should not begin with "./" or
"../".
To install:
./configure --prefix=where_to_install
make
make install
** If the directory is a standard system directory, proceed as described
** in the section "Installation to /usr/local" above.
To compile a program using SymbolicC++ with GCC (all on one line):
g++ -I where_to_install/include
-L where_to_install/lib
-o program program.cpp -lsymbolicc++
When running the program, make sure that the dynamic libraries can be located,
for example by modifying /etc/ld.so.conf or by setting the LD_LIBRARY_PATH
(for Bourne shell compatible shells)
$ ./program
Shared object "libsymbolicc++.so.3" not found
$ LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:where_to_install/lib
$ export LD_LIBRARY_PATH
$ ./program
...
A brief PDF document describing SymbolicC++ is provided
(doc/introsymb.tex, produce doc/introsymb.pdf from it)
and is installed as where_to_install/share/doc/SymbolicC++.pdf.
=============================================================================
Description above does not work due to error:
/usr/local/lib//libsymbolicc++.so: undefined reference to `Number<int>::Number(int const&)'
/usr/local/lib//libsymbolicc++.so: undefined reference to `Number<double>::Number(double const&)'
collect2: error: ld returned 1 exit status
Next lines work (option -fno-elide-constructors is needed on 64bit systems, not on 32bit):
cd examples/
g++ -o test1.exe test1.cpp -fno-elide-constructors ../src/*.cpp
g++ -o matrix.exe matrix.cpp -fno-elide-constructors ../src/*.cpp
-- but it works only if include/ dir is in a known place, e.g. in /usr/local,
if not, then do in this directory:
g++ -I include -o matrix.exe examples/matrix.cpp -fno-elide-constructors src/*.cpp
or put after -I the path to the place where you have copied the include/ dir from this directory
Now gflibsymb.sh works which has lines
#!/bin/tcsh
g++ -I include -c -fno-elide-constructors src/*.cpp
ar cvr ~/lib/libsymbcgf.a *.o
ar ts ~/lib/libsymbcgf.a
exit
This builds libsymbcgf.a in HOME/lib. Then quick translation is possible:
g++ -I ./include -L ~/lib -o test1.exe examples/test1.cpp -fno-elide-constructors -lsymbcgf
g++ -I ./include -L ~/lib -o matrix.exe examples/matrix.cpp -fno-elide-constructors -lsymbcgf
Or do
cd examples/
g++ -I ../include -L ~/lib -o test1.exe test1.cpp -fno-elide-constructors -lsymbcgf
./test1.exe
g++ -I ../include -L ~/lib -o matrix.exe matrix.cpp -fno-elide-constructors -lsymbcgf
./matrix.exe
In dir examples/ one can simply do
buildExe.sh test1
./test1.exe
or
buildExe.sh hydrogen1
./hydrogen1.exe
etc.
For 32bit systems use gf32libsymb.sh, and commands like
g++ -I ./include -L ~/lib -o test1.exe examples/test1.cpp -lsymbcgf
g++ -I ./include -L ~/lib -o bose.exe examples/bose.cpp -lsymbcgf
g++ -I ./include -L ~/lib -o separation.exe examples/separation.cpp -lsymbcgf
For intel icpc use library built with iclibsymb.sh and
icpc -I ./include -L ~/lib -o test1.exe examples/test1.cpp -lsymbc
icpc -I ./include -L ~/lib -o matrix.exe examples/matrix.cpp -lsymbc