Skip to content

Commit

Permalink
Merge commit '96580978fd046d82b2545fdac8b72ea52bd4956c'
Browse files Browse the repository at this point in the history
  • Loading branch information
Dilawar Singh committed Nov 7, 2016
2 parents bcbc1c1 + 9658097 commit e5ac4a0
Show file tree
Hide file tree
Showing 69 changed files with 6,925 additions and 9,611 deletions.
29 changes: 16 additions & 13 deletions moose-core/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ env:
- CTEST_MODEL=Nightly
cache: apt

matrix:
allow_failures:
#matrix:
# allow_failures:
# - clang

before_script:
- sudo apt-get install -qq libxml2-dev libbz2-dev
Expand All @@ -31,29 +32,31 @@ before_script:
- sudo apt-get install -qq python3-numpy python3-matplotlib python3-dev
- sudo apt-get install -qq libboost-all-dev
- sudo apt-get install -qq libgsl0-dev

before_install:
- sbmlurl="http://sourceforge.net/projects/sbml/files/libsbml/5.9.0/stable/Linux/64-bit/libSBML-5.9.0-Linux-x64.deb"
- wget "$sbmlurl" -O libsbml.deb && sudo dpkg -i libsbml.deb
- sudo apt-get install -f
- sudo apt-get install -qq python-pip python3-pip
- sudo apt-get install -qq libgraphviz-dev
- sudo pip install python-libsbml
- sudo pip3 install python-libsbml
- sudo pip3 install pygraphviz

install:
- echo "nothing to do here"

script:
- sudo ldconfig /usr/lib64
- # First test is normal make scripts. (outdated).
- make
- # Now test the cmake with gsl
- ## CMAKE based flow
- mkdir -p _GSL_BUILD && cd _GSL_BUILD && cmake -DDEBUG=ON -DPYTHON_EXECUTABLE=/usr/bin/python ..
- make && ctest --output-on-failure
- cd .. # Build with python3.
- mkdir -p _GSL_BUILD2 && cd _GSL_BUILD2 && cmake -DDEBUG=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 ..
- make && ctest --output-on-failure
- cd .. # Now with boost.
- mkdir -p _BOOST_BUILD && cd _BOOST_BUILD && cmake -DWITH_BOOST=ON -DDEBUG=ON -DPYTHON_EXECUTABLE=/usr/bin/python ..
- make && ctest --output-on-failure
- cd .. # Now with boost and python3.
- cd ..
- echo "Python3 support. Removed python2-networkx and install python3"
- sudo apt-get remove -qq python-networkx
- sudo apt-get install -qq python3-networkx
- mkdir -p _GSL_BUILD2 && cd _GSL_BUILD2 && cmake -DDEBUG=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 ..
- make && ctest --output-on-failure
- cd .. # Now with BOOST and python3
- mkdir -p _BOOST_BUILD2 && cd _BOOST_BUILD2 && cmake -DWITH_BOOST=ON -DDEBUG=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 ..
- make && ctest --output-on-failure
- cd ..
Expand Down
67 changes: 0 additions & 67 deletions moose-core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,11 @@ option(WITH_MPI "Enable Openmpi support" OFF)
option(WITH_BOOST "Use boost library instead of GSL" OFF)
option(WITH_GSL "Use gsl-library. Alternative is WITH_BOOST" ON)

# If SBML is available, it will automaticall enable the support. If ON, then
# libSBML must be present.
option(WITH_SBML "Enable SBML support. Automatically detected." OFF)

# If GSL_STATIC_HOME is set, we use it to search for static gsl libs.
option(GSL_STATIC_HOME
"Path prefix where static gsl library can be found e.g. /opt/sw/gsl116 "
OFF
)
option(SBML_STATIC_HOME
"Path prefix where static sbml library can be found e.g. /opt/sbml/"
OFF
)
option(HDF5_STATIC_HOME
"Path prefix where static hdf5 library can be found e.g /opt/sw/hdf5 "
OFF
Expand Down Expand Up @@ -165,57 +157,6 @@ if(WITH_BOOST)
set(WITH_GSL OFF)
endif(WITH_BOOST)

# If this variable is used while packaging; we build this project using another
# cmake script and pass the location of SBML static library using this variable.
# Otherwise, this is useless. FIXME: This is not a clean solution.
if(SBML_STATIC_HOME)
include_directories(${SBML_STATIC_HOME}/include)
find_library(LIBSBML_LIBRARIES
NAMES libsbml-static.a libsbml.a
PATHS "${SBML_STATIC_HOME}/lib" "${SBML_STATIC_HOME}/lib64"
NO_DEFAULT_PATH
)
message(STATUS "- Using static version of LIBSBML_LIBRARIES: ${LIBSBML_LIBRARIES}")
if(LIBSBML_LIBRARIES)
message(STATUS "- Successfully located SBML static library: ${LIBSBML_LIBRARIES}")
ELSE()
message(FATAL_ERROR
"Can't find static libsbml libraries at path ${SBML_STATIC_HOME}"
)
endif()
set(LIBSBML_FOUND ON)
else(SBML_STATIC_HOME)
pkg_check_modules(LIBSBML libsbml)
if(NOT LIBSBML_FOUND)
message(STATUS "pkg-config could not find sbml. Fallback to default")
find_package(LIBSBML)
endif()
endif(SBML_STATIC_HOME)

if(LIBSBML_FOUND)
message(STATUS "LIBSBML found ${LIBSBML_LIBRARIES}")
include_directories(${LIBSBML_INCLUDE_DIRS})
pkg_check_modules(LibXML2 libxml-2.0)
if (!LibXML2_FOUND)
find_package(LibXML2 REQUIRED)
endif()
include_directories(${LibXML2_INCLUDE_DIRS})
else()
message(
"======================================================================\n"
"libsbml NOT found. \n\n"
"If you want to compile with SBML support, download and install \n"
"libsbml-5.9.0 from: \n"
"http://sourceforge.net/projects/sbml/files/libsbml/5.9.0/stable/ and\n"
"rerun cmake.\n\n"
"If you don't want SBML support then continue with `make`.\n\n"
"If you install libsbml to non-standard place, let the cmake know by\n"
"exporting environment variable SBML_DIR to the location.\n"
"=====================================================================\n"
)
SET(WITH_SBML OFF)
endif()

include_directories(msg basecode)

set_target_properties(libmoose PROPERTIES COMPILE_DEFINITIONS "MOOSE_LIB")
Expand Down Expand Up @@ -366,7 +307,6 @@ add_subdirectory(biophysics)
add_subdirectory(builtins)
add_subdirectory(utility)
add_subdirectory(mesh)
add_subdirectory(sbml)
add_subdirectory(mpi)
add_subdirectory(signeur)
add_subdirectory(ksolve)
Expand Down Expand Up @@ -400,13 +340,6 @@ elseif(HDF5_FOUND)
list(APPEND SYSTEM_SHARED_LIBS ${HDF5_LIBRARIES})
endif()

LIST(APPEND STATIC_LIBRARIES moose_sbml)
if(SBML_STATIC_HOME)
list(APPEND STATIC_LIBRARIES ${LIBSBML_LIBRARIES})
elseif(LIBSBML_FOUND)
list(APPEND SYSTEM_SHARED_LIBS ${LIBSBML_LIBRARIES})
endif()

if(WITH_GSL)
if(GSL_STATIC_HOME)
message(STATUS "Using STATIC gsl libraries: ${GSL_LIBRARIES}")
Expand Down
1 change: 1 addition & 0 deletions moose-core/CheckCXXCompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHECK_CXX_COMPILER_FLAG( "-std=c++11" COMPILER_SUPPORTS_CXX11 )
CHECK_CXX_COMPILER_FLAG( "-std=c++0x" COMPILER_SUPPORTS_CXX0X )
CHECK_CXX_COMPILER_FLAG( "-Wno-strict-aliasing" COMPILER_WARNS_STRICT_ALIASING )


# Turn warning to error: Not all of the options may be supported on all
# versions of compilers. be careful here.
add_definitions(-Wall
Expand Down
14 changes: 2 additions & 12 deletions moose-core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

# Default values for flags. The operator ?= assigns the given value only if the
# variable is not already defined.
USE_SBML?=0
#USE_SBML?=0
USE_HDF5?=1
USE_CUDA?=0
USE_NEUROKIT?=0
Expand Down Expand Up @@ -230,16 +230,6 @@ else
LIBS+= -lm
endif

#harsha
# To use SBML, pass USE_SBML=1 in make command line
ifeq ($(USE_SBML),1)
LIBS+= -lsbml
CXXFLAGS+=-DUSE_SBML
LDFLAGS += -L/usr/lib64 -Wl,--rpath='/usr/lib64'
SBML_DIR = sbml
SBML_LIB = sbml/_sbml.o
endif

#Saeed
# To use CUDA, pass USE_CUDA=1 in make command line
ifeq ($(USE_CUDA),1)
Expand Down Expand Up @@ -371,7 +361,7 @@ export CXXFLAGS
export LD
export LIBS
export USE_GSL
export USE_SBML
#export USE_SBML

all: moose pymoose

Expand Down
16 changes: 8 additions & 8 deletions moose-core/MooseTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ set_tests_properties(pymoose-ksolve-test
PROPERTIES ENVIRONMENT "PYTHONPATH=${PROJECT_BINARY_DIR}/python"
)

# Test basic SBML support.
ADD_TEST(NAME pymoose-test-basic-sbml-support
COMMAND ${TEST_COMMAND}
${PROJECT_SOURCE_DIR}/tests/python/test_sbml_support.py
)
set_tests_properties(pymoose-test-basic-sbml-support
PROPERTIES ENVIRONMENT "PYTHONPATH=${PROJECT_BINARY_DIR}/python"
)
## Test basic SBML support.
#ADD_TEST(NAME pymoose-test-basic-sbml-support
#COMMAND ${TEST_COMMAND}
#${PROJECT_SOURCE_DIR}/tests/python/test_sbml_support.py
#)
#set_tests_properties(pymoose-test-basic-sbml-support
#PROPERTIES ENVIRONMENT "PYTHONPATH=${PROJECT_BINARY_DIR}/python"
#)

# Test basic SBML support.
ADD_TEST(NAME pymoose-test-rng
Expand Down
2 changes: 1 addition & 1 deletion moose-core/basecode/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ default: $(TARGET)

$(OBJ) : $(HEADERS) ../shell/Shell.h
Element.o: FuncOrder.h
testAsync.o: SparseMatrix.h SetGet.h ../scheduling/Clock.h ../biophysics/IntFire.h ../synapse/SynHandlerBase.h ../synapse/SimpleSynHandler.h ../synapse/Synapse.h ../randnum/RNG.h
testAsync.o: SparseMatrix.h SetGet.h ../scheduling/Clock.h ../biophysics/IntFire.h ../synapse/SynEvent.h ../synapse/SynHandlerBase.h ../synapse/SimpleSynHandler.h ../synapse/Synapse.h ../randnum/RNG.h
SparseMsg.o: SparseMatrix.h
SetGet.o: SetGet.h ../shell/Neutral.h
HopFunc.o: HopFunc.h ../mpi/PostMaster.h
Expand Down
2 changes: 2 additions & 0 deletions moose-core/basecode/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ extern void testShell();
extern void testScheduling();
extern void testSchedulingProcess();
extern void testBuiltins();
extern void testSynapse();
extern void testBuiltinsProcess();

extern void testMpiScheduling();
Expand Down Expand Up @@ -342,6 +343,7 @@ void nonMpiTests( Shell* s )
MOOSE_TEST("testHsolve", testHSolve());
//MOOSE_TEST("testGeom", testGeom());
MOOSE_TEST("testMesh", testMesh());
MOOSE_TEST("testSynapse", testSynapse());
MOOSE_TEST( "testSigneur", testSigNeur());
#ifdef USE_SMOLDYN
//MOOSE_TEST(testSmoldyn());
Expand Down
1 change: 1 addition & 0 deletions moose-core/basecode/testAsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <queue>
#include "../biophysics/IntFire.h"
#include "../synapse/Synapse.h"
#include "../synapse/SynEvent.h"
#include "../synapse/SynHandlerBase.h"
#include "../synapse/SimpleSynHandler.h"
#include "SparseMatrix.h"
Expand Down
9 changes: 9 additions & 0 deletions moose-core/biophysics/Leakage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,23 @@ Leakage::~Leakage()

void Leakage::vProcess( const Eref & e, ProcPtr p )
{
ChanCommon::vSetGk( e, this->vGetGbar( e ) * this->vGetModulation( e ));
updateIk();
sendProcessMsgs(e, p);
}

void Leakage::vReinit( const Eref & e, ProcPtr p )
{
ChanCommon::vSetGk( e, this->vGetGbar( e ) * this->vGetModulation( e ));
updateIk();
sendReinitMsgs(e, p);
}

void Leakage::vSetGbar( const Eref& e, double gbar )
{
ChanCommon::vSetGk( e, gbar * this->vGetModulation( e ) );
ChanCommon::vSetGbar( e, gbar );
}

//
// Leakage.cpp ends here
1 change: 1 addition & 0 deletions moose-core/biophysics/Leakage.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class Leakage: public ChanCommon
~Leakage();
void vProcess( const Eref & e, ProcPtr p );
void vReinit( const Eref & e, ProcPtr p );
void vSetGbar( const Eref & e, double gbar );

static const Cinfo * initCinfo();
};
Expand Down
2 changes: 1 addition & 1 deletion moose-core/biophysics/ReadCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ bool ReadCell::addSpikeGen(
shell_->doAddMsg(
"Single",
compt,
"VmSrc",
"VmOut",
chan,
"Vm"
);
Expand Down
6 changes: 6 additions & 0 deletions moose-core/biophysics/SynChan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,16 @@ void SynChan::normalizeGbar()
/// Update alpha function terms for synaptic channel.
double SynChan::calcGk()
{
/*
X_ = getModulation() * activation_ * xconst1_ + X_ * xconst2_;
Y_ = X_ * yconst1_ + Y_ * yconst2_;
activation_ = 0.0;
return Y_ * norm_;
*/
X_ = activation_ * xconst1_ + X_ * xconst2_;
Y_ = X_ * yconst1_ + Y_ * yconst2_;
activation_ = 0.0;
return Y_ * norm_ * getModulation();
}

void SynChan::vProcess( const Eref& e, ProcPtr info )
Expand Down
1 change: 1 addition & 0 deletions moose-core/external/muparser/include/muParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ namespace mu
static value_type Rint(value_type);
static value_type Sign(value_type);
static value_type Fmod(value_type, value_type);
static value_type Quot(value_type, value_type);

// Random between a and b, with fixed seed.
static value_type Rand2(value_type, value_type, value_type);
Expand Down
2 changes: 2 additions & 0 deletions moose-core/external/muparser/src/muParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ namespace mu
value_type Parser::Exp(value_type v) { return MathImpl<value_type>::Exp(v); }
value_type Parser::Abs(value_type v) { return MathImpl<value_type>::Abs(v); }
value_type Parser::Fmod(value_type v1, value_type v2) { return fmod(v1, v2); }
value_type Parser::Quot(value_type v1, value_type v2) { return (int)(v1 / v2); }

// If no seed is given,
value_type Parser::Rand( value_type seed )
Expand Down Expand Up @@ -336,6 +337,7 @@ namespace mu
DefineFun(_T("avg"), Avg);
DefineFun(_T("min"), Min);
DefineFun(_T("max"), Max);
DefineFun(_T("quot"), Quot);
}
}

Expand Down
6 changes: 4 additions & 2 deletions moose-core/external/muparser/src/muParserTokenReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,10 @@ namespace mu
#else
ParserTokenReader* ptr = new ParserTokenReader(*this);
ptr->SetParent( a_pParent );
delete ptr;
return NULL;
return ptr;
// Upi Bhalla 13 June 2016: I think the original two lines below are wrong
// delete ptr;
// return NULL;
#endif

}
Expand Down
Loading

0 comments on commit e5ac4a0

Please sign in to comment.