gamma icon indicating copy to clipboard operation
gamma copied to clipboard

Theta download/install script

Open hajduakos opened this issue 5 years ago • 11 comments

Installing Theta is now quite easy, we just have to download a few jar/dll/so files and set up an environment variable. I think for this we should create a script (or two: one for Linux and one for Windows). @grbeni if you like the idea, I can work on this.

hajduakos avatar Sep 10 '20 09:09 hajduakos

Sounds good, I think it is a great idea. If you need any help, let me know.

grbeni avatar Sep 10 '20 09:09 grbeni

#16 takes a step towards this direction by automatically downloading Theta. The next step will be to set the PATH / env. variable.

hajduakos avatar Sep 10 '20 10:09 hajduakos

I think setting up the PATH and the environment variables could be done in separate scripts, because that only needs to be done once, but every time there is a new release, it has to be downloaded again (without modifying the PATH / env. vars).

hajduakos avatar Sep 10 '20 10:09 hajduakos

I think setting up the PATH and the environment variables could be done in separate scripts, because that only needs to be done once, but every time there is a new release, it has to be downloaded again (without modifying the PATH / env. vars).

I agree.

grbeni avatar Sep 10 '20 10:09 grbeni

@hajduakos The get-theta1.sh script might miss the libgomp.so lib. On an Ubuntu distribution the previously mentioned lib had to be installed by apt-get install libgomp1, otherwise the z3java.so was missing it.

Besides, on Linux, it might not be enough to put the *.so files on the PATH. Theta was complaining that it did not find the *.so files, so they had to be copied into one of the following folders: /usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib

If it is a general problem, then could we extend the corresponding README.md with the aforementioned hints?

benedekh avatar Sep 15 '20 14:09 benedekh

@benedekh thanks for the feedback. The libgom.so is absolutely right, I will include that in the installer script.

Regarding the path, what I usually do is that before executing Theta (with java -jar theta-....jar <ARGUMENTS>), I also execute export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./", where ./ is the directory where both Theta and the so files are stored. This works for a single session in the terminal. I am not sure how this would work out when calling Theta from Gamma. I will take a look how it is done in Gazer.

hajduakos avatar Sep 19 '20 06:09 hajduakos

@hajduakos I add Theta to the Dockerimage the following way:

ENV PATH="/tools/theta:${PATH}"
ENV THETA_XSTS_CLI_PATH="/tools/theta/theta-xsts-cli.jar"
.....
WORKDIR /tools/theta
RUN wget https://github.com/ftsrg/gamma/raw/master/plugins/xsts/theta-bin/get-theta.sh -O ./get-theta.sh
RUN chmod +x ./get-theta.sh
RUN ./get-theta.sh

and the workaround commands after that:

RUN cp ./*.so /usr/lib/

Can you spot the place, where I made a mistake, such that the workaround command would not be necessary anymore?

benedekh avatar Sep 21 '20 18:09 benedekh

@benedekh can you try adding ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/tools/theta" (I think it can replace ENV PATH="/tools/theta:${PATH}", but you can also try having both after each other).

hajduakos avatar Sep 23 '20 23:09 hajduakos

@hajduakos theta seems to be working find with the new environmental variable.

benedekh avatar Oct 05 '20 15:10 benedekh

The scripts have been working well for everybody that I have had contact with. Is there any specific reason to keep this issue open?

grbeni avatar Apr 27 '21 16:04 grbeni

As far as I remember, the script only downloads Theta, but does not add it to the path. Based on the discussion above, we can do that in a separate script (download multiple times, but set path only once). So I think we can close this issue and maybe open a new one if there is a demand for setting the path with a script.

hajduakos avatar Apr 27 '21 17:04 hajduakos