File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -135,8 +135,13 @@ def __str__(self):
135
135
LIBRARY_PATH = pkgconfig .pkgconfig ._query ( # pylint: disable=protected-access
136
136
"libsemigroups" , "--libs-only-L"
137
137
)
138
+
139
+ # The above pkgconfig query can return an empty string (this also happens on
140
+ # the command line). This happens, for example, using pkg-config version 1.8.0
141
+ # on ArchLinux. CN 27/10/2021
142
+
138
143
assert (
139
- LIBRARY_PATH [:2 ] == "-L"
144
+ len ( LIBRARY_PATH ) == 0 or LIBRARY_PATH [:2 ] == "-L"
140
145
), "The first two characters of the library path to the libsemigroups.so etc should be '-L'"
141
146
142
147
# Try to use pkg-config to add the path to libsemigroups.so etc to
@@ -145,7 +150,12 @@ def __str__(self):
145
150
# though the path to libsemigroups.so etc is not in LD_LIBRARY_PATH. This is
146
151
# the case, for example, on JDM's computer.
147
152
148
- LIBRARY_PATH_NO_L = LIBRARY_PATH [2 :]
153
+ if len (LIBRARY_PATH ) != 0 :
154
+ LIBRARY_PATH_NO_L = LIBRARY_PATH [2 :]
155
+ else :
156
+ LIBRARY_PATH_NO_L = "/usr/lib"
157
+ LIBRARY_PATH = "-L/usr/lib"
158
+
149
159
if os .path .exists (LIBRARY_PATH_NO_L ):
150
160
if (
151
161
"LD_LIBRARY_PATH" in os .environ
You can’t perform that action at this time.
0 commit comments