Theta download/install script
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.
Sounds good, I think it is a great idea. If you need any help, let me know.
#16 takes a step towards this direction by automatically downloading Theta. The next step will be to set the PATH / env. variable.
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 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.
@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 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 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 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 theta seems to be working find with the new environmental variable.
The scripts have been working well for everybody that I have had contact with. Is there any specific reason to keep this issue open?
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.