Update/Add build for Ubuntu WSL2 - #233
Conversation
Setting up Ubunutu 24 on WSL2.
pralitp
left a comment
There was a problem hiding this comment.
Thanks Juan, I think this will be helpful for Windows users willing to use WSL.
Generally looks good. But I think we should think a bit about structure and formatting.
At present it is all in a big code block. Perhaps it could be make more sense to have the "comments" / details about what the commands are doing in plain markdown preceding the actual commands which can then be in code blocks. I think this would give us space to explain things a bit more for folks who may not be very technical but just need to get GCAM up and running in WSL.
On a similar thought, it might be good to re-organize this into sections. Which could help users who only want to do some of these in WSL and leave others in plain Windows. Maybe the following sections could work:
- Intro / general packages to install
- Packages and environment for compiling GCAM
- Packages for debugging GCAM (maybe make clear these are optional)
- Packages and commands for installing R and R packages required for running gcamdata
- Packages and commands for running the Model Interface GUI
| sudo apt install default-jdk -y | ||
| sudo apt install libboost-dev -y | ||
| sudo apt install libtbb-dev -y | ||
| sudo apt install r-cran-devtools -y |
There was a problem hiding this comment.
Note: needed to run gcamdata only.
| sudo apt install libboost-dev -y | ||
| sudo apt install libtbb-dev -y | ||
| sudo apt install r-cran-devtools -y | ||
| sudo apt install libxerces-c3.2 -y |
There was a problem hiding this comment.
Not required in recent versions of GCAM. I'd suggest just removing it.
|
|
||
| install.packages(c("drake", "assertthat")) <- Necessary R packages | ||
|
|
||
| readlink -f `which javac` | sed "s:/bin/javac::" <- Will give you the neccesary path for JAVA_HOME |
There was a problem hiding this comment.
I think the idea here is you can use this command to figure out what JAVA_HOME should be set to and then a user would manually use this information to set it on the next line?
If so perhaps we could just reccommend a programatic solution something like the following (haven't tested this at all):
export JAVA_HOME=$(readlink -f `which javac` | sed "s:/bin/javac::")
There was a problem hiding this comment.
Alright, this seems like a better alternative.
| readlink -f `which javac` | sed "s:/bin/javac::" <- Will give you the neccesary path for JAVA_HOME | ||
| export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java <- Replace with whatever path you obtained from the line above | ||
| cp ~/.bashrc ~/.bashrc.bak <- Creates a backup of your bashrc | ||
| echo "export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64" >> ~/.bashrc <- Sets the enviroment variable permanently through bashrc |
There was a problem hiding this comment.
It wasn't immediately clear: why was updating your .bashrc required here?
There was a problem hiding this comment.
When I was setting up GCAM, I noticed that JAVA_HOME did not exist for some odd reason on Ubuntu 24.04.1 LTS after installing Java. So here I'm creating the environment variable and saving it to .bashrc so the user won't have to repeat the process every new session.
| cd ${HOME}/gcam-core/output/modelinterface | ||
| ln -s ${HOME}/gcam-core/libs/jars <- Creates a symbolic link to the jars file. Necessary to utilize GUI | ||
|
|
||
| You can use these environment variables: |
There was a problem hiding this comment.
Note these are needed to compile gcam.exe
| export JARS_LIB="${HOME}/gcam-core/libs/jars/*" | ||
| export EIGEN_INCLUDE="${HOME}/gcam-core/libs/eigen-3.4.0" | ||
| ``` | ||
| Note: You may need to rename BaseX jar. Model interface expects version 9.5.2, if it's not already named BaseX-9.5.2.jar then make the change. |
There was a problem hiding this comment.
This shouldn't be required. Did you run into issues running GCAM (writing the XMLDB) or on running the Model Interface GUI side of things?
There was a problem hiding this comment.
Yep, I encountered a few issues, and this was my remedy.
No description provided.