Skip to content

Commit b63dfc0

Browse files
committed
Could use a helping hand in figuring out stacktrace. Instructions: 'make csharp ; cd topologicsharp ; cp tests/test.cs . ; mcs /reference:./topologicsharp.dll test.cs ; ./test.exe
1 parent b485997 commit b63dfc0

File tree

5 files changed

+65
-7
lines changed

5 files changed

+65
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,6 @@ rustopologic/RustTopologic/rustTests/bindings.rs
4747
topologicsharp/*.cs
4848
topologicsharp/*.c
4949
topologicsharp/_topologicsharp.so
50+
*.dll
5051

5152

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
CC=gcc
55
CXX=g++
6+
MCS=$(MCS)
67

78
LDFLAGS= -lm -lpthread -L. -ltopologic -pthread -lfl
89
CFLAGS=-Wall -Werror -g -fPIC #-O2
@@ -73,9 +74,10 @@ python2: $(OBJ) $(INCLUDES)
7374
$(CC) -shared topylogic/topylogic_wrap.o $(OBJ) -o $(TOPYLOGIC_SO)
7475

7576
csharp: $(OBJ) $(INCLUDES)
76-
swig -csharp $(CSHARP_I)
77-
$(CC) -c -fPIC $(CSHARP_WRAP) -o topologicsharp/topologicsharp.o #-I/usr/bin/csharp
78-
#$(CC) -shared topologicsharp/topologicsharp.o $(OBJ) -o $(CSHARP_O)
77+
swig -outfile topologicsharp.cs -csharp $(CSHARP_I)
78+
$(CC) -c -fPIC $(CSHARP_WRAP) -o topologicsharp/topologicsharp.o
79+
@bash topologicsharp/make_dll.sh
80+
7981

8082
cpp: $(BISON_CPP) $(BISON_OBJ_PP) $(BISON_HPP) $(FLEX_CPP) $(FLEX_OBJ_PP) $(OBJ) $(INCLUDES)
8183
$(AR) rcs libtopologic.a $(OBJ) $(BISON_OBJ_PP) $(FLEX_OBJ_PP)
@@ -92,7 +94,7 @@ $(BISON_CPP): $(BISONPP)
9294
$(CXX) -fPIC -g -c $(BISON_CPP) -o $(BISON_OBJ_PP)
9395

9496
all:$(BIN)
95-
.PHONY : clean cpp python pyton2
97+
.PHONY : clean cpp python python2 rust csharp
9698

9799
clean:
98100
rm -f libtopologic.a
@@ -108,6 +110,7 @@ clean:
108110
rm -rf topylogic/build
109111
-rm -f state_*
110112
-rm -f topylogic/state_*
113+
rm -f topologicsharp/*.dll
111114
rm -f $(TESTS) $(TEST_OBJ)
112115
-rm -f testing/*.exe
113116
rm -f rustopologic/RustTopologic/src/bindings.rs

topologicsharp/make_dll.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
echo "Creating dll's..."
4+
sleep 1
5+
cd topologicsharp
6+
set -x
7+
8+
#mcs SWIGTYPE_p_void.cs -target:library -out:SWIGTYPE_p_void.dll
9+
#mcs AVLNode.cs -target:library -out:AVLNode.dll
10+
#mcs stack.cs -target:library -out:stack.dll
11+
#mcs AVLTree.cs -target:library -out:AVLTree.dll
12+
#mcs MEM_OPTION.cs -target:library -out:MEM_OPTION.dll
13+
#mcs SNAPSHOT.cs -target:library -out:SNAPSHOT.dll
14+
#mcs STATES.cs -target:library -out:STATES.dll
15+
#mcs SWIGTYPE_CONTEXT.cs -target:library -out:SWIGTYPE_CONTEXT.dll
16+
#mcs SWIGTYPE_REQUESTS.cs -target:library -out:SWIGTYPE_REQUESTS.dll
17+
#mcs SWIGTYPE_p_f_p_struct_graph_p_struct_vertex_result_p_void_p_void__void.cs -target:library -out:SWIGTYPE_p_f_p_struct_graph_p_struct_vertex_result_p_void_p_void__void.dll
18+
#mcs SWIGTYPE_p_f_p_void__void.cs -target:library -out:SWIGTYPE_p_f_p_void__void.dll
19+
#mcs SWIGTYPE_p_f_p_void_p_void_q_const__p_q_const__void__int.cs -target:library -out:SWIGTYPE_p_f_p_void_p_void_q_const__p_q_const__void__int.dll
20+
#mcs SWIGTYPE_p_int.cs -target:library -out:SWIGTYPE_p_int.dll
21+
#mcs SWIGTYPE_p_p_edge.cs -target:library -out:SWIGTYPE_p_p_edge.dll
22+
#mcs SWIGTYPE_p_p_vertex_result.cs -target:library -out:SWIGTYPE_p_p_vertex_result.dll
23+
#mcs SWIGTYPE_p_p_void.cs -target:library -out:SWIGTYPE_p_p_void.dll
24+
#mcs SWIGTYPE_p_phread_cond_t.cs -target:library -out:SWIGTYPE_p_phread_cond_t.dll
25+
#mcs SWIGTYPE_p_phread_mutex_t.cs -target:library -out:SWIGTYPE_p_phread_mutex_t.dll
26+
#mcs SWIGTYPE_p_request.cs -target:library -out:SWIGTYPE_p_request.dll
27+
#mcs SWIGTYPE_p_sig_atomic_t.cs -target:library -out:SWIGTYPE_p_sig_atomic_t.dll
28+
#mcs SWIGTYPE_p_void.cs -target:library -out:SWIGTYPE_p_void.dll
29+
#mcs VERBOSITY.cs -target:library -out:VERBOSITY.dll
30+
#mcs vertex.cs -target:library -out:vertex.dll
31+
#mcs graph.cs -target:library -out:graph.dll
32+
33+
34+
35+
36+
37+
for i in * :
38+
do
39+
if [[ "$i" == *.cs ]]
40+
then
41+
echo "filename: $i"
42+
j=$(echo $i | sed 's/\.cs//g')
43+
#echo $j
44+
mcs $i -target:library -out:$j.dll
45+
fi
46+
done
47+

topologicsharp/tests/test.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
using topologicsharp;
21
using System;
32
using System.IO;
43

54

5+
using static topologicsharp;
6+
using static graph;
7+
using static SNAPSHOT;
8+
using static MEM_OPTION;
9+
using static VERBOSITY;
10+
using static STATES;
11+
using static CONTEXT;
612
public class Test{
7-
public static void main(String[] args){
8-
graph g = graph();
13+
public static void Main(String[] args){
14+
graph g = new graph(-1, (uint)START_STOP, 100, EDGES | FUNCTIONS, SWITCH, CONTINUE);
915
Console.WriteLine("SUCCESS");
1016

1117

topologicsharp/topologicsharp.i

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
%include "../include/graph.h"
6565
%include "../include/vertex.h"
6666
%include "../include/edge.h"
67+
%include "../include/context.h"
6768
%extend graph {
6869
graph(int max_state_changes = -1,
6970
unsigned int snapshot_timestamp = START_STOP,

0 commit comments

Comments
 (0)