Skip to content

Update/Add build for Ubuntu WSL2 - #233

Open
juan1190 wants to merge 7 commits into
JGCRI:gh-pagesfrom
juan1190:patch-1
Open

Update/Add build for Ubuntu WSL2#233
juan1190 wants to merge 7 commits into
JGCRI:gh-pagesfrom
juan1190:patch-1

Conversation

@juan1190

Copy link
Copy Markdown

No description provided.

@juan1190 juan1190 changed the title Patch 1 Update/Add build for Ubuntu WSL2 Feb 27, 2026
@juan1190
juan1190 marked this pull request as draft February 27, 2026 16:30
@juan1190
juan1190 marked this pull request as ready for review February 27, 2026 16:32
@juan1190
juan1190 marked this pull request as draft February 27, 2026 16:34
@juan1190
juan1190 marked this pull request as ready for review February 27, 2026 16:36
@pralitp
pralitp self-requested a review July 20, 2026 13:57

@pralitp pralitp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread gcam-build.md
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: needed to run gcamdata only.

Comment thread gcam-build.md
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required in recent versions of GCAM. I'd suggest just removing it.

Comment thread gcam-build.md

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::")

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, this seems like a better alternative.

Comment thread gcam-build.md
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't immediately clear: why was updating your .bashrc required here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread gcam-build.md
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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note these are needed to compile gcam.exe

Comment thread gcam-build.md
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I encountered a few issues, and this was my remedy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants