Commit f63e430d authored by Jan Kotanski's avatar Jan Kotanski
Browse files

Updated version 0.1.3 from 'upstream/stretch/0.1.3'

with Debian dir b9a37461e482ff27dfac6ed6caefb96e57af2adf
parents b7185a10 bdfc4d98
/build*/
/cmake-build-*/
*.user
.idea
.idea/
*.swp
......
......@@ -3,38 +3,38 @@ coverage_os = "centos7-release"
images = [
'centos7-release': [
'name': 'essdmscdm/centos7-build-node:3.2.0',
'name': 'essdmscdm/centos7-build-node:4.0.0',
'cmake': 'CC=/usr/lib64/mpich-3.2/bin/mpicc CXX=/usr/lib64/mpich-3.2/bin/mpicxx cmake3',
'sh': '/usr/bin/scl enable rh-python35 devtoolset-6 -- /bin/bash -e',
'sh': '/usr/bin/scl enable devtoolset-6 -- /bin/bash -e',
'cmake_flags': '-DCOV=1 -DWITH_MPI=1 -DCONAN_FILE=conanfile_ess_mpi.txt -DCMAKE_BUILD_TYPE=Release'
],
'debian9-release': [
'name': 'essdmscdm/debian9-build-node:2.3.0',
'name': 'essdmscdm/debian9-build-node:3.0.0',
'cmake': 'cmake',
'sh': 'bash -e',
'cmake_flags': '-DCMAKE_BUILD_TYPE=Release'
],
'ubuntu1804-release': [
'name': 'essdmscdm/ubuntu18.04-build-node:1.2.0',
'name': 'essdmscdm/ubuntu18.04-build-node:2.0.0',
'cmake': 'cmake',
'sh': 'bash -e',
'cmake_flags': '-DCMAKE_BUILD_TYPE=Release'
],
'centos7-debug': [
'name': 'essdmscdm/centos7-build-node:3.2.0',
'name': 'essdmscdm/centos7-build-node:4.0.0',
'cmake': 'CC=/usr/lib64/mpich-3.2/bin/mpicc CXX=/usr/lib64/mpich-3.2/bin/mpicxx cmake3',
'sh': '/usr/bin/scl enable rh-python35 devtoolset-6 -- /bin/bash -e',
'sh': '/usr/bin/scl enable devtoolset-6 -- /bin/bash -e',
'cmake_flags': '-DWITH_MPI=1 -DCONAN_FILE=conanfile_ess_mpi.txt -DCMAKE_BUILD_TYPE=Debug'
],
'debian9-debug': [
'name': 'essdmscdm/debian9-build-node:2.3.0',
'name': 'essdmscdm/debian9-build-node:3.0.0',
'cmake': 'cmake',
'sh': 'bash -e',
'cmake_flags': '-DCMAKE_BUILD_TYPE=Debug'
],
'ubuntu1804-debug': [
'name': 'essdmscdm/ubuntu18.04-build-node:1.2.0',
'name': 'essdmscdm/ubuntu18.04-build-node:2.0.0',
'cmake': 'cmake',
'sh': 'bash -e',
'cmake_flags': '-DCMAKE_BUILD_TYPE=Debug'
......@@ -48,9 +48,6 @@ def failure_function(exception_obj, failureMessage) {
emailext body: '${DEFAULT_CONTENT}\n\"' + failureMessage +'\"\n\nCheck console output at $BUILD_URL to view the results.',
recipientProviders: toEmails,
subject: '${DEFAULT_SUBJECT}'
slackSend color: 'danger',
message: "${project}-${env.BRANCH_NAME}: " + failureMessage
throw exception_obj
}
......@@ -179,7 +176,6 @@ def get_pipeline(image_key)
} finally {
sh "docker stop ${container_name(image_key)}"
sh "docker rm -f ${container_name(image_key)}"
cleanWs()
}
}
}
......@@ -233,7 +229,7 @@ def get_win10_pipeline()
stage("Windows 10") {
node ("windows10") {
// Delete workspace when build is done
cleanWs()
cleanWs()
try {
checkout scm
......@@ -284,26 +280,26 @@ node('docker') {
builders['Windows10'] = get_win10_pipeline()
parallel builders
// Delete workspace when build is done
cleanWs()
try {
parallel builders
} catch (e) {
failure_function(e, 'Job failed')
throw e
} finally {
// Delete workspace when build is done
cleanWs()
}
}
node ("fedora") {
// Delete workspace when build is done
cleanWs()
stage("Documentation") {
dir("${project}/code") {
try {
try {
dir("${project}/code") {
checkout scm
} catch (e) {
failure_function(e, 'Generate docs / Checkout failed')
}
}
dir("${project}/build") {
try {
dir("${project}/build") {
sh "HDF5_ROOT=$HDF5_ROOT \
CMAKE_PREFIX_PATH=$HDF5_ROOT \
cmake -DCONAN=DISABLE ../code"
......@@ -311,16 +307,12 @@ node ("fedora") {
if (env.BRANCH_NAME != 'master') {
archiveArtifacts artifacts: 'doc/build/'
}
} catch (e) {
failure_function(e, 'Generate docs / make html failed')
}
}
dir("${project}/docs") {
try {
checkout scm
dir("${project}/docs") {
checkout scm
if (env.BRANCH_NAME == 'master') {
if (env.BRANCH_NAME == 'master') {
sh "git config user.email 'dm-jenkins-integration@esss.se'"
sh "git config user.name 'cow-bot'"
sh "git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'"
......@@ -345,11 +337,14 @@ node ("fedora") {
)]) {
sh "../code/push_to_repo.sh ${USERNAME} ${PASSWORD}"
}
}
} catch (e) {
failure_function(e, 'Generate docs / Publish docs failed')
}
} catch (e) {
failure_function(e, 'Generate docs / Publish docs failed')
} finally {
// Delete workspace when build is done
cleanWs()
}
}
}
......@@ -18,7 +18,7 @@ if(NOT GTest_FOUND)
OUTPUT_VARIABLE LSB_CODENAME
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(LSB_CODENAME MATCHES stretch)
if(LSB_CODENAME MATCHES stretch OR LSB_CODENAME MATCHES buster)
set(GTEST_SOURCE_DIR /usr/src/googletest/googletest)
elseif(LSB_CODENAME MATCHES jessie OR LSB_CODENAME MATCHES xenial OR LSB_CODENAME MATCHES bionic)
set(GTEST_SOURCE_DIR /usr/src/gtest)
......
[requires]
cmake_findboost_modular/1.65.1@bincrafters/stable
boost_filesystem/1.65.1@bincrafters/stable
boost_system/1.65.1@bincrafters/stable
cmake_findboost_modular/1.69.0@bincrafters/stable
boost_filesystem/1.69.0@bincrafters/stable
hdf5/1.10.2-dm2@ess-dmsc/stable
gtest/3121b20-dm3@ess-dmsc/stable
......
[requires]
cmake_findboost_modular/1.65.1@bincrafters/stable
boost_filesystem/1.65.1@bincrafters/stable
cmake_findboost_modular/1.69.0@bincrafters/stable
boost_filesystem/1.69.0@bincrafters/stable
hdf5/1.10.2-dm2@ess-dmsc/stable
gtest/3121b20-dm3@ess-dmsc/stable
......
......@@ -98,3 +98,49 @@ should finally install the code. The default installation prefix is
:envvar:`CMAKE_INSTALL_PREFIX` at the initial call to :program:`cmake` to the
desired installation location.
Debian and Ubuntu users
-----------------------
As Debian and Ubuntu are closely related the installation is quite similar.
The packages are provided by a special Debian repository. To work on the
package sources you need to login as `root` user. Use :command:`su` or
:command:`sudo su` on Debian and Ubuntu respectively.
The first task is to add the GPG key of the HDRI repository to your local
keyring
.. code-block:: bash
$ curl http://repos.pni-hdri.de/debian_repo.pub.gpg | apt-key add -
The return value of this command line should be `OK`.
In a next step you have to add new package sources to your system. For this
purpose go to :file:`/etc/apt/sources.list.d` and download the sources file.
For Debian (Stretch) use
.. code-block:: bash
$ wget http://repos.pni-hdri.de/stretch-pni-hdri.list
and for Ubuntu (Bionic)
.. code-block:: bash
$ wget http://repos.pni-hdri.de/bionic-pni-hdri.list
Similarly, proceed for Buster, Jessie, Cosmic or Xenial.
Once you have downloaded the file use
.. code-block:: bash
$ apt-get update
to update your package list and
.. code-block:: bash
$ apt-get install libh5cpp0.1.0 libh5cpp0.1.0-dbg libh5cpp0.1.0-doc libh5cpp0.1.0-dev
to install the library of v0.1.0. Dependencies will be resolved automatically so you can
start with working right after the installation has finished.
......@@ -36,9 +36,11 @@
#endif
#ifdef _MSC_VER
#include <BaseTsd.h>
using ssize_t = SSIZE_T;
#if defined _M_IX86
using ssize_t = int;
#elif defined _M_X64
#include <BaseTsd.h>
using ssize_t = SSIZE_T;
#endif
#endif
......@@ -29,30 +29,92 @@
#include <h5cpp/dataspace/selection.hpp>
#include <h5cpp/core/windows.hpp>
namespace hdf5 {
namespace dataspace {
namespace hdf5
{
namespace dataspace
{
class DLL_EXPORT Points : public Selection {
public:
Points() = default;
~Points() = default;
//!
//! \brief point selection implementation
//!
//!
class DLL_EXPORT Points : public Selection
{
public:
//!
//! \brief default constructor
//!
//! We use the compiler provided default implementation.
Points () = default;
explicit Points(size_t rank);
explicit Points(const std::vector<std::vector<hsize_t>>& coord_set);
//!
//! \brief destructor
//!
//! Use the compiler provided default implementation.
~Points () = default;
size_t rank() const;
size_t points() const;
//!
//! \brief constructor
//!
//! Create a new point selection or a given rank
//!
//! \param rank the number of dimensions of the selection
//!
explicit Points (size_t rank);
void add(const std::vector<hsize_t>& coords);
//!
//! \brief constructor
//!
//! Create a point selection from a set of selection coordinates. The
//! number of dimensions of the first coordinates determines the rank
//! of the selection.
//!
//! \param coord_set set of selection coordinates
//!
explicit Points (const std::vector<std::vector<hsize_t>>& coord_set);
void add_set(const std::vector<std::vector<hsize_t>>& coord_set);
//!
//! \brief get the number of dimensions
//!
//! \return number of dimensions of the selection.
//!
size_t rank () const;
void apply(const Dataspace &space,
SelectionOperation ops) const override;
//!
//! \brief get the number of points in the selection
//!
//! \return number of points as unsigned integer
//!
size_t points () const;
private:
size_t rank_{0};
std::vector<hsize_t> coordinates_;
//!
//! \brief add a new point to the selection
//!
//! \param coords index coordinates of the point
//! \throws runtime_error in the case of a failure
//!
void add (const std::vector<hsize_t>& coords);
//!
//! \brief add point set to the selection
//!
//! \param coord_set coordinate set
//! \throws runtime_error in the case of a failure
//!
void add_set (const std::vector<std::vector<hsize_t>>& coord_set);
//!
//! \brief apply the selection to a dataspace
//!
//! \param space reference to the dataspace onto which the selection should
//! be applied
//! \param ops opertion used to apply the selection
//!
void apply (const Dataspace &space, SelectionOperation ops) const override;
private:
size_t rank_{ 0 };
std::vector<hsize_t> coordinates_;
};
} // namespace dataspace
......
......@@ -23,6 +23,7 @@ set(HEADERS
${dir}/string.hpp
${dir}/array.hpp
${dir}/enum.hpp
${dir}/ebool.hpp
)
install(FILES ${HEADERS}
......
......@@ -128,6 +128,7 @@ class DLL_EXPORT Enum : public Datatype
template<typename T>
void Enum::check_type(const T& data) const
{
(void) data; // < var unused, only for type inference
auto mem_type = datatype::create<T>();
if (mem_type != super())
{
......
......@@ -35,8 +35,8 @@ namespace datatype {
//! \brief factory function for creating data types
//!
template<typename T>
typename TypeTrait<T>::TypeClass create(const T &v = T()) {
return TypeTrait<T>::create(v);
typename TypeTrait<typename std::remove_const<T>::type>::TypeClass create(const T &v = T()) {
return TypeTrait<typename std::remove_const<T>::type>::create(v);
}
} // namespace datatype
......
......@@ -72,116 +72,6 @@ class TypeTrait<char> {
}
};
template<>
class TypeTrait<std::int8_t const> {
public:
using Type = std::int8_t;
using TypeClass = Integer;
static TypeClass create(const Type & = Type()) {
return TypeClass(ObjectHandle(H5Tcopy(H5T_NATIVE_INT8)));
}
};
template<>
class TypeTrait<std::uint8_t const> {
public:
using Type = std::uint8_t;
using TypeClass = Integer;
static TypeClass create(const Type & = Type()) {
return TypeClass(ObjectHandle(H5Tcopy(H5T_NATIVE_UINT8)));
}
};
template<>
class TypeTrait<std::int16_t const> {
public:
using Type = std::int16_t;
using TypeClass = Integer;
static TypeClass create(const Type & = Type()) {
return TypeClass(ObjectHandle(H5Tcopy(H5T_NATIVE_INT16)));
}
};
template<>
class TypeTrait<std::uint16_t const> {
public:
using Type = std::uint16_t;
using TypeClass = Integer;
static TypeClass create(const Type & = Type()) {
return TypeClass(ObjectHandle(H5Tcopy(H5T_NATIVE_UINT16)));
}
};
template<>
class TypeTrait<std::int32_t const> {
public:
using Type = std::int32_t;
using TypeClass = Integer;
static TypeClass create(const Type & = Type()) {
return TypeClass(ObjectHandle(H5Tcopy(H5T_NATIVE_INT32)));
}
};
template<>
class TypeTrait<std::uint32_t const> {
public:
using Type = std::uint32_t;
using TypeClass = Integer;
static TypeClass create(const Type & = Type()) {
return TypeClass(ObjectHandle(H5Tcopy(H5T_NATIVE_UINT32)));
}
};
template<>
class TypeTrait<float const> {
public:
using Type = float;
using TypeClass = Float;
static TypeClass create(const Type & = Type()) {
return TypeClass(ObjectHandle(H5Tcopy(H5T_NATIVE_FLOAT)));
}
};
template<>
class TypeTrait<double const> {
public:
using Type = double;
using TypeClass = Float;
static TypeClass create(const Type & = Type()) {
return TypeClass(ObjectHandle(H5Tcopy(H5T_NATIVE_DOUBLE)));
}
};
template<>
class TypeTrait<char const> {
public:
using Type = char;
using TypeClass = Integer;
static TypeClass create(const Type & = Type()) {
return TypeClass(ObjectHandle(H5Tcopy(H5T_NATIVE_CHAR)));
}
};
template<>
class TypeTrait<std::int64_t const> {
public:
using Type = std::int64_t;
using TypeClass = Integer;
static TypeClass create(const Type & = Type()) {
return TypeClass(ObjectHandle(H5Tcopy(H5T_NATIVE_INT64)));
}
};
template<>
class TypeTrait<std::uint64_t const> {
public:
using Type = std::uint64_t;
using TypeClass = Integer;
static TypeClass create(const Type & = Type()) {
return TypeClass(ObjectHandle(H5Tcopy(H5T_NATIVE_UINT64)));
}
};
template<>
class TypeTrait<unsigned char> {
public:
......@@ -324,7 +214,7 @@ class TypeTrait<std::vector<T>> {
using Type = std::vector<T>;
using TypeClass = typename TypeTrait<T>::TypeClass;
static TypeClass create(const Type & = Type()) {
return TypeTrait<T>::create();
return TypeTrait<typename std::remove_const<T>::type>::create();
}
};
......@@ -334,7 +224,7 @@ class TypeTrait<std::array<T, N>> {
using Type = std::array<T, N>;
using TypeClass = typename TypeTrait<T>::TypeClass;
static TypeClass create(const Type & = Type()) {
return TypeTrait<T>::create();
return TypeTrait<typename std::remove_const<T>::type>::create();
}
};
......
......@@ -86,7 +86,7 @@ void DirectDriver::operator()(const property::FileAccessList &fapl) const
DriverID DirectDriver::id() const noexcept
{
return DriverID::DIRECT;
return DriverID::eDirect;
}
} // namespace file
......
......@@ -30,25 +30,28 @@
//
// Forward declaration of property lists
//
namespace hdf5 {
namespace property {
namespace hdf5
{
namespace property
{
class FileAccessList;
}
}
} // namespace property
} // namespace hdf5
namespace hdf5 {
namespace file {
namespace hdf5
{
namespace file
{
//!
//! \brief enumeration to determine the file driver
//!
enum class DriverID : unsigned {
POSIX = 1,
DIRECT = 2,
MEMORY = 3,
MPI = 4
enum class DriverID : unsigned
{
ePosix = 1,
eDirect = 2,
eMemory = 3,
eMPI = 4
};
//!
......@@ -61,27 +64,28 @@ enum class DriverID : unsigned {
//!
class DLL_EXPORT Driver
{
public:
//!
//! \brief unique pointer type
//!
using UniquePointer = std::unique_ptr<Driver>;
public:
//!
//! \brief unique pointer type
//!
using UniquePointer = std::unique_ptr<Driver>;
virtual ~Driver(){}
virtual ~Driver()
{}
//!
//! \brief set a driver
//!
//! Sets a driver to a particular file access property list.
//!
virtual void operator()(const hdf5::property::FileAccessList &fapl) const = 0;
//!
//! \brief set a driver
//!
//! Sets a driver to a particular file access property list.
//!
virtual void operator()(const hdf5::property::FileAccessList& fapl) const = 0;
//!
//! \brief get driver ID
//!
//! Return the ID of a particular driver.
//1