Git Product home page Git Product logo

Comments (4)

iliastsa avatar iliastsa commented on June 7, 2024

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:

  1. Build the Docker image: docker build -t gigahorse .
  2. Set an alias alias gigahorse=GIGAHORSE_ROOT_ABS_PATH/bin/run_docker
  3. Invoke gigahorse ARGS, for example gigahorse 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.

Divide-By-0 avatar Divide-By-0 commented on June 7, 2024

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.

iliastsa avatar iliastsa commented on June 7, 2024

We merged PR #35 that should work on M1 Mac - maybe it fixes your issue.

from gigahorse-toolchain.

Divide-By-0 avatar Divide-By-0 commented on June 7, 2024

Oh I'm on Intel Mac but I'll give it a shot.

from gigahorse-toolchain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.