Comments (4)
Unfortunately, our Mac support is really iffy - we are working on improving gigahorse on this front, as it has become a more common problem lately.
In order to help add some support, I revamped the Dockerfile. You could try do the following:
- Build the Docker image:
docker build -t gigahorse .
- Set an alias
alias gigahorse=GIGAHORSE_ROOT_ABS_PATH/bin/run_docker
- Invoke
gigahorse ARGS
, for examplegigahorse examples/long_running.hex -i
It should work, but please let me know if you encounter any issues. Please note that this is experimental and that the home directory is mounted in the container as it's quite likely that people will want to run some client analyses via gigahorse <HEX> -C <client list>
.
You need to be able to run docker without sudo for this to work. See https://docs.docker.com/engine/install/linux-postinstall/ for adding your self into the "docker" group to enable this, or https://docs.docker.com/engine/security/rootless/ to run docker in rootless mode.
from gigahorse-toolchain.
Awesome, thanks for the quick action here! I think by default I can do those commands without root. However, I had to edit bin/run_docker to have /bin/bash instead, and then I also need to edit -fm
to be -fn
, then mkdir cache in addition to the existing .temp. Then, I get this error, which is basically the same thing I was getting before on Mac:
$ gigahorse examples/long_running.hex
/Users/<username>/Documents/MIT/frontrunner/gigahorse-toolchain
Compiling /opt/gigahorse/gigahorse-toolchain/logic/main.dl to C++ program and executable
Compiling /opt/gigahorse/gigahorse-toolchain/clientlib/function_inliner.dl to C++ program and executable
compiler error: cannot compile source file /opt/gigahorse/gigahorse-toolchain/cache/da6752883df29068047e272158d1b6c0.cpp
g++ -std=c++17 -fwrapv -DUSE_NCURSES -O3 -DUSE_LIBZ -DUSE_SQLITE -fopenmp -march=native -std=c++17 -Wdate-time -D_FORTIFY_SOURCE=2 -o/opt/gigahorse/gigahorse-toolchain/cache/da6752883df29068047e272158d1b6c0 /opt/gigahorse/gigahorse-toolchain/cache/da6752883df29068047e272158d1b6c0.cpp -ldl -lpthread -lsqlite3 -lz -lncurses -lfunctors -I/usr/bin/../include -I/usr/bin/include
/opt/gigahorse/gigahorse-toolchain/souffle-addon/libfunctors.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
failed to compile C++ source </opt/gigahorse/gigahorse-toolchain/cache/da6752883df29068047e272158d1b6c0.cpp>
Process Process-2:
Traceback (most recent call last):
File "/usr/lib/python3.8/multiprocessing/process.py", line 313, in _bootstrap
self.run()
File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/opt/gigahorse/gigahorse-toolchain/gigahorse.py", line 295, in compile_datalog
assert not(process.returncode), "Compilation failed. Stopping."
AssertionError: Compilation failed. Stopping.
compiler error: cannot compile source file /opt/gigahorse/gigahorse-toolchain/cache/de899845b46df8f5f8a1150ce9d945e6.cpp
g++ -std=c++17 -fwrapv -DUSE_NCURSES -O3 -DUSE_LIBZ -DUSE_SQLITE -fopenmp -march=native -std=c++17 -Wdate-time -D_FORTIFY_SOURCE=2 -o/opt/gigahorse/gigahorse-toolchain/cache/de899845b46df8f5f8a1150ce9d945e6 /opt/gigahorse/gigahorse-toolchain/cache/de899845b46df8f5f8a1150ce9d945e6.cpp -ldl -lpthread -lsqlite3 -lz -lncurses -lfunctors -I/usr/bin/../include -I/usr/bin/include
/opt/gigahorse/gigahorse-toolchain/souffle-addon/libfunctors.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
failed to compile C++ source </opt/gigahorse/gigahorse-toolchain/cache/de899845b46df8f5f8a1150ce9d945e6.cpp>
Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python3.8/multiprocessing/process.py", line 313, in _bootstrap
self.run()
File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/opt/gigahorse/gigahorse-toolchain/gigahorse.py", line 295, in compile_datalog
assert not(process.returncode), "Compilation failed. Stopping."
AssertionError: Compilation failed. Stopping.
Traceback (most recent call last):
File "/opt/gigahorse/gigahorse-toolchain/gigahorse.py", line 550, in <module>
open(v, 'r') # check program exists
FileNotFoundError: [Errno 2] No such file or directory: '/opt/gigahorse/gigahorse-toolchain/logic/main.dl_compiled'
from gigahorse-toolchain.
We merged PR #35 that should work on M1 Mac - maybe it fixes your issue.
from gigahorse-toolchain.
Oh I'm on Intel Mac but I'll give it a shot.
from gigahorse-toolchain.
Related Issues (20)
- Add CI event listener
- Encountered a problem when installing the Souffle custom functors HOT 2
- Need some constant folding in `GlobalAnalysis` HOT 3
- The fallback function is not separated.
- How does loops work? How does Gigahorse translate loops? HOT 2
- Possible missing events from output HOT 15
- Analytics returning 0 for all outputs HOT 2
- The compilation time is so long HOT 1
- Can detection rules be automatically generated? HOT 2
- Why is the compiled file incomplete? HOT 4
- A problem of "souffle-addon"? HOT 4
- 3-address code bug HOT 4
- Why does CALLCODE have no “value” field in Gigahorse? HOT 1
- The "freeze_support()" line can be omitted if the program HOT 3
- ReentrancyGuard deleted HOT 2
- When experimenting with example, the following error was reported HOT 1
- Improve public function inference when the function selector is smaller than 3 bytes
- The "FormalArgs" relation missing some of the facts. HOT 8
- why stop compilation HOT 1
- address HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gigahorse-toolchain.