Skip to main content

hustoj installs 16 question-answering languages

hustoj installs 16 question-answering languages

unbuntu22.04 installing hustoj and 16 judgment languages

hustoj installs 16 question marking languages [16 answer languages for A+B questions]

Installation steps
wget http://dl.hustoj.com/install-ubuntu22.04.sh
sudo bash install-ubuntu22.04.sh

Please make sure that the configuration has been released before installing the other judge languages.

  1. Modify /home/judge/src/web/include/db_info.inc.php, you need to change the value of $OJ_LANG_MASK, you need to use the calculation tool in the comment of the line provides a link
  2. Modify OJ_LANG_SET in /home/judge/etc/judge.conf, where the numbers correspond to the relationship of the language see
    /home/judge/src/web/include/const.inc.php, where the language_name array lists all the languages that the system can expand, and the subscript of the array element is the number that needs to be added to OJ_LANG_SET.
  3. change OJ_USE_DOCKER in /home/judge/etc/judge.conf to 0.
  4. Restart the judging machine
    # Restart the judging machine
sudo pkill -9 judged && sudo judged

hustoj supports these languages by default after the first installation;
c,c++,python,php,java17

1. JAVA: Since I need to deploy the project, I replaced 17 with jdk8; this is done as follows ``.

Uninstall the original jdk17

sudo apt-get remove openjdk-17-jdk

Install jdk8

sudo apt-get install openjdk-8-jdk

``

Just run java -version to see the version.
You need to reboot the server after installing the jdk for it to take effect.

    # reboot
reboot.

2. pascal

    sudo apt-get install fp-compiler-3.2.2

3. ruby **3.

    sudo apt-get install ruby-full

If there is a runtime error after ruby is installed, the following is the error
hustoj install 16 languages
Then you need to modify the source code to add some library information. `` vim /home/judge/src/core/judge_client/judge_client.cc

Search for copy_ruby_runtime and add new code.

execute_cmd("/bin/cp -a /usr/lib/x86_64-linux-gnu/ruby* %s/usr/lib/", work_dir)


![hustoj installs 16 judgment languages](162db95ef266f7e9cf3c3122a7d6473e.png)

**Save and then compile the project and restart the adjudicator**
``
# Compile the project
cd /home/judge/src/core
sudo bash make.sh
# Restart the Judge
sudo pkill -9 judged && sudo judged

4. C#

    sudo apt-get install mono-mcs -y

5. clang/clang++

    sudo apt-get install clang

6. Lua Lua sudo apt-get install lua5.3


**7\. nodejs**

sudo apt-get install nodejs


If there is any missing library information when you are judging a question, do the following;

vim /home/judge/src/core/judge_client/judge_client.cc

Search for copy_js_runtime #ifdef x86_64 need to add this code

execute_cmd("/bin/cp /usr/lib/x86_64-linux-gnu/libnode.so.* %s/lib/x86_64-linux-gnu/", work_dir); execute_cmd("/bin/cp /usr/lib/x86_64-linux-gnu/libbrotlidec.so.* %s/lib/x86_64-linux-gnu/", work_dir); execute_cmd("/bin/cp /usr/lib/x86_64-linux-gnu/libbrotlienc.so.* %s/lib/x86_64-linux-gnu/", work_dir); execute_cmd("/bin/cp /usr/lib/x86_64-linux-gnu/libnghttp2.so.* %s/lib/x86_64-linux-gnu/", work_dir); execute_cmd("/bin/cp /usr/lib/x86_64-linux-gnu/libbrotlicommon.so.* %s/lib/x86_64-linux-gnu/", work_dir);

Save and restart the adjudication machine

Compile the project

cd /home/judge/src/core sudo bash make.sh #Restart the judging machine sudo pkill -9 judged && sudo judged


![hustoj install 16 judging languages](2ea53ad9ed1b498ca045c5b732d029f1.png)

**8\. golang**
The go language needs to be installed before version 1.14, after 1.14 the introduction of semaphores, there will be problems when the program runs
[Download version before 1.14](https://studygolang.com/dl)
I download go1.13.linux-amd64.tar.gz

Download it and extract it

tar -zxvf go1.13.linux-amd64.tar.gz #Configure the programs that can be executed under /usr/bin ln -s /usr/lib/go-1.13/bin/go /usr/bin/go


**9\. Fortran**

sudo apt-get install gfortran


Just install it and proceed to adjudicate the problem:
If a system call error occurs

Runtime Error:[ERROR] A Not allowed system call: runid:10735 CALLID:20
[Solution](https://zhuanlan.zhihu.com/p/24498599)
For 64-bit systems; add the CALLID to /home/judge/src/core/judge_client/okcalls64.h under the corresponding language, and then recompile it.
and recompile.
``
#Compile the project
cd /home/judge/src/core
sudo bash make.sh