Skip to content

Commit

Permalink
Build System Tweaks (BhallaLab#309)
Browse files Browse the repository at this point in the history
* Fixes as suggested by PyLint. Added a target pylint in cmake file.

* Do pylint testing on OSX.

* Fixed import statement.

* Fixed pylint errors, removed unneccessary file.

* Test of available attributes in moose.

* Install python-libsbml and pyneuroml on OSX before running pylint.

* Removed temporary attributes from test.

* plot_utils is not so important. It failes when python-tk not found.

* Fixed boost segfault with dense solver.
Also remove GSL specific attrib from the test.

* Tweak to cmake on OSX. New clang-llvm compiler options added to ignore unused pragmas. Import hhfit only when required.

* None of thest depends on matplotlib anymore.
Added one more rdesineur tests from moose-examples scripts.

* Fix travis: Install python-tk and python3-tk on travis.

* TIDY UP: basecode and benchmarks can be built independantly. [skip ci]

* Compiles as standalone. [skip ci]

* One more directory is standalone.

* Diffusion dir is standalone as well [skip ci]

* hsolve built in isolation as well [skip ci]

* ksolve is now tidied up [skip ci]

* needs local testing now.

* This passes locally with python3.

* include_guard is not in cmake2.8.

* More more fixes identified by clang-check.

* Added Cell.cpp to build system. This class is probably broken but good
to keep it included.
  • Loading branch information
dilawar authored and upibhalla committed Oct 2, 2018
1 parent 88bcf07 commit d274993
Show file tree
Hide file tree
Showing 186 changed files with 967 additions and 1,468 deletions.
9 changes: 0 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,6 @@ add_custom_target(uninstall
# This is for testing purpose.
link_directories(${CMAKE_CURRENT_BINARY_DIR})

################################# OS Specific ##################################
message(STATUS "Operating system: ${CMAKE_SYSTEM_NAME}")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
CMAKE_POLICY(SET CMP0042 NEW)
set(MACOSX TRUE)
else()
set(MACOSX FALSE)
endif()

################################ CMAKE OPTIONS ##################################
option(WITH_NSDF "Enable NSDF support. Requires hdf5" OFF )

Expand Down
10 changes: 6 additions & 4 deletions CheckCXXCompiler.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
########################### COMPILER MACROS #####################################
if(COMPILER_IS_TESTED)
return()
endif()

########################### COMPILER MACROS #####################################
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG( "-std=c++11" COMPILER_SUPPORTS_CXX11 )
CHECK_CXX_COMPILER_FLAG( "-std=c++0x" COMPILER_SUPPORTS_CXX0X )
Expand Down Expand Up @@ -34,12 +37,11 @@ if(COMPILER_SUPPORT_UNUSED_BUT_SET_VARIABLE_NO_WARN)
endif(COMPILER_SUPPORT_UNUSED_BUT_SET_VARIABLE_NO_WARN)

if(COMPILER_SUPPORTS_CXX11)
message(STATUS "Your compiler supports c++11 features. Enabling it")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_definitions( -DENABLE_CPP11 )
if(APPLE)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
message(STATUS "NOTE: Making clang to inline more aggresively" )
# message(STATUS "NOTE: Making clang to inline more aggresively" )
add_definitions( -mllvm -inline-threshold=1000 )
endif(APPLE)
else(COMPILER_SUPPORTS_CXX11)
Expand All @@ -50,4 +52,4 @@ else(COMPILER_SUPPORTS_CXX11)
")
endif(COMPILER_SUPPORTS_CXX11)


set(COMPILER_IS_TESTED ON)
8 changes: 0 additions & 8 deletions basecode/Cinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,6 @@ const Cinfo* Cinfo::find( const string& name )
map<string, Cinfo*>::iterator i = cinfoMap().find(name);
if ( i != cinfoMap().end() )
return i->second;

#ifdef RESULT_CHECK
stringstream ss;
ss << "+ " << name << " not found. Available names are " << endl;
ss << mapToString<string, Cinfo*>( cinfoMap() );
dump(ss.str(), "DEBUG");
#endif /* ----- not RESULT_CHECK ----- */

return 0;
}

Expand Down
13 changes: 0 additions & 13 deletions basecode/Eref.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@
#ifndef _EREF_H
#define _EREF_H

#ifdef CYMOOSE

#include <iostream>
#include <vector>
using namespace std;

class Element;
class Id;
class ObjId;
class MsgDigest;

#endif /* ----- CYMOOSE ----- */

class Eref
{
public:
Expand Down
7 changes: 0 additions & 7 deletions basecode/SrcFinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@
#ifndef _SRC_FINFO_H
#define _SRC_FINFO_H

#ifdef CYMOOSE

#include "../basecode/Finfo.h"
#include "../basecode/header.h"

#endif /* ----- CYMOOSE ----- */

/**
* This set of classes define Message Sources. Their main job is to supply
* a type-safe send operation, and to provide typechecking for it.
Expand Down
14 changes: 0 additions & 14 deletions basecode/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,10 @@
#include "header.h"
#include "SparseMatrix.h"

#ifndef WIN32
#include <sys/time.h>
#else
#include <time.h>
#endif
#include <math.h>
#include <queue>
#ifdef WIN32
#include "../external/xgetopt/XGetopt.h"
#else
#include <unistd.h> // for getopt
#endif
#include "../scheduling/Clock.h"
#include "../msg/DiagonalMsg.h"
#include "../msg/SparseMsg.h"
Expand Down Expand Up @@ -93,12 +85,6 @@ extern void mooseBenchmarks( unsigned int option );
unsigned int getNumCores()
{
unsigned int numCPU = 0;
#ifdef WIN_32
SYSTEM_INFO sysinfo;
GetSystemInfo( &sysinfo );

numCPU = sysinfo.dwNumberOfProcessors;
#endif

#ifdef LINUX
numCPU = sysconf( _SC_NPROCESSORS_ONLN );
Expand Down
6 changes: 4 additions & 2 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include_directories(../msg)
include_directories(../basecode)
cmake_minimum_required(VERSION 2.8)

include( ${CMAKE_CURRENT_SOURCE_DIR}/../CheckCXXCompiler.cmake )

add_library(benchmarks
benchmarks.cpp
kineticMarks.cpp
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/kineticMarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
** See the file COPYING.LIB for the full notice.
**********************************************************************/

#include "header.h"
#include "../basecode/header.h"
#include "../shell/Shell.h"

/// Small model, long runtime.
Expand Down
88 changes: 44 additions & 44 deletions biophysics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
include_directories(../basecode ../synapse ../utility ../)
include_directories(../external/muparser/include)
cmake_minimum_required(VERSION 2.8)
include(${CMAKE_CURRENT_SOURCE_DIR}/../CheckCXXCompiler.cmake)

if(WITH_GSL)
include_directories(${GSL_INCLUDE_DIRS})
endif(WITH_GSL)

set(BIOPHYSICS_SRCS
IntFire.cpp
SpikeGen.cpp
RandSpike.cpp
CompartmentDataHolder.cpp
CompartmentBase.cpp
Compartment.cpp
SymCompartment.cpp
GapJunction.cpp
ChanBase.cpp
ChanCommon.cpp
HHChannel.cpp
HHChannelBase.cpp
HHChannel2D.cpp
HHGate.cpp
HHGate2D.cpp
HHChannel2D.cpp
CaConcBase.cpp
CaConc.cpp
MgBlock.cpp
Nernst.cpp
Neuron.cpp
ReadCell.cpp
SwcSegment.cpp
ReadSwc.cpp
SynChan.cpp
NMDAChan.cpp
testBiophysics.cpp
IzhikevichNrn.cpp
DifShellBase.cpp
DifShell.cpp
DifBufferBase.cpp
DifBuffer.cpp
MMPump.cpp
Leakage.cpp
VectorTable.cpp
MarkovRateTable.cpp
MarkovChannel.cpp
MatrixOps.cpp
MarkovSolverBase.cpp
MarkovSolver.cpp
VClamp.cpp
Spine.cpp
IntFire.cpp
SpikeGen.cpp
RandSpike.cpp
CompartmentDataHolder.cpp
CompartmentBase.cpp
Compartment.cpp
SymCompartment.cpp
GapJunction.cpp
ChanBase.cpp
ChanCommon.cpp
HHChannel.cpp
HHChannelBase.cpp
HHChannel2D.cpp
HHGate.cpp
HHGate2D.cpp
HHChannel2D.cpp
CaConcBase.cpp
CaConc.cpp
MgBlock.cpp
Nernst.cpp
Neuron.cpp
ReadCell.cpp
SwcSegment.cpp
ReadSwc.cpp
SynChan.cpp
NMDAChan.cpp
testBiophysics.cpp
IzhikevichNrn.cpp
DifShellBase.cpp
DifShell.cpp
DifBufferBase.cpp
DifBuffer.cpp
MMPump.cpp
Leakage.cpp
VectorTable.cpp
MarkovRateTable.cpp
MarkovChannel.cpp
MatrixOps.cpp
MarkovSolverBase.cpp
MarkovSolver.cpp
VClamp.cpp
Spine.cpp
)

if(WITH_GSL)
Expand Down
3 changes: 1 addition & 2 deletions biophysics/CaConc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
** See the file COPYING.LIB for the full notice.
**********************************************************************/

// #include <cfloat>
#include "header.h"
#include "../basecode/header.h"
#include "CaConcBase.h"
#include "CaConc.h"

Expand Down
4 changes: 2 additions & 2 deletions biophysics/CaConcBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
**********************************************************************/

// #include <cfloat>
#include "header.h"
#include "ElementValueFinfo.h"
#include "../basecode/header.h"
#include "../basecode/ElementValueFinfo.h"
#include "CaConcBase.h"

///////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions biophysics/ChanBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
** See the file COPYING.LIB for the full notice.
**********************************************************************/

#include "header.h"
#include "ElementValueFinfo.h"
#include "../basecode/header.h"
#include "../basecode/ElementValueFinfo.h"
#include "ChanBase.h"

SrcFinfo1< double >* ChanBase::permeability()
Expand Down
2 changes: 1 addition & 1 deletion biophysics/ChanCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
** See the file COPYING.LIB for the full notice.
**********************************************************************/

#include "header.h"
#include "../basecode/header.h"
#include "ChanBase.h"
#include "ChanCommon.h"

Expand Down
4 changes: 2 additions & 2 deletions biophysics/CompartmentBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
** See the file COPYING.LIB for the full notice.
**********************************************************************/

#include "header.h"
#include "ElementValueFinfo.h"
#include "../basecode/header.h"
#include "../basecode/ElementValueFinfo.h"
#include "CompartmentBase.h"
#include "CompartmentDataHolder.h"
#include "../shell/Wildcard.h"
Expand Down
2 changes: 1 addition & 1 deletion biophysics/CompartmentDataHolder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
** GNU Lesser General Public License version 2.1
** See the file COPYING.LIB for the full notice.
**********************************************************************/
#include "header.h"
#include "../basecode/header.h"
#include "CompartmentBase.h"
#include "CompartmentDataHolder.h"
// static func
Expand Down
4 changes: 2 additions & 2 deletions biophysics/DifBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@

// Code:

#include "header.h"
#include "../basecode/header.h"
#include "DifBufferBase.h"
#include "DifBuffer.h"
#include "ElementValueFinfo.h"
#include "../basecode/ElementValueFinfo.h"
#include "../utility/numutil.h"
#include <cmath>
const double DifBuffer::EPSILON = 1.0e-10;
Expand Down
4 changes: 2 additions & 2 deletions biophysics/DifBufferBase.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "header.h"
#include "../basecode/header.h"
#include "DifBufferBase.h"
#include "ElementValueFinfo.h"
#include "../basecode/ElementValueFinfo.h"
#include "../utility/numutil.h"
#include <cmath>

Expand Down
2 changes: 1 addition & 1 deletion biophysics/DifShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
** See the file COPYING.LIB for the full notice.
**********************************************************************/

#include "header.h"
#include "../basecode/header.h"
#include "DifShellBase.h"
#include "DifShell.h"

Expand Down
4 changes: 2 additions & 2 deletions biophysics/DifShellBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
** See the file COPYING.LIB for the full notice.
****/

#include "header.h"
#include "../basecode/header.h"
#include "DifShellBase.h"
#include "ElementValueFinfo.h"
#include "../basecode/ElementValueFinfo.h"

SrcFinfo1< double >* DifShellBase::concentrationOut()
{
Expand Down
2 changes: 1 addition & 1 deletion biophysics/GapJunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

// Code:

#include "header.h"
#include "../basecode/header.h"
#include "GapJunction.h"

static SrcFinfo2< double, double >* channel1Out()
Expand Down
4 changes: 2 additions & 2 deletions biophysics/HHChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
** See the file COPYING.LIB for the full notice.
**********************************************************************/

#include "header.h"
#include "ElementValueFinfo.h"
#include "../basecode/header.h"
#include "../basecode/ElementValueFinfo.h"
#include "HHGate.h"
#include "ChanBase.h"
#include "ChanCommon.h"
Expand Down
4 changes: 2 additions & 2 deletions biophysics/HHChannel2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
** See the file COPYING.LIB for the full notice.
**********************************************************************/

#include "header.h"
#include "ElementValueFinfo.h"
#include "../basecode/header.h"
#include "../basecode/ElementValueFinfo.h"
#include "../builtins/Interpol2D.h"
#include "ChanBase.h"
#include "ChanCommon.h"
Expand Down
4 changes: 2 additions & 2 deletions biophysics/HHChannelBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
** See the file COPYING.LIB for the full notice.
**********************************************************************/

#include "header.h"
#include "ElementValueFinfo.h"
#include "../basecode/header.h"
#include "../basecode/ElementValueFinfo.h"
#include "HHGate.h"
#include "ChanBase.h"
#include "HHChannelBase.h"
Expand Down
Loading

0 comments on commit d274993

Please sign in to comment.