V8-based JavaScript interpreter for online judging.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
debian Add script to automatically build. Apr 22, 2018
.gitignore Add script to automatically build. Apr 22, 2018
GNUmakefile
LICENSE Update LICENSE Dec 23, 2017
Makefile
README.md
binio.cc
ci-build Correctly handle current directory when building new v8 version Dec 10, 2018
input.cc
output.cc Support v8 7.1.x. Dec 11, 2018
runtime.cc Do not use Windows line endings. Sep 30, 2017
v8dmoj.cc Support v8 7.x. Nov 3, 2018
v8dmoj.h

README.md

v8dmoj Build Status

V8-based JavaScript interpreter for online judging

Prebuilt Packages

The DMOJ offers prebuilt packages for Debian-based amd64 systems, although the binaries are statically linked.

We offer this as a Debian repository. First, choose the line suited to your distro. (For non-Debian distros, select the closest Debian release):

deb [arch=amd64] https://apt.dmoj.ca/ jessie main non-free
deb [arch=amd64] https://apt.dmoj.ca/ stretch main non-free
deb [arch=amd64] https://apt.dmoj.ca/ buster main non-free

Then run:

curl https://dmoj.ca/dmoj-apt.key | sudo apt-key add -
sudo apt update
sudo apt install v8dmoj

Building on Linux

You must have git, clang, and GNU make installed.

  1. git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  2. export PATH=$PATH:$(pwd)/depot_tools
  3. gclient
  4. fetch v8
  5. cd v8
  6. Find the Chrome stable v8 version on https://omahaproxy.appspot.com/.
  7. git checkout <the version from step 6>.
  8. gclient sync
  9. tools/dev/v8gen.py x64.release
  10. Run gn args out.gn/x64.release and add:
    is_component_build = false
    v8_static_library = true
    use_sysroot = false
    treat_warnings_as_errors = false
    icu_use_data_file = false
    v8_use_external_startup_data = false
    
  11. ninja -C out.gn/x64.release
  12. mkdir <path to v8dmoj>/v8lib
  13. find out.gn/x64.release/obj/ -name '*.a' | while read -r file; do ar t "$file" | xargs ar rs "<path to v8dmoj>/v8lib/$(basename "$file")"; done
  14. cp out.gn/x64.release/obj/third_party/icu/icudata/icudtl_dat.o ~/v8dmoj/v8lib/
  15. cp -R include <path to v8dmoj>/v8inc
  16. cd <path to v8dmoj>
  17. make

Building on Windows

  1. Download depot tools and unpack into a directory called depot_tools.
  2. Open a command prompt window and cd into the parent directory of depot_tools, and run:
    set PATH=%cd%\depot_tools;%PATH%
    set DEPOT_TOOLS_WIN_TOOLCHAIN=0
    set GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0
    set WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10
    
    You may need to adapt the version of Visual Studio and the Windows SDK.
  3. gclient
  4. fetch v8
  5. cd v8
  6. Find the Chrome stable v8 version on https://omahaproxy.appspot.com/.
  7. git checkout <the version from step 6>.
  8. gclient sync
  9. tools/dev/v8gen.py x64.release
  10. Run gn args out.gn/x64.release and add:
    is_component_build = false
    v8_static_library = true
    treat_warnings_as_errors = false
    icu_use_data_file = false
    v8_use_external_startup_data = false
    
  11. ninja -C out.gn/x64.release
  12. mkdir [path to v8dmoj]\v8lib
  13. for /R out.gn\x64.release\obj %f in (*.lib) do @copy /y %f [path to v8dmoj]\v8lib\ > nul
  14. xcopy /s /y include C:\Users\Quantum\code\DMOJ\v8dmoj\v8inc\
  15. cd [path to v8dmoj]
  16. nmake