Fix CGNS code for version < 3.4

Install libhdf5 on ubuntu test (cgns depends on it)
This commit is contained in:
Matthias Hochsteger 2020-03-11 16:35:48 +01:00
parent 603141cf1a
commit 2615b0911e
3 changed files with 9 additions and 1 deletions

View File

@ -396,6 +396,10 @@ if(USE_CGNS)
target_compile_definitions(netgen_cgns INTERFACE NG_CGNS) target_compile_definitions(netgen_cgns INTERFACE NG_CGNS)
target_include_directories(netgen_cgns INTERFACE ${CGNS_INCLUDE_DIR}) target_include_directories(netgen_cgns INTERFACE ${CGNS_INCLUDE_DIR})
target_link_libraries(netgen_cgns INTERFACE ${CGNS_LIBRARY}) target_link_libraries(netgen_cgns INTERFACE ${CGNS_LIBRARY})
if(NOT WIN32) # hdf5 is statically linked into cgns in Windows binaries
find_library(HDF5_LIBRARY NAMES hdf5 hdf5_serial)
target_link_libraries(netgen_cgns INTERFACE ${HDF5_LIBRARY})
endif(NOT WIN32)
endif(USE_CGNS) endif(USE_CGNS)
add_subdirectory(libsrc) add_subdirectory(libsrc)

View File

@ -291,7 +291,11 @@ namespace netgen::cg
cg_ElementDataSize(fn, base, zone, section, &nv); cg_ElementDataSize(fn, base, zone, section, &nv);
Array<cgsize_t> vertices(nv); Array<cgsize_t> vertices(nv);
#if CGNS_VERSION < 3400
cg_elements_read(fn, base, zone, section, &vertices[0], nullptr);
#else
cg_poly_elements_read(fn, base, zone, section, &vertices[0], nullptr, nullptr); cg_poly_elements_read(fn, base, zone, section, &vertices[0], nullptr, nullptr);
#endif
size_t vi = 0; size_t vi = 0;
while(vi<nv) while(vi<nv)

View File

@ -1,5 +1,5 @@
FROM ubuntu:19.10 FROM ubuntu:19.10
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
MAINTAINER Matthias Hochsteger <matthias.hochsteger@tuwien.ac.at> MAINTAINER Matthias Hochsteger <matthias.hochsteger@tuwien.ac.at>
RUN apt-get update && apt-get -y install python3 libpython3-dev libxmu-dev tk-dev tcl-dev cmake git g++ libglu1-mesa-dev ccache python3-pytest python3-numpy python3-tk clang-tidy python3-distutils clang libocct-data-exchange-dev libcgns-dev RUN apt-get update && apt-get -y install python3 libpython3-dev libxmu-dev tk-dev tcl-dev cmake git g++ libglu1-mesa-dev ccache python3-pytest python3-numpy python3-tk clang-tidy python3-distutils clang libocct-data-exchange-dev libcgns-dev libhdf5-dev
ADD . /root/src/netgen ADD . /root/src/netgen