Skip to content

Commit 0ac6fc3

Browse files
authored
Issue 224: add -fno-lto flag (#225)
* add tests * add tests * set test lto * add -no-lto flag * add comments
1 parent 091f110 commit 0ac6fc3

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,15 @@ def add_filters(filters, pkgs, pkgs_data):
153153
if sys.platform == "win32":
154154
pass
155155
else:
156-
arguments = ['-std=c++17', '-Wall', '-Wextra', '-fdiagnostics-show-option']
156+
# old version
157+
# arguments = ['-std=c++17', '-Wall', '-Wextra',
158+
# '-fdiagnostics-show-option']
159+
# lto does not work
160+
# arguments = ['-std=c++17', '-Wall', '-Wextra',
161+
# '-fdiagnostics-show-option', '-flto=auto', '-ffat-lto-objects']
162+
# no-lto to be on the save side
163+
arguments = ['-std=c++17', '-Wall', '-Wextra', '-fdiagnostics-show-option',
164+
'-fno-lto']
157165
nexus_config.add_compiler_arguments(arguments)
158166

159167
# ----------------------------------------------------------------------------

test/h5cpp_tests/node_tests/dataset_io_test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,21 @@ def testWriteVariableLengthUTF8Scalar(self):
131131
else:
132132
self.assertEqual(read, bdata)
133133

134+
def testWriteVariableLengthEmptyScalar(self):
135+
data = u""
136+
bdata = b""
137+
dtype = h5cpp.datatype.String.variable()
138+
# dtype.encoding = h5cpp.datatype.CharacterEncoding.UTF8
139+
dataset = Dataset(
140+
self.root, h5cpp.Path("VariableLengthStringEmptyScalar"),
141+
dtype, Scalar())
142+
# dataset.write(data)
143+
read = dataset.read()
144+
if sys.version_info > (3,):
145+
self.assertEqual(read, data)
146+
else:
147+
self.assertEqual(read, bdata)
148+
134149
def testWriteIntegerArray(self):
135150

136151
data = numpy.array([[1, 2, 3, 4], [5, 6, 7, 8]])

0 commit comments

Comments
 (0)