JGCRI / gcam-core

GCAM -- The Global Change Analysis Model
http://jgcri.github.io/gcam-doc/
Other
263 stars 159 forks source link

install from source #421

Open fipoucat opened 2 months ago

fipoucat commented 2 months ago

I am attempting to install version7 on Ubuntu 22.04 but experiencing error message:

cd input/gcamdata && Rscript -e "devtools::load_all('.')" -e "driver(write_output=FALSE, write_xml=TRUE)" ℹ Loading gcamdata Error in load_imports(path) : The package "assertthat" (>= 0.2) is required. Calls: ... load_imports -> deps_check_installed -> check_installed Execution halted make: *** [Makefile:5: xml] Error 1

expect hint from some with experience installing from source.

Thank you

pkyle commented 2 months ago

gcamdata doesn't install R packages on your computer. There is a list of packages that should be installed, using the install.packages() function in R, in the file input/gcamdata/DESCRIPTION. The file isn't automatically updated, and as such the version numbers indicated in that file can be ignored. Still, every package listed in the "Imports" section should be installed locally. Copying here in case it's helpful.

assertthat
dplyr
methods
magrittr
tibble
tidyr
readr
data.table
rlang
stringr
fipoucat commented 2 months ago

Thank you Page, I installed the packages but was not very lucky because at one point in the install process I have another error: [ 1] "module_energy_L202.Ccoef" [1] "- make 0.01" [1] "module_energy_L210.resources" Error in mutate() at gcamdata/R/utils-data.R:32:3: ℹ In argument: environCost = if_else(resource == "coal" & region %in% L210.low_reg, 0, environCost). Caused by error in if_else(): ! false must be a vector, not NULL. Backtrace: ▆

  1. ├─gcamdata::driver(write_output = FALSE, write_xml = TRUE)
  2. │ └─gcamdata:::run_chunk(chunk, all_data[input_names]) at gcamdata/R/driver.R:364:7
  3. │ ├─base::do.call(chunk, list(driver.MAKE, all_data)) at gcamdata/R/driver.R:16:3
  4. │ └─gcamdata:::module_energy_L210.resources("MAKE", <named list>)
  5. │ └─... %>% ... at gcamdata/R/zenergy_L210.resources.R:537:5
  6. ├─gcamdata:::add_precursors(...)
  7. ├─gcamdata:::add_legacy_name(., "L210.RsrcEnvironCost_SSP4", overwrite = TRUE) at gcamdata/R/utils-data.R:108:3
  8. ├─gcamdata:::add_comments(., "EnvironCost adjusted for high growth and low growth regions ") at gcamdata/R/utils-data.R:67:3
  9. ├─gcamdata:::add_comments(., "A10.EnvironCost_SSPs written to all regions") at gcamdata/R/utils-data.R:49:3
    1. ├─gcamdata:::add_units(., "$/GJ") at gcamdata/R/utils-data.R:49:3
    2. ├─gcamdata:::add_title(...) at gcamdata/R/utils-data.R:91:3
    3. ├─dplyr::mutate(...) at gcamdata/R/utils-data.R:32:3
    4. ├─dplyr:::mutate.data.frame(...)
    5. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
    6. │ ├─base::withCallingHandlers(...)
    7. │ └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
    8. │ └─mask$eval_all_mutate(quo)
    9. │ └─dplyr (local) eval()
    10. ├─dplyr::if_else(resource == "coal" & region %in% L210.low_reg, 0, environCost)
    11. │ └─dplyr:::vec_case_when(...)
    12. │ └─vctrs::list_check_all_vectors(values, arg = values_arg, call = call)
    13. └─vctrs:::stop_scalar_type(<fn>(NULL), "false", <env>)
    14. └─vctrs:::stop_vctrs(...)
    15. └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call) Execution halted make: *** [Makefile:5: xml] Error 1

On Sun, Apr 28, 2024 at 7:27 AM Page Kyle @.***> wrote:

gcamdata doesn't install R packages on your computer. There is a list of packages that should be installed, using the install.packages() function in R, in the file input/gcamdata/DESCRIPTION. The file isn't automatically updated, and as such the version numbers indicated in that file can be ignored. Still, every package listed in the "Imports" section should be installed locally. Copying here in case it's helpful.

assertthat dplyr methods magrittr tibble tidyr readr data.table rlang stringr

— Reply to this email directly, view it on GitHub https://github.com/JGCRI/gcam-core/issues/421#issuecomment-2081370871, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXY6LLBCATKJCVHACXFL2LY7SQFHAVCNFSM6AAAAABG4EM656VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBRGM3TAOBXGE . You are receiving this because you authored the thread.Message ID: @.***>

pkyle commented 2 months ago

Right, that's because we never followed up the GCAM7 release last summer with another release that fixes this issue. I think that code didn't crash in some older versions of dplyr, for some reason, because it worked when it was tested out! This exact error is shown here: https://github.com/JGCRI/gcam-core/issues/393#issue-2134461031 And my first reply is what I'd recommend doing here too: https://github.com/JGCRI/gcam-core/issues/393#issuecomment-1945281914

fipoucat commented 2 months ago

There is an issue cloning the repository.

git remote add github_pkyle https://github.com/pkyle/gcam-core.git fatal: not a git repository (or any parent up to mount point /media/sarr) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

On Mon, Apr 29, 2024 at 3:50 PM Page Kyle @.***> wrote:

Right, that's because we never followed up the GCAM7 release last summer with another release that fixes this issue. I think that code didn't crash in some older versions of dplyr, for some reason, because it worked when it was tested out! This exact error is shown here: #393 (comment) https://github.com/JGCRI/gcam-core/issues/393#issue-2134461031 And my first reply is what I'd recommend doing here too: #393 (comment) https://github.com/JGCRI/gcam-core/issues/393#issuecomment-1945281914

— Reply to this email directly, view it on GitHub https://github.com/JGCRI/gcam-core/issues/421#issuecomment-2083088813, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXY6LM6JFZTFVFDHZR7YJLY7ZT5DAVCNFSM6AAAAABG4EM656VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBTGA4DQOBRGM . You are receiving this because you authored the thread.Message ID: @.***>

pkyle commented 2 months ago

Oh, that git remote ... command can only be executed from within a git repo. So, your working directory should be gcam-core (or one of the subdirectories). If you're working from a static release version, as opposed to a locally cloned git repository, I'm not sure that there's any simple/clean way to automatically apply (cherry-pick) these commits, but they're pretty small, and can just be done manually. Here are the two that you'll want: https://github.com/pkyle/gcam-core/commit/f3377fc2a517c6e3da12dd1036bf733e404ac627 https://github.com/pkyle/gcam-core/commit/1d25fbc585d9b7620179f1649acdb93cca564267

fipoucat commented 2 months ago

Well, leave it there for now, waiting another release

On Wed, May 1, 2024 at 7:16 PM Page Kyle @.***> wrote:

Oh, that git remote ... command can only be executed from within a git repo. So, your working directory should be gcam-core (or one of the subdirectories). If you're working from a static release version, as opposed to a locally cloned git repository, I'm not sure that there's any simple/clean way to automatically apply (cherry-pick) these commits, but they're pretty small, and can just be done manually. Here are the two that you'll want: @. https://github.com/pkyle/gcam-core/commit/f3377fc2a517c6e3da12dd1036bf733e404ac627 @. https://github.com/pkyle/gcam-core/commit/1d25fbc585d9b7620179f1649acdb93cca564267

— Reply to this email directly, view it on GitHub https://github.com/JGCRI/gcam-core/issues/421#issuecomment-2088957125, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXY6LPL2O6SCWDLVCUCLJDZAE5SNAVCNFSM6AAAAABG4EM656VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBYHE2TOMJSGU . You are receiving this because you authored the thread.Message ID: @.***>