Skip to content

Commit e1d3579

Browse files
committed
Fix generation of faulty static library
This commit fixes issues #34, #35 and #36 (on GitHub) and #60, #61 and #62 (on GitLab) The fix consisted in subscribing **all** subclasses to the factory in a top-level convenience header that gets included into the `Meddle.cpp` file. Namespaces have finally been introduced into the project and some core abstract base classes have been renamed to signal their ABC status. Please see the [change log](CHANGELOG.md) for detailed information.
1 parent 31ca300 commit e1d3579

File tree

181 files changed

+2552
-1283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+2552
-1283
lines changed

.clang-format

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ AllowShortLoopsOnASingleLine: false
1212
AlwaysBreakAfterDefinitionReturnType: false
1313
AlwaysBreakBeforeMultilineStrings: false
1414
AlwaysBreakTemplateDeclarations: false
15-
BinPackArguments: true
16-
BinPackParameters: true
15+
BinPackArguments: false
16+
BinPackParameters: false
1717
BreakBeforeBinaryOperators: None
1818
BreakBeforeBraces: Attach
1919
BreakBeforeTernaryOperators: true

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# API files
66
api/*.h licensefile=.githooks/LICENSE-C
7-
api/*.F90 licensefile=.githooks/LICENSE-Fortran
7+
api/*.f90 licensefile=.githooks/LICENSE-Fortran
88

99
# include directory
1010
include/*.hpp licensefile=.githooks/LICENSE-C++

.magnum.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ before_install:
1717
- gfortran --version
1818
- python --version
1919
script:
20-
- python setup.py --cxx=g++ --cc=gcc --fc=gfortran --type=debug --cmake-options='-Hprojects/CMake'
20+
- python setup.py --cxx=g++ --cc=gcc --fc=gfortran --type=debug --static --cmake-options='-Hprojects/CMake'
2121
- cd build
2222
- cmake --build . -- --jobs=2 VERBOSE=1
2323
- ctest --parallel 2 --output-on-failure --verbose --dashboard Experimental --track MagnumCI

.travis.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ matrix:
6969
- C_COMPILER='clang-3.6'
7070
- Fortran_COMPILER='gfortran'
7171
- BUILD_TYPE='release'
72+
- STATIC='--static'
7273
- os: osx
7374
osx_image: xcode7.3
7475
compiler: gcc
@@ -108,6 +109,7 @@ matrix:
108109
- Fortran_COMPILER='gfortran-4.9'
109110
- BUILD_TYPE='release'
110111
- HOMEBREW_GCC='homebrew/versions/gcc49'
112+
- STATIC='--static'
111113
- os: linux
112114
compiler: clang
113115
addons: &4
@@ -189,6 +191,7 @@ matrix:
189191
- C_COMPILER='gcc-4.7'
190192
- Fortran_COMPILER='gfortran-4.7'
191193
- BUILD_TYPE='release'
194+
- STATIC='--static'
192195
- os: osx
193196
osx_image: xcode7.3
194197
compiler: gcc
@@ -198,6 +201,7 @@ matrix:
198201
- Fortran_COMPILER='gfortran-5'
199202
- BUILD_TYPE='release'
200203
- HOMEBREW_GCC='homebrew/versions/gcc5'
204+
- STATIC='--static'
201205
- os: linux
202206
compiler: gcc
203207
addons: &7
@@ -287,7 +291,7 @@ matrix:
287291
- C_COMPILER='gcc-5'
288292
- Fortran_COMPILER='gfortran-5'
289293
- BUILD_TYPE='release'
290-
- COVERAGE=true
294+
- COVERAGE='--coverage'
291295
allow_failures:
292296
- os: linux
293297
compiler: gcc
@@ -297,7 +301,7 @@ matrix:
297301
- C_COMPILER='gcc-5'
298302
- Fortran_COMPILER='gfortran-5'
299303
- BUILD_TYPE='release'
300-
- COVERAGE=true
304+
- COVERAGE='--coverage'
301305
install:
302306
- |
303307
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
@@ -316,12 +320,7 @@ before_script:
316320
- export FC=${Fortran_COMPILER}
317321
- ${Fortran_COMPILER} --version
318322
- python --version
319-
- |
320-
if [[ "${COVERAGE}" = true ]]; then
321-
python setup.py --cxx=${CXX_COMPILER} --cc=${C_COMPILER} --fc=${Fortran_COMPILER} --type=${BUILD_TYPE} --cmake-options='-Hprojects/CMake' --coverage
322-
else
323-
python setup.py --cxx=${CXX_COMPILER} --cc=${C_COMPILER} --fc=${Fortran_COMPILER} --type=${BUILD_TYPE} --cmake-options='-Hprojects/CMake'
324-
fi
323+
- python setup.py --cxx=${CXX_COMPILER} --cc=${C_COMPILER} --fc=${Fortran_COMPILER} --type=${BUILD_TYPE} --cmake-options='-Hprojects/CMake' ${STATIC} ${COVERAGE}
325324
- cd build
326325
script:
327326
- ctest --parallel 2 --output-on-failure --verbose --dashboard Experimental --track TravisCI

CHANGELOG.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,61 @@
11
# Change Log
22

3+
## [Unreleased]
4+
5+
### Added
6+
7+
- Namespaces for all of the internal code have been introduced.
8+
The top-level namespace is `pcm`. At finer levels the namespaces have the same
9+
names as the respective subdirectories. Read the programmers' documentation
10+
for further details on the use of namespaces in the project.
11+
Related to issue #34 on [GitHub] and #60 on [GitLab].
12+
- The top-level, convenience header `BoundaryIntegralOperator.hpp` includes all
13+
subclasses and utility headers in the `bi_operators` subdirectory.
14+
Related to issue #34 on [GitHub] and #60 on [GitLab].
15+
- The top-level, convenience header `Cavity.hpp` includes all subclasses and
16+
utility headers in the `cavity` subdirectory.
17+
Related to issue #34 on [GitHub] and #60 on [GitLab].
18+
- The top-level, convenience header `Green.hpp` includes all subclasses and
19+
utility headers in the `green` subdirectory.
20+
Related to issue #34 on [GitHub] and #60 on [GitLab].
21+
- The top-level, convenience header `Solver.hpp` includes all subclasses and
22+
utility headers in the `solver` subdirectory.
23+
Related to issue #34 on [GitHub] and #60 on [GitLab].
24+
25+
### Changed
26+
27+
- The abstract base class for the boundary integral operator integrators has
28+
been renamed `IBoundaryIntegralOperator`.
29+
The relevant factory is bootstrapped upon creation of the `Meddle` object,
30+
i.e. at library initialization.
31+
Related to issue #34 on [GitHub] and #60 on [GitLab].
32+
- The abstract base class for the cavities has been renamed `ICavity`.
33+
The relevant factory is bootstrapped upon creation of the `Meddle` object,
34+
i.e. at library initialization.
35+
Related to issue #34 on [GitHub] and #60 on [GitLab].
36+
- The abstract base class for the solvers has been renamed `ISolver`.
37+
The relevant factory is bootstrapped upon creation of the `Meddle` object,
38+
i.e. at library initialization.
39+
Related to issue #34 on [GitHub] and #60 on [GitLab].
40+
- The `typedef` for numerical differentiation in the Green's function classes
41+
has been renamed `Stencil` to avoid name clashes with the `Numerical`
42+
boundary integral operator type.
43+
44+
### Deprecated
45+
46+
### Removed
47+
48+
### Fixed
49+
50+
- A bug in the selection of the extended diagnostics flags for the GNU C++
51+
compiler. These flags are now enabled only for versions >= 5.1.0 and when the
52+
C++11 standard is enable. Fixes issue #36 on [GitHub] and #62 on [GitLab].
53+
- A bug in the initialization of the factory for the cavity classes was fixed.
54+
The bug manifested only in the static library `libpcm.a`
55+
Fixes issue #34 on [GitHub] and #60 on [GitLab].
56+
57+
### Security
58+
359
## [Version 1.1.7] - 2016-12-01
460

561
### Added
@@ -247,3 +303,6 @@
247303
[Version 1.1.2]: https://github.com/PCMSolver/pcmsolver/compare/v1.1.1...v1.1.3
248304
[Version 1.1.1]: https://github.com/PCMSolver/pcmsolver/compare/v1.1.0...v1.1.1
249305
[Version 1.1.0]: https://github.com/PCMSolver/pcmsolver/releases/tag/v1.1.0
306+
307+
[GitHub]: https://github.com/PCMSolver/pcmsolver
308+
[GitLab]: https://gitlab.com/PCMSolver/pcmsolver

api/PCMInput.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* PCMSolver, an API for the Polarizable Continuum Model
3-
* Copyright (C) 2016 Roberto Di Remigio, Luca Frediani and collaborators.
3+
* Copyright (C) 2017 Roberto Di Remigio, Luca Frediani and collaborators.
44
*
55
* This file is part of PCMSolver.
66
*

api/pcmsolver.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
!
22
! PCMSolver, an API for the Polarizable Continuum Model
3-
! Copyright (C) 2016 Roberto Di Remigio, Luca Frediani and collaborators.
3+
! Copyright (C) 2017 Roberto Di Remigio, Luca Frediani and collaborators.
44
!
55
! This file is part of PCMSolver.
66
!

api/pcmsolver.h

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* PCMSolver, an API for the Polarizable Continuum Model
3-
* Copyright (C) 2016 Roberto Di Remigio, Luca Frediani and collaborators.
3+
* Copyright (C) 2017 Roberto Di Remigio, Luca Frediani and collaborators.
44
*
55
* This file is part of PCMSolver.
66
*
@@ -94,7 +94,8 @@ typedef void (*HostWriter)(const char * message);
9494
* respectively. Generators map to integers as in table :ref:`symmetry-ops`
9595
*/
9696
PCMSolver_API pcmsolver_context_t * pcmsolver_new(pcmsolver_reader_t input_reading,
97-
int nr_nuclei, double charges[],
97+
int nr_nuclei,
98+
double charges[],
9899
double coordinates[],
99100
int symmetry_info[],
100101
struct PCMInput * host_input,
@@ -145,7 +146,8 @@ PCMSolver_API void pcmsolver_get_centers(pcmsolver_context_t * context,
145146
* \param[in] its index of the finite element
146147
* \param[out] center array holding the coordinates of the finite element center
147148
*/
148-
PCMSolver_API void pcmsolver_get_center(pcmsolver_context_t * context, int its,
149+
PCMSolver_API void pcmsolver_get_center(pcmsolver_context_t * context,
150+
int its,
149151
double center[]);
150152

151153
/*! \brief Getter for the areas/weights of the finite elements
@@ -166,7 +168,8 @@ PCMSolver_API void pcmsolver_get_areas(pcmsolver_context_t * context,
166168
*/
167169
PCMSolver_API void pcmsolver_compute_asc(pcmsolver_context_t * context,
168170
const char * mep_name,
169-
const char * asc_name, int irrep);
171+
const char * asc_name,
172+
int irrep);
170173

171174
/*! \brief Computes response ASC given a MEP and the desired irreducible
172175
* representation
@@ -181,7 +184,8 @@ PCMSolver_API void pcmsolver_compute_asc(pcmsolver_context_t * context,
181184
*/
182185
PCMSolver_API void pcmsolver_compute_response_asc(pcmsolver_context_t * context,
183186
const char * mep_name,
184-
const char * asc_name, int irrep);
187+
const char * asc_name,
188+
int irrep);
185189

186190
/*! \brief Computes the polarization energy
187191
* \param[in, out] context the PCM context object
@@ -191,7 +195,9 @@ PCMSolver_API void pcmsolver_compute_response_asc(pcmsolver_context_t * context,
191195
* This function calculates the dot product of the given MEP and ASC vectors.
192196
*/
193197
PCMSolver_API double pcmsolver_compute_polarization_energy(
194-
pcmsolver_context_t * context, const char * mep_name, const char * asc_name);
198+
pcmsolver_context_t * context,
199+
const char * mep_name,
200+
const char * asc_name);
195201

196202
/*! \brief Getter for the ASC dipole
197203
* \param[in, out] context the PCM context object
@@ -210,7 +216,8 @@ PCMSolver_API double pcmsolver_get_asc_dipole(pcmsolver_context_t * context,
210216
* \param[in] name label of the surface function
211217
*/
212218
PCMSolver_API void pcmsolver_get_surface_function(pcmsolver_context_t * context,
213-
int size, double values[],
219+
int size,
220+
double values[],
214221
const char * name);
215222

216223
/*! \brief Sets a surface function given data and label
@@ -220,7 +227,8 @@ PCMSolver_API void pcmsolver_get_surface_function(pcmsolver_context_t * context,
220227
* \param[in] name label of the surface function
221228
*/
222229
PCMSolver_API void pcmsolver_set_surface_function(pcmsolver_context_t * context,
223-
int size, double values[],
230+
int size,
231+
double values[],
224232
const char * name);
225233

226234
/*! \brief Prints surface function contents to host output

cmake/custom/compilers/GNU.CXX.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ if(NOT DEFINED ENV{CXXFLAGS})
1515

1616
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_STANDARD_FLAG}")
1717
set(EXDIAG_CXX_FLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-final-types -Wsuggest-final-methods -Wsuggest-override -Wuseless-cast -Wunsafe-loop-optimizations)
18-
if(CXX_COMPILER_VERSION VERSION_LESS 4.9.0)
19-
message(STATUS "Old GNU C++ compiler. Turning off extended diagnostic flags.")
18+
if(CXX_COMPILER_VERSION VERSION_LESS 4.9.0 OR NOT ENABLE_CXX11_SUPPORT)
19+
message(STATUS "Turning off extended diagnostic flags.")
2020
set(EXDIAG_CXX_FLAGS)
2121
endif()
2222
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -DDEBUG -Wall -Wextra -Winit-self -Woverloaded-virtual -Wuninitialized -Wmissing-declarations -Wwrite-strings -Wno-sign-compare")

doc/code-reference/cavities.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ implemented through the generic Factory class.
1010
:scale: 70 %
1111
:align: center
1212

13-
Cavity
14-
------
15-
.. doxygenclass:: Cavity
13+
ICavity
14+
-------
15+
.. doxygenclass:: ICavity
1616
:project: PCMSolver
1717
:members:
1818
:protected-members:

0 commit comments

Comments
 (0)