Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IO: use Boost library for reading/writing configuration files #442

Merged
merged 7 commits into from
Feb 15, 2024
Merged
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
46 changes: 9 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ if (BITPIT_ENABLE_MPI)
endif()
set(OPERATORS_EXTERNAL_DEPS "")
set(CONTAINERS_EXTERNAL_DEPS "")
set(IO_EXTERNAL_DEPS "LibXml2;RapidJSON")
set(IO_EXTERNAL_DEPS "Boost")
set(COMMUNICATIONS_EXTERNAL_DEPS "MPI")
set(LA_EXTERNAL_DEPS "PETSc")
set(SA_EXTERNAL_DEPS "")
Expand Down Expand Up @@ -831,39 +831,6 @@ if (${_LAPACKE_index} GREATER -1)
endif()
unset(_LAPACKE_index)

list(FIND EXTERNAL_DEPS "LibXml2" _LibXml2_index)
if (${_LibXml2_index} GREATER -1)
find_package(LibXml2 REQUIRED)

list (INSERT BITPIT_EXTERNAL_DEPENDENCIES 0 "LibXml2")
list (INSERT BITPIT_EXTERNAL_VARIABLES_LIBRARIES 0 "LIBXML2_LIBRARIES")
list (INSERT BITPIT_EXTERNAL_VARIABLES_INCLUDE_DIRS 0 "LIBXML2_INCLUDE_DIR")
endif()
unset(_LibXml2_index)

list(FIND EXTERNAL_DEPS "RapidJSON" _RapidJSON_index)
if (${_RapidJSON_index} GREATER -1)
find_package(RapidJSON 1.1.0 QUIET)
mark_as_advanced(RapidJSON_DIR)

if (RapidJSON_FOUND)
# RapidJSON library has been found
target_compile_definitions(${BITPIT_LIBRARY} PUBLIC "BITPIT_ENABLE_RAPIDJSON=1")

list (INSERT BITPIT_EXTERNAL_DEPENDENCIES 0 "RapidJSON")
list (INSERT BITPIT_EXTERNAL_VARIABLES_INCLUDE_DIRS 0 "RAPIDJSON_INCLUDE_DIRS")

# Activate std::string RapidJSON compliancy
target_compile_definitions(${BITPIT_LIBRARY} PUBLIC "RAPIDJSON_HAS_STDSTRING=1")
else()
# RapidJSON library has not been found
target_compile_definitions(${BITPIT_LIBRARY} PUBLIC "BITPIT_ENABLE_RAPIDJSON=0")

message(STATUS "RapidJSON library not found, JSON support will be disabled.")
endif()
endif()
unset(_RapidJSON_index)

list(FIND EXTERNAL_DEPS "PETSc" _PETSc_index)
if (${_PETSc_index} GREATER -1)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/external/PETSc/cmake")
Expand All @@ -890,15 +857,20 @@ if (${_PETSc_index} GREATER -1)
endif()
unset(_PETSc_index)

list(FIND EXTERNAL_DEPS "BoostTest" _BoostTest_index)
if (${_BoostTest_index} GREATER -1)
list(FIND EXTERNAL_DEPS "Boost" _Boost_index)
if (${_Boost_index} GREATER -1)
set(BOOST_COMPONENTS "")
list(FIND EXTERNAL_DEPS "BoostTest" _BoostTest_index)
if(${_BoostTest_index} GREATER -1)
LIST(APPEND BOOST_COMPONENTS "unit_test_framework")
endif()
string (REPLACE ";" " " BOOST_COMPONENTS_STRING "${BOOST_COMPONENTS}")

FIND_PACKAGE(Boost 1.40 COMPONENTS "${BOOST_COMPONENTS_STRING}" REQUIRED)
if ("${BOOST_COMPONENTS}" STREQUAL "")
FIND_PACKAGE(Boost 1.40 REQUIRED)
else ()
FIND_PACKAGE(Boost 1.40 COMPONENTS "${BOOST_COMPONENTS_STRING}" REQUIRED)
endif ()

list (INSERT BITPIT_EXTERNAL_DEPENDENCIES 0 "Boost")
list (INSERT BITPIT_EXTERNAL_VARIABLES_LIBRARIES 0 "Boost_LIBRARIES")
Expand Down
8 changes: 2 additions & 6 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ bitpit depends on
* (optionally) MPI implementation. It has been tested with OpenMPI >= 1.6.5.

Some additional dependencies are required for building specific modules
* libxml2 and its development headers are needed when compiling the 'IO'
* boost and its development headers are needed when compiling the 'IO'
module (please note that the 'IO' module is a dependecies for many other
bitpit modules, the only modules that do not depend on 'IO' are the low
level modules like 'operators', 'containers', 'LA', and 'SA'). Moreover,
json support is automatically enabled if RapidJSON (version 1.1.0) libraries
are installed on the system (https://github.com/Tencent/rapidjson): this is
a completely optional requirement, IO module will compile and work fine
with the only xml support too;
level modules like 'operators', 'containers', 'LA', and 'SA').
* blas, lapack, and lapacke are needed when compiling 'CG', 'RBF', and 'POD'
modules.

Expand Down
18 changes: 0 additions & 18 deletions README_WINDOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ This is a short guide to set a bitpit compliant 64bit Windows environment using
- mingw-w64-x86_64-toolchain
- mingw-w64-x86_64-lapack
- mingw-w64-x86_64-msmpi
- mingw-w64-x86_64-libxml2
- mingw-w64-x86_64-cmake
- mingw-w64-x86_64-qt5 (optional, but needed to run cmake-gui. Consider 1.22 GB to install it.)
- mingw-w64-x86_64-doxygen (to generate Doxygen documentation)
- mingw-w64-x86_64-graphviz (to generate Doxygen documentation)
- mingw-w64-x86_64-rapidjson (to enable JSON I/O support on IO module)

- <B>Microsoft MPI</B>: MSMpiSetup.exe or msmpisdk.msi (downloadable for free from https://www.microsoft.com/ searching for "MicrosoftMPI v x.x.x". Here the exact version x.x.x must be compliant with the version of MinGW64 package mingw-w64-x86_64-msmpi. See MSMPI section in procedure chapter for details)

Expand Down Expand Up @@ -200,22 +198,6 @@ user@machine MINGW64 ~
> pacman -S mingw-w64-x86_64-lapack
```

**__LIBMXL2__**

Install *libxml2* with:
```bash
user@machine MINGW64 ~
> pacman -S mingw-w64-x86_64-libxml2
```

**__RAPIDJSON__**

If JSON support on IO module is required, install *rapidjson* with:
```bash
user@machine MINGW64 ~
> pacman -S mingw-w64-x86_64-rapidjson
```

**__PETSc__**

_PETSc_ can be installed on the MSYS2/MinGW64 environment in two ways:
Expand Down
46 changes: 0 additions & 46 deletions THIRDPARTIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,37 +81,6 @@
```
</details>

## libxml2
<details>
<summary>See License</summary>

```
Except where otherwise noted in the source code (e.g. the files hash.c,
list.c and the trio files, which are covered by a similar licence but
with different Copyright notices) all the files are:

Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is fur-
nished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```
</details>

## METIS
<details>
<summary>See License</summary>
Expand Down Expand Up @@ -252,18 +221,3 @@
This license DOES NOT apply to any software that may be obtained via the download-package option of the PETSc configuration. Each of those packages are covered by their own licenses.
```
</details>

## RAPIDJSON
<details>
<summary>See License</summary>

```
Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```
</details>
4 changes: 1 addition & 3 deletions environments/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ RUN sed -i "s/htt[p|ps]:\/\/archive.ubuntu.com\/ubuntu\//mirror:\/\/mirrors.ubun
liblapack-dev \
liblapacke-dev \
mpich \
libxml2-dev \
libmetis-dev \
git \
wget \
python3 \
rapidjson-dev
python3

FROM bitpit-ubuntu-base AS bitpit-ubuntu-mpi
LABEL stage=bitpit-ubuntu-mpi
Expand Down
Loading