Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get install -y python-is-python3 && \
apt-get install -y build-essential && \
apt-get install -y libxml2-dev zlib1g-dev && \
apt-get install -y libasio-dev libxerces-c-dev libzip-dev && \
rm -rf /var/lib/apt/lists/*
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ find_package(LibXml2 REQUIRED)
find_package(ZLIB REQUIRED)

if(ENABLE_DCP)
find_package(xercesc REQUIRED)
if(UNIX)
find_package(XercesC REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it be enough to just use this for both platforms?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot say for sure, because I do not have the (same) resources at the moment to test this the way you test it.
I decided to make a non-invasive change.

I know from my last commit that vcpkg occasionally uses different names and naming-schemes for packages than other package management systems and that the generated CMake-related files may not be working with the default names.

else()
find_package(xercesc REQUIRED)
endif()
find_package(Threads REQUIRED)
find_package(ASIO REQUIRED)
find_package(DCPLib REQUIRED)
Expand Down
6 changes: 5 additions & 1 deletion dcp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ project(dcp_executables)
option(ENABLE_DCP_DEBUG "Turn on debug output of the DCP slaves" OFF)

# dependencies
find_package(xercesc REQUIRED)
if(UNIX)
find_package(XercesC REQUIRED)
else()
find_package(xercesc REQUIRED)
endif()
find_package(ASIO REQUIRED)
find_package(DCPLib REQUIRED)

Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get install -y build-essential && \
apt-get install -y python-is-python3 python3-numpy && \
apt-get install -y libxml2-dev zlib1g-dev && \
apt-get install -y libasio-dev libxerces-c-dev libzip-dev && \
rm -rf /var/lib/apt/lists/*
2 changes: 1 addition & 1 deletion examples/dcp_fmu/model.ssd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
name="connections">
<System name="Root">
<Elements>
<Component name="Sinus 1" source="file:../../fmus/sinusGenerator.fmu">
<Component name="Sinus 1" source="../../fmus/sinusGenerator.fmu">
<Connectors>
<Connector name="sinus_out" kind="output">
<ssc:Real/>
Expand Down
41 changes: 21 additions & 20 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,26 +79,27 @@ def _run_tests(exe, test_dir):
# check reference files
test_passed = True
ref_dir = os.path.join(test_dir_abs_path, example, "reference")
for res in os.listdir(ref_dir):
if not res.endswith(".csv"):
continue

res_path = os.path.join("results", res)
ref_path = os.path.join(ref_dir, res)

if not os.path.exists(res_path):
print("Results {} are missing".format(res))
test_passed = False

res_data = np.genfromtxt(res_path, delimiter=',', skip_header=3)
ref_data = np.genfromtxt(ref_path, delimiter=',', skip_header=3)
diff_data = ref_data - res_data

for i, j in np.ndindex(diff_data.shape):
if abs(diff_data[i, j]) > 1e-8:
print("Results {} do not match".format(res))
test_passed = False
break
if os.path.exists(ref_dir):
for res in os.listdir(ref_dir):
if not res.endswith(".csv"):
continue

res_path = os.path.join("results", res)
ref_path = os.path.join(ref_dir, res)

if not os.path.exists(res_path):
print("Results {} are missing".format(res))
test_passed = False

res_data = np.genfromtxt(res_path, delimiter=',', skip_header=3)
ref_data = np.genfromtxt(ref_path, delimiter=',', skip_header=3)
diff_data = ref_data - res_data

for i, j in np.ndindex(diff_data.shape):
if abs(diff_data[i, j]) > 1e-8:
print("Results {} do not match".format(res))
test_passed = False
break

if test_passed:
print("\tSUCCESS")
Expand Down