Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CC = g++
CC = gcc
C++ = g++
CFLAGS = -c -std=c++14 -Wall -O3
SIMFLAGS = -l. -std=c++14 -Wall -O3
LFLAGS = -pthread -lm
Expand All @@ -22,14 +23,14 @@ CORE: $(OBJ)
# make -d -f $(ROOTINC_ESC)/external/ANN/src/Makefile.spatialpy ROOTINC=$(ROOTINC_ESC)

main.o:
$(CC) -c $(GPROFFLAG) $(GDB_FLAG) -o main.o $(MODEL) $(INCDIRPARAMS) $(CFLAGS)
$(C++) -c $(GPROFFLAG) $(GDB_FLAG) -o main.o $(MODEL) $(INCDIRPARAMS) $(CFLAGS)

%.o: $(ROOT)/src/%.cpp
$(CC) -c $(GPROFFLAG) $(GDB_FLAG) -o $@ "$<" $(INCDIRPARAMS) $(CFLAGS)
$(C++) -c $(GPROFFLAG) $(GDB_FLAG) -o $@ "$<" $(INCDIRPARAMS) $(CFLAGS)

%.o: $(ROOT)/src/%.c
$(CC) -c $(GPROFFLAG) $(GDB_FLAG) -o $@ "$<" $(INCDIRPARAMS) $(CFLAGS)

ssa_sdpd: main.o
$(CC) $(GPROFFLAG) $(GDB_FLAG) -o ssa_sdpd $(addprefix $(COREDIR)/,$(OBJ)) main.o $(addprefix $(COREDIR)/,$(ANNOBJECTS)) $(LFLAGS)
$(C++) $(GPROFFLAG) $(GDB_FLAG) -o ssa_sdpd $(addprefix $(COREDIR)/,$(OBJ)) main.o $(addprefix $(COREDIR)/,$(ANNOBJECTS)) $(LFLAGS)

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ See the file LICENSE.txt for details.

#include "particle_system.hpp"

void read_lammps_input_file(const char*filename, ParticleSystem*system);
void read_lammps_input_file(const char*filename, Spatialpy::ParticleSystem*system);

#endif //read_lammps_input_file_h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <time.h>
#include <unistd.h>

#include "count_cores.h"
#include "count_cores.hpp"
#include "particle_system.hpp"
#include "propensities.hpp"
#include "simulate.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ See the file LICENSE.txt for details.
#include <stdlib.h>
#include <string.h>

#include "output.h"
#include "output.hpp"
#include "particle_system.hpp"

namespace Spatialpy{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#include <errno.h>

#include "pthread_barrier.h"
#include "pthread_barrier.hpp"

#ifdef __APPLE__

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ See the file LICENSE.txt for details.
#include <stdio.h>
#include <stdlib.h>

#include "read_lammps_input_file.h"
#include "read_lammps_input_file.hpp"


void read_lammps_input_file(const char*filename, ParticleSystem*system){
void read_lammps_input_file(const char*filename, Spatialpy::ParticleSystem*system){
char* s;
FILE* fp = fopen(filename, "r");
if(fp == NULL){
Expand Down Expand Up @@ -73,7 +73,7 @@ void read_lammps_input_file(const char*filename, ParticleSystem*system){
s=fgets(buffer,1024,fp);
//printf("Is this 'Masses': '%s'\n",buffer);
s=fgets(buffer,1024,fp);
double *masses_of_types = malloc(sizeof(double)*ntypes);
double *masses_of_types = (double*) std::malloc(sizeof(double)*ntypes);
int i,j;
double tmp_d;
for(i=0;i<ntypes;i++){
Expand All @@ -89,7 +89,7 @@ void read_lammps_input_file(const char*filename, ParticleSystem*system){
s=fgets(buffer,1024,fp);
int id,type,is_solid;
double rho,x,y,z;
Particle*me;
Spatialpy::Particle*me;
for(i=0;i<natoms;i++){
s=fgets(buffer,1024,fp);
r = sscanf(buffer, "%d 0 %d %lf %lf %lf %lf %d",&id,&type,&rho,&x,&y,&z,&is_solid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdlib.h>
#include <unistd.h>

#include "model.h"
#include "output.h"
#include "model.hpp"
#include "output.hpp"
#include "particle_system.hpp"
#include "pthread_barrier.h"
#include "pthread_barrier.hpp"
#include "simulate.hpp"
#include "simulate_rdme.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <string.h>

//#include "binheap.h"
#include "output.h"
#include "output.hpp"
#include "particle_system.hpp"
#include "propensities.hpp"
#include "simulate_rdme.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ See the file LICENSE.txt for details.

// Include ANN KD Tree
#include "ANN/ANN.h"
#include "model.h"
#include "output.h"
#include "model.hpp"
#include "output.hpp"
#include "particle_system.hpp"
#include "simulate.hpp"
#include "simulate_rdme.hpp"
#include "pthread_barrier.h"
#include "pthread_barrier.hpp"

namespace Spatialpy{
struct arg {
Expand Down
2 changes: 1 addition & 1 deletion spatialpy/solvers/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def compile(self, debug=False, profile=False):
# Match except word characters \w = ([a-zA-Z0-9_]) and \_ = _ replace with ''
propfilename = re.sub(r'[^\w\_]', '', self.model_name)
self.propfilename = f"{propfilename}_generated_model"
self.prop_file_name = os.path.join(self.build_dir, f'{self.propfilename}.c')
self.prop_file_name = os.path.join(self.build_dir, f'{self.propfilename}.cpp')

if self.debug_level >= 1:
print(f"Compiling Solver. Build dir: {self.build_dir}")
Expand Down