Skip to content

Commit

Permalink
kitty example for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
twj8CDC committed Jun 16, 2023
1 parent b15b265 commit 75e4cda
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 9 deletions.
15 changes: 15 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/local/include"
],
"defines": [],
"compilerPath": "/usr/bin/g++",
"configurationProvider": "ms-vscode.makefile-tools"
}
],
"version": 4
}
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": []
}
20 changes: 11 additions & 9 deletions BART/BART/BART/inst/cxx-ex_jt/test_kitty/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
FLAGS = -fPIC
LIBFLAGS = -L /usr/local/lib/
# the python interface through swig
PYTHONI = -I/Users/jacobtiegs/opt/anaconda3/include/python3.8
PYTHONL = -Xlinker -export-dynamic



# default super-target
all:
kitty_py:
g++ -fPIC -c kitty.cpp -o kitty.o
# g++ -fPIC -c main.cpp -o main.o
swig -c++ -python -o kitty_wrap.cxx kitty.i
g++ $(FLAGS) `python3-config --cflags` -c kitty_wrap.cxx -o kitty_wrap.o
g++ -bundle `python3-config --ldflags` kitty.o kitty_wrap.o -o _kitty.so
swig -c++ -python -o kitty_wrap.cpp kitty.i
g++ -fPIC `python3-config --cflags` -c kitty_wrap.cpp -o kitty_wrap.o
g++ -shared `python3-config --ldflags` kitty.o kitty_wrap.o -o _kitty.so

kitty:
g++ -fPIC -c kitty.cpp -o kitty.o
g++ -fPIC -c main.cpp -o main.o
g++ -shared kitty.o main.o -o main.so
g++ -Wall -o main.out kitty.o main.o

hello:
g++ -Wall -o hello.out hello.cpp
./hello.out

clean:
rm -f *.o kitty.py *.so kitty_wrap.cxx
rm -f *.o kitty.py *.so kitty_wrap.cpp *.out
Binary file not shown.
Binary file modified BART/BART/BART/inst/cxx-ex_jt/test_kitty/_kitty.so
Binary file not shown.
5 changes: 5 additions & 0 deletions BART/BART/BART/inst/cxx-ex_jt/test_kitty/hello.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <stdio.h>

int main(void) {
printf("HELLOW\n");
}
Binary file modified BART/BART/BART/inst/cxx-ex_jt/test_kitty/kitty.o
Binary file not shown.
Binary file modified BART/BART/BART/inst/cxx-ex_jt/test_kitty/kitty_wrap.o
Binary file not shown.

0 comments on commit 75e4cda

Please sign in to comment.