Skip to content

Commit 37a5f9f

Browse files
authored
Merge pull request #2240 from SCIInstitute/more-fixes
Closes #1819; some of #648
2 parents 843e10d + b62e7ba commit 37a5f9f

File tree

718 files changed

+4667
-8193
lines changed

Some content is hidden

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

718 files changed

+4667
-8193
lines changed

.travis.yml

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,58 +3,58 @@ language: c++
33

44
matrix:
55
include:
6-
- os: linux
7-
dist: trusty
8-
compiler: gcc
9-
env: PYTHON_VERSION=3.4.3 OSPRAY_BUILD=OFF
10-
- os: linux
11-
dist: xenial
12-
compiler: gcc
13-
env: PYTHON_VERSION=3.5.6 OSPRAY_BUILD=OFF
14-
- os: linux
15-
dist: xenial
16-
compiler: clang
17-
env: PYTHON_VERSION=3.5.6 OSPRAY_BUILD=OFF
6+
# - os: linux
7+
# dist: trusty
8+
# compiler: gcc
9+
# env: PYTHON_VERSION=3.4.3 OSPRAY_BUILD=OFF
10+
# - os: linux
11+
# dist: xenial
12+
# compiler: gcc
13+
# env: PYTHON_VERSION=3.5.6 OSPRAY_BUILD=OFF
14+
# - os: linux
15+
# dist: xenial
16+
# compiler: clang
17+
# env: PYTHON_VERSION=3.5.6 OSPRAY_BUILD=OFF
1818
- os: linux
1919
dist: xenial
2020
compiler: gcc
2121
env: PYTHON_VERSION=3.6.7 OSPRAY_BUILD=OFF
22-
- os: linux
23-
dist: bionic
24-
compiler: gcc
25-
env: PYTHON_VERSION=3.5.6 OSPRAY_BUILD=OFF
26-
- os: linux
27-
dist: focal
28-
compiler: gcc
29-
env: PYTHON_VERSION=3.5.6 OSPRAY_BUILD=OFF
22+
# - os: linux
23+
# dist: bionic
24+
# compiler: gcc
25+
# env: PYTHON_VERSION=3.5.6 OSPRAY_BUILD=OFF
26+
# - os: linux
27+
# dist: focal
28+
# compiler: gcc
29+
# env: PYTHON_VERSION=3.5.6 OSPRAY_BUILD=OFF
3030
- os: linux
3131
dist: focal
3232
compiler: gcc
3333
env: PYTHON_VERSION=3.6.7 OSPRAY_BUILD=OFF
3434
- os: linux
3535
dist: focal
3636
compiler: gcc
37-
env: PYTHON_VERSION=3.7.1 OSPRAY_BUILD=OFF
37+
env: PYTHON_VERSION=3.7.9 OSPRAY_BUILD=OFF
3838
- os: linux
3939
dist: focal
4040
compiler: gcc
41-
env: PYTHON_VERSION=3.8.2 OSPRAY_BUILD=OFF
42-
- os: linux
43-
dist: focal
44-
compiler: clang
45-
env: PYTHON_VERSION=3.5.6 OSPRAY_BUILD=OFF
41+
env: PYTHON_VERSION=3.8.7 OSPRAY_BUILD=OFF
42+
# - os: linux
43+
# dist: focal
44+
# compiler: clang
45+
# env: PYTHON_VERSION=3.5.6 OSPRAY_BUILD=OFF
4646
- os: linux
4747
dist: focal
4848
compiler: clang
4949
env: PYTHON_VERSION=3.6.7 OSPRAY_BUILD=OFF
5050
- os: linux
5151
dist: focal
5252
compiler: clang
53-
env: PYTHON_VERSION=3.7.1 OSPRAY_BUILD=OFF
53+
env: PYTHON_VERSION=3.7.9 OSPRAY_BUILD=OFF
5454
- os: linux
5555
dist: focal
5656
compiler: clang
57-
env: PYTHON_VERSION=3.8.2 OSPRAY_BUILD=OFF
57+
env: PYTHON_VERSION=3.8.7 OSPRAY_BUILD=OFF
5858
- os: osx
5959
osx_image: xcode10.3
6060
env: PYTHON_VERSION=3.6.7 OSPRAY_BUILD=OFF
@@ -66,7 +66,7 @@ matrix:
6666
env: PYTHON_VERSION=3.7.9 OSPRAY_BUILD=OFF
6767
- os: osx
6868
osx_image: xcode11.3
69-
env: PYTHON_VERSION=3.8.2 OSPRAY_BUILD=OFF
69+
env: PYTHON_VERSION=3.8.7 OSPRAY_BUILD=OFF
7070
- os: osx
7171
osx_image: xcode12.2
7272
env: PYTHON_VERSION=3.6.7 OSPRAY_BUILD=OFF
@@ -75,7 +75,10 @@ matrix:
7575
env: PYTHON_VERSION=3.7.9 OSPRAY_BUILD=OFF
7676
- os: osx
7777
osx_image: xcode12.2
78-
env: PYTHON_VERSION=3.8.2 OSPRAY_BUILD=OFF
78+
env: PYTHON_VERSION=3.8.7 OSPRAY_BUILD=OFF
79+
- os: osx
80+
osx_image: xcode12.2
81+
env: PYTHON_VERSION=3.9.1 OSPRAY_BUILD=OFF
7982

8083

8184
before_install:
@@ -93,9 +96,10 @@ install:
9396

9497
script:
9598
- cd bin
96-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake -GNinja -DTRAVIS_BUILD:BOOL=ON -DUSER_PYTHON_VERSION="${PYTHON_VERSION}" -DWITH_OSPRAY:BOOL=${OSPRAY_BUILD} -DQt5_PATH=$(brew --prefix qt) ../Superbuild; fi
97-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -GNinja -DTRAVIS_BUILD:BOOL=ON -DUSER_PYTHON_VERSION="${PYTHON_VERSION}" -DWITH_OSPRAY:BOOL=${OSPRAY_BUILD} -DQt5_PATH=$(dpkg -L qtbase5-dev) ../Superbuild; fi
98-
- travis_wait 80 ninja # max is 50 minutes on public repository
99+
#-GNinja producing strange errors
100+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake -DTRAVIS_BUILD:BOOL=ON -DUSER_PYTHON_VERSION="${PYTHON_VERSION}" -DWITH_OSPRAY:BOOL=${OSPRAY_BUILD} -DQt5_PATH=$(brew --prefix qt) ../Superbuild; fi
101+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -DTRAVIS_BUILD:BOOL=ON -DUSER_PYTHON_VERSION="${PYTHON_VERSION}" -DWITH_OSPRAY:BOOL=${OSPRAY_BUILD} -DQt5_PATH=$(dpkg -L qtbase5-dev) ../Superbuild; fi
102+
- travis_wait 80 make -j4
99103
- cd SCIRun
100104
- ./Algorithm_Layer_Test
101105
- ./Modules_Factory_Tests --gtest_filter=*HardCodedModuleFactoryTests*

Superbuild/UseBoost.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ foreach(lib ${SCI_BOOST_LIBRARY})
5050
else() # non-python libraries
5151
if(WIN32)
5252
set(FULL_LIB_NAME_RELEASE "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}-x64${CMAKE_STATIC_LIBRARY_SUFFIX}")
53-
set(FULL_LIB_NAME_DEBUG "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${DEBUG_POSTFIX}$-x64${CMAKE_STATIC_LIBRARY_SUFFIX}")
53+
set(FULL_LIB_NAME_DEBUG "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${DEBUG_POSTFIX}-x64${CMAKE_STATIC_LIBRARY_SUFFIX}")
5454
else()
5555
set(FULL_LIB_NAME_RELEASE "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}")
5656
set(FULL_LIB_NAME_DEBUG "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")

docs/SCIRun5ModuleGeneration.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,10 @@ class SCISHARE @ModuleName@Dialog : public ModuleDialogGeneric,
349349
public:
350350
@ModuleName@Dialog(const std::string& name,
351351
SCIRun::Dataflow::Networks::ModuleStateHandle state,
352-
QWidget* parent = 0);
352+
QWidget* parent = nullptr);
353353
//this function would be from pulling data from module,
354354
// usually to change the UI.
355-
virtual void pull() override;
355+
void pull() override;
356356
};
357357
}}
358358
#endif
@@ -373,7 +373,7 @@ using namespace SCIRun::Core::Algorithms::Fields;
373373
374374
@ModuleName@Dialog::@ModuleName@Dialog(const std::string& name,
375375
ModuleStateHandle state,
376-
QWidget* parent /* = 0 */)
376+
QWidget* parent /* = nullptr */)
377377
: ModuleDialogGeneric(state, parent)
378378
{
379379
setupUi(this);
@@ -739,7 +739,7 @@ class SCISHARE TestModuleSimpleUIDialog : public ModuleDialogGeneric,
739739
public:
740740
TestModuleSimpleUIDialog(const std::string& name,
741741
SCIRun::Dataflow::Networks::ModuleStateHandle state,
742-
QWidget* parent = 0);
742+
QWidget* parent = nullptr);
743743
};
744744
}}
745745
#endif
@@ -758,7 +758,7 @@ using namespace SCIRun::Modules::StringManip;
758758
759759
TestModuleSimpleUIDialog::TestModuleSimpleUIDialog(const std::string& name,
760760
ModuleStateHandle state,
761-
QWidget* parent /* = 0 */)
761+
QWidget* parent /* = nullptr */)
762762
: ModuleDialogGeneric(state, parent)
763763
{
764764
setupUi(this);
@@ -1065,7 +1065,7 @@ namespace SCIRun {
10651065
public:
10661066
SortMatrixDialog(const std::string& name,
10671067
SCIRun::Dataflow::Networks::ModuleStateHandle state,
1068-
QWidget* parent = 0);
1068+
QWidget* parent = nullptr);
10691069
};
10701070
}}
10711071
#endif
@@ -1084,7 +1084,7 @@ using namespace SCIRun::Core::Algorithms;
10841084
10851085
SortMatrixDialog::SortMatrixDialog(const std::string& name,
10861086
ModuleStateHandle state,
1087-
QWidget* parent/* = 0*/)
1087+
QWidget* parent/* = nullptr*/)
10881088
: ModuleDialogGeneric(state, parent)
10891089
{
10901090
setupUi(this);
@@ -1173,7 +1173,7 @@ AlgorithmOutput SortMatrixAlgo::run(const AlgorithmInput& input) const
11731173
{
11741174
//TODO implement something with sparse
11751175
error("SortMatrix: Currently only works with dense matrices");
1176-
output[Variables::OutputMatrix] = 0;
1176+
output[Variables::OutputMatrix] = nullptr;
11771177
return output;
11781178
}
11791179
auto mat = castMatrix::toDense (input_matrix);

src/CMakeLists.txt

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,7 @@
2525
# DEALINGS IN THE SOFTWARE.
2626
#
2727

28-
29-
IF(UNIX)
30-
# temporary - needed to make Travis CI build work
31-
# TODO: revisit and delete when CMake 2.8.11 or greater is available
32-
# or switch to another CI tool
33-
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7 FATAL_ERROR)
34-
ELSE()
35-
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR)
36-
ENDIF()
37-
38-
IF(POLICY CMP0042)
39-
# TODO: when support for versions older than 2.8.12 is dropped,
40-
# enable new policy and get rid of version check
41-
#
42-
# see https://cmake.org/cmake/help/v3.0/policy/CMP0042.html
43-
CMAKE_POLICY(SET CMP0042 OLD)
44-
ENDIF()
45-
IF(POLICY CMP0043)
46-
CMAKE_POLICY(SET CMP0043 OLD)
47-
ENDIF()
48-
IF(POLICY CMP0049)
49-
CMAKE_POLICY(SET CMP0049 NEW)
50-
ENDIF()
28+
CMAKE_MINIMUM_REQUIRED(VERSION 3.9 FATAL_ERROR)
5129

5230
PROJECT(SCIRun)
5331

@@ -575,6 +553,16 @@ ENDMACRO()
575553
MACRO(SCIRUN_ADD_LIBRARY library)
576554
ADD_LIBRARY(${library} ${ARGN})
577555

556+
if(MSVC)
557+
# TODO:
558+
# target_compile_options(${library} PRIVATE /W4 /WX)
559+
else()
560+
# TODO:
561+
#target_compile_options(${library} PRIVATE -Wunused-parameter)
562+
#eventually: -Wall -Wextra -pedantic -Werror)
563+
# to fix: -Wunused-parameter
564+
endif()
565+
578566
# Set up installer package (Release build only)
579567
IF(WIN32)
580568
INSTALL(TARGETS ${library} RUNTIME DESTINATION bin CONFIGURATIONS Release)

src/Core/Algorithms/Base/AlgorithmBase.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ AlgorithmStatusReporter::AlgorithmStatusReporter()
310310
#if DEBUG
311311
setUpdaterFunc(defaultUpdaterFunc_);
312312
#else
313-
setUpdaterFunc([](double x) {});
313+
setUpdaterFunc([](double) {});
314314
#endif
315315
}
316316

src/Core/Algorithms/Base/AlgorithmLogger.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ namespace Algorithms {
4545
Core::Logging::LoggerHandle getLogger() const { return logger_; }
4646

4747
/// functions for the algorithm, so it can forward errors if needed
48-
virtual void error(const std::string& error) const;
49-
virtual bool errorReported() const;
50-
virtual void setErrorFlag(bool flag);
51-
virtual void warning(const std::string& warning) const;
52-
virtual void remark(const std::string& remark) const;
53-
virtual void status(const std::string& status) const;
48+
void error(const std::string& error) const override;
49+
bool errorReported() const override;
50+
void setErrorFlag(bool flag) override;
51+
void warning(const std::string& warning) const override;
52+
void remark(const std::string& remark) const override;
53+
void status(const std::string& status) const override;
5454
private:
5555
Core::Logging::LoggerHandle logger_;
5656
Core::Logging::LoggerHandle defaultLogger_;

src/Core/Algorithms/BrainStimulator/SetupRHSforTDCSandTMSAlgorithm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace BrainStimulator {
6262
{
6363
public:
6464
SetupTDCSAlgorithm();
65-
virtual AlgorithmOutput run(const AlgorithmInput& input) const override;
65+
AlgorithmOutput run(const AlgorithmInput& input) const override;
6666

6767
boost::tuple<Datatypes::DenseMatrixHandle, Datatypes::DenseMatrixHandle, Datatypes::DenseMatrixHandle,
6868
Datatypes::DenseMatrixHandle, Datatypes::DenseMatrixHandle, Datatypes::DenseMatrixHandle, FieldHandle, Datatypes::DenseMatrixHandle, std::vector<double>> run(FieldHandle mesh, const std::vector<Variable>& elcs, const std::vector<Variable>& impelc,int num_of_elc, FieldHandle scalp_tri_surf, FieldHandle elc_tri_surf, SCIRun::Core::Datatypes::DenseMatrixHandle elc_sponge_location) const;

src/Core/Algorithms/BrainStimulator/SimulateForwardMagneticFieldAlgorithm.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class CalcFMField
6565
public:
6666

6767
CalcFMField(const AlgorithmBase* algo) : algo_(algo),
68-
np_(-1),efld_(0),ctfld_(0),dipfld_(0),detfld_(0),emsh_(0),ctmsh_(0),dipmsh_(0),detmsh_(0),magfld_(0),magmagfld_(0)
68+
np_(-1),efld_(nullptr),ctfld_(nullptr),dipfld_(nullptr),detfld_(nullptr),emsh_(nullptr),ctmsh_(nullptr),dipmsh_(nullptr),detmsh_(nullptr),magfld_(nullptr),magmagfld_(nullptr)
6969
{
7070
}
7171

@@ -263,7 +263,7 @@ boost::tuple<FieldHandle,FieldHandle> CalcFMField::calc_forward_magnetic_field(F
263263

264264
if (!efld_ || !ctfld_ || !ctmsh_ || !dipfld_ || !detfld_ || !emsh_ || !dipmsh_ || !detmsh_)
265265
{
266-
algo_->error("At least one required input field/mesh has a NULL pointer.");
266+
algo_->error("At least one required input field/mesh has a null pointer.");
267267
}
268268

269269
have_tensors_=false; /// we dont support a conductivity_table in a FieldHandle (could not be set in SCIRun4 as well)
@@ -318,7 +318,7 @@ boost::tuple<FieldHandle, FieldHandle> SimulateForwardMagneticFieldAlgo::run(Fie
318318
{
319319
if (!ElectricField || !DipoleSources || !DetectorLocations || !ConductivityTensors)
320320
{
321-
THROW_ALGORITHM_INPUT_ERROR("At least one required input has a NULL pointer.");
321+
THROW_ALGORITHM_INPUT_ERROR("At least one required input has a null pointer.");
322322
}
323323

324324
if (!ElectricField->vfield()->is_vector())

src/Core/Algorithms/BrainStimulator/SimulateForwardMagneticFieldAlgorithm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class SCISHARE SimulateForwardMagneticFieldAlgo : public AlgorithmBase
6161
static AlgorithmOutputName MagneticField;
6262
static AlgorithmOutputName MagneticFieldMagnitudes;
6363
boost::tuple<FieldHandle, FieldHandle> run(FieldHandle ElectricField, FieldHandle ConductivityTensors, FieldHandle DipoleSources, FieldHandle DetectorLocations) const;
64-
virtual AlgorithmOutput run(const AlgorithmInput &) const override;
64+
AlgorithmOutput run(const AlgorithmInput &) const override;
6565

6666
private:
6767

src/Core/Algorithms/DataIO/EigenMatrixFromScirunAsciiFormatConverter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace internal
4747
class SCISHARE EigenMatrixFromScirunAsciiFormatConverter
4848
{
4949
public:
50-
explicit EigenMatrixFromScirunAsciiFormatConverter(const Utility::ProgressReporter* reporter = 0);
50+
explicit EigenMatrixFromScirunAsciiFormatConverter(const Utility::ProgressReporter* reporter = nullptr);
5151
Core::Datatypes::MatrixHandle make(const std::string& matFile);
5252

5353
Core::Datatypes::SparseRowMatrixHandle makeSparse(const std::string& matFile);

0 commit comments

Comments
 (0)