-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md~
106 lines (84 loc) · 2.43 KB
/
README.md~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
### Version
ruby 3.1.2p20 (2022-04-12 revision 4ab20c2967) + refgraph
### How to build this Ruby.
- on Ubuntu 22.04
```
$ apt install autoconf bison ruby libreadline-dev libffi-dev libssl-dev
$ apt install clang
$ git clone [email protected]:csg-tokyo/ruby-refgraph.git
$ autoconf
$ autoreconf --install # or 'automake -a -c'?
$ mkdir build
$ cd build
$ CC=clang ../configure --prefix /usr/local/lib/rbenv/versions/3.1.2-refgraph --disable-install-doc
$ make -j install
$ cd ..
$ rbenv shell 3.1.2-refgraph
$ rbenv version # 3.1.2-refgraph
```
Run `autoreconf` only when ../configure fails.
We observed that the behavior of Ruby-refgraph is weird when it is built
with GCC 11. Use Clang 14.
- on Ubuntu 20.04
```
$ apt install autoconf bison ruby libreadline-dev libffi-dev libssl-dev
$ git clone [email protected]:csg-tokyo/ruby-refgraph.git
$ autoconf
$ mkdir build
$ cd build
$ ../configure --prefix $HOME/.rbenv/versions/3.1.2-refgraph --disable-install-doc
$ make -j install
$ cd ..
$ rbenv shell 3.1.2-refgraph
$ rbenv version # 3.1.2-refgraph
```
- on macOS
```
$ brew install openssl
$ git clone [email protected]:csg-tokyo/ruby-refgraph.git
$ ./autogen.sh
$ autoconf
$ ./configure --with-openssl-dir=$(brew --prefix [email protected]) --prefix $HOME/.rbenv/versions/3.1.2-refgraph --disable-install-doc
$ make -j install
$ rbenv shell 3.1.2-refgraph
$ rbenv version # 3.1.2-refgraph
```
You might want to specify the openssl directory
as `--with-openssl-dir=$(brew --prefix openssl)` or
as `--with-openssl-dir=/opt/homebrew/opt/[email protected]` when
multiple versions of openssl are installed.
### How to use Refgraph
After building and installing Ruby with refgraph extension,
install `jscall`. We below assume that the execution environment
of Ruby is managed by `rbenv`.
```
$ cd
$ rbenv shell 3.1.2-refgraph
$ cd ./refgraph
$ bin/setup # or install jscall by gem install jscall
$ bundle exec rake build
$ gem install pkg/refgraph-0.1.0.gem
```
`bundle exec rake install` does not work for some unknown reason.
Now you can use Ruby-Refgraph at any directory after executing
this command:
```
$ rbenv shell 3.1.2-refgraph
```
To test `refgraph` without installing it, run as follows.
```
$ cd refgraph
$ irb -I ./lib # REPL starts
```
### How to make a new gem
```
$ cd
$ rbenv shell 3.1.2-refgraph
$ bundle gem refgraph --ext
$ cd refgraph
$ vi refgraph.gemspec # fill out TODO
$ bin/setup
$ bundle exec rake
$ irb -I lib
irb> require "refgraph"
```