AllanCameron / PDFR

An R package to extract text from pdf.
Other
37 stars 3 forks source link

Installation Problem: Failed to build PDFR 0.1.0 #6

Open pvsundar opened 1 year ago

pvsundar commented 1 year ago

I am using the latest release of R Studio on a Surface Pro 7. Windows 10. RStudio 2023.03.0+386 "Cherry Blossom" Release (3c53477afb13ab959aeb5b34df1f10c237b256c3, 2023-03-09) for Windows Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2023.03.0+386 Chrome/108.0.5359.179 Electron/22.0.3 Safari/537.36


install.packages("pak") Installing package into 'C:/Users/sbalakrishnan/AppData/Local/R/win-library/4.2' (as 'lib' is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/pak_0.4.0.zip' Content type 'application/zip' length 11106824 bytes (10.6 MB) downloaded 10.6 MB

package 'pak' successfully unpacked and MD5 sums checked

The downloaded binary packages are in C:\Users\sbalakrishnan\AppData\Local\Temp\Rtmp6bsTg6\downloaded_packages

pak::pkg_install("AllanCameron/PDFR") ! Using bundled GitHub PAT. Please add your own PAT using gitcreds::gitcreds_set(). ✔ Updated metadata database: 4.94 MB in 12 files.
✔ Updating metadata database ... done
→ Will install 1 package. → Will download 1 package with unknown size.

  • PDFR 0.1.0 [bld][cmp][dl] (GitHub: 9d9806c) ℹ Getting 1 pkg with unknown size ✔ Got PDFR 0.1.0 (source) (2.07 MB)
    ✔ Downloaded 1 package (2.07 MB)in 1.9s
    ℹ Packaging PDFR 0.1.0 ✔ Packaged PDFR 0.1.0 (17.9s)
    ℹ Building PDFR 0.1.0
    ✖ Failed to build PDFR 0.1.0
    Error:
    ! error in pak subprocess Caused by error in stop_task_build(state, worker): ! Failed to build source package 'PDFR' Full installation output:
  • installing source package 'PDFR' ... using non-staged installation via StagedInstall field libs g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.3/include" -DNDEBUG -I'C:/Users/sbalakrishnan/AppData/Local/R/win-library/4.2/Rcpp/include' -I'C:/Users/sbalakrishnan/AppData/Local/R/win-library/4.2/testthat/include' -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -Wall -pedantic -fdiagnostics-color=always -c RcppExports.cpp -o RcppExports.o g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.3/include" -DNDEBUG -I'C:/Users/sbalakrishnan/AppData/Local/R/win-library/4.2/Rcpp/include' -I'C:/Users/sbalakrishnan/AppData/Local/R/win-library/4.2/testthat/include' -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -Wall -pedantic -fdiagnostics-color=always -c adobetounicode.cpp -o adobetounicode.o g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.3/include" -DNDEBUG -I'C:/Users/sbalakrishnan/AppData/Local/R/win-library/4.2/Rcpp/include' -I'C:/Users/sbalakrishnan/AppData/Local/R/win-library/4.2/testthat/include' -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -Wall -pedantic -fdiagnostics-color=always -c box.cpp -o box.o In file included from box.cpp:13 box.h:n constructor 'Box::Box(std::vector) box.h:119:40:error: runtime_erroris not a member of 'std 119 | if (floats.size() != 4) throw std::runtime_error needs four floats"); | ^~~~~ box.h:n member function 'float Box::Edge(int) const box.h:145:27:error: runtime_erroris not a member of 'std 145 | default: throw std::runtime_erroralid box index"); | ^~~~~ make: *** [C:/PROGRA~1/R/R-42~1.3/etc/x64/Makeconf:260: box.o] Error 1 ERROR: compilation failed for package 'PDFR'
  • removing 'C:/Users/SBALAK~1/AppData/Local/Temp/RtmpMzQTtA/pkg-lib52243e9e7641/PDFR' Type .Last.error to see the more details.

image

pvsundar commented 1 year ago

image

gorkang commented 1 year ago

Same error on Ubuntu 22.04 and RStudio 2023.03.1 Build 419

elipousson commented 1 year ago

Shoot. I hope this isn't something I introduced with my pull request @AllanCameron. I will say that a colleague of mine also wasn't able to install on Windows even before my PR. FWIW – I am able to install PDFR on OSX.

elipousson commented 1 year ago

@gorkang @pvsundar Can you try again but set dependencies = TRUE for pkg_install() just to make sure that isn’t the issue?

gorkang commented 1 year ago

Using pak::pkg_install("AllanCameron/PDFR", dependencies = TRUE) got this:

pak::pkg_install("AllanCameron/PDFR", dependencies = TRUE)
#> ℹ Loading metadata database
#> ℹ Loading metadata database
#> ✔ Loading metadata database ... done
#> ✔ Loading metadata database ... done
#> 
#>  
#> 
#> → Will install 1 package.
#> → Will install 1 package.
#> → Will download 1 package with unknown size.
#> → Will download 1 package with unknown size.
#> + PDFR   0.1.0 [bld][cmp][dl] (GitHub: 9d9806c)
#> + PDFR   0.1.0 [bld][cmp][dl] (GitHub: 9d9806c)
#> ℹ Getting 1 pkg with unknown size
#> ℹ Getting 1 pkg with unknown size
#> ✔ Cached copy of PDFR 0.1.0 (source) is the latest build
#> ✔ Cached copy of PDFR 0.1.0 (source) is the latest build
#> ℹ Packaging PDFR 0.1.0
#> ℹ Packaging PDFR 0.1.0
#> ✔ Packaged PDFR 0.1.0 (848ms)
#> ✔ Packaged PDFR 0.1.0 (848ms)
#> ℹ Building PDFR 0.1.0
#> ℹ Building PDFR 0.1.0
#> ✖ Failed to build PDFR 0.1.0
#> ✖ Failed to build PDFR 0.1.0
#> Error: ! error in pak subprocess
#> Caused by error in `stop_task_build(state, worker)`:
#> ! Failed to build source package 'PDFR'
#> Full installation output:
#> * installing *source* package ‘PDFR’ ...
#> ** using non-staged installation via StagedInstall field
#> ** libs
#> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I'/home/emrys/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include' -I'/home/emrys/R/x86_64-pc-linux-gnu-library/4.2/testthat/include'    -fpic  -g -O2 -ffile-prefix-map=/build/r-base-LhKvHL/r-base-4.2.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -Wall -pedantic -c RcppExports.cpp -o RcppExports.o
#> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I'/home/emrys/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include' -I'/home/emrys/R/x86_64-pc-linux-gnu-library/4.2/testthat/include'    -fpic  -g -O2 -ffile-prefix-map=/build/r-base-LhKvHL/r-base-4.2.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -Wall -pedantic -c adobetounicode.cpp -o adobetounicode.o
#> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I'/home/emrys/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include' -I'/home/emrys/R/x86_64-pc-linux-gnu-library/4.2/testthat/include'    -fpic  -g -O2 -ffile-prefix-map=/build/r-base-LhKvHL/r-base-4.2.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -Wall -pedantic -c box.cpp -o box.o
#> In file included from box.cpp:13:
#> box.h: In constructor ‘Box::Box(std::vector<float>)’:
#> box.h:119:40: error: ‘runtime_error’ is not a member of ‘std’
#>   119 |     if (floats.size() != 4) throw std::runtime_error("Box needs four floats");
#>       |                                        ^~~~~~~~~~~~~
#> box.h: In member function ‘float Box::Edge(int) const’:
#> box.h:145:27: error: ‘runtime_error’ is not a member of ‘std’
#>   145 |       default: throw std::runtime_error("Invalid box index");
#>       |                           ^~~~~~~~~~~~~
#> make: *** [/usr/lib/R/etc/Makeconf:178: box.o] Error 1
#> ERROR: compilation failed for package ‘PDFR’
#> * removing ‘/tmp/RtmpBNNwTD/pkg-lib3200739754bf/PDFR’

Created on 2023-04-04 with reprex v2.0.2

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.2.3 (2023-03-15) #> os Ubuntu 22.04.2 LTS #> system x86_64, linux-gnu #> ui X11 #> language en_US:en #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz Atlantic/Canary #> date 2023-04-04 #> pandoc 2.19.2 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> cli 3.6.1 2023-03-23 [1] CRAN (R 4.2.3) #> digest 0.6.31 2022-12-11 [1] RSPM (R 4.2.0) #> evaluate 0.20 2023-01-17 [1] RSPM (R 4.2.0) #> fastmap 1.1.1 2023-02-24 [1] RSPM (R 4.2.0) #> fs 1.6.1 2023-02-06 [1] RSPM (R 4.2.0) #> glue 1.6.2 2022-02-24 [1] CRAN (R 4.2.0) #> htmltools 0.5.5 2023-03-23 [1] CRAN (R 4.2.3) #> knitr 1.42 2023-01-25 [1] CRAN (R 4.2.1) #> lifecycle 1.0.3 2022-10-07 [1] RSPM (R 4.2.0) #> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.2.0) #> pak 0.4.0 2023-01-15 [1] RSPM (R 4.2.0) #> purrr 1.0.1 2023-01-10 [1] RSPM (R 4.2.0) #> R.cache 0.16.0 2022-07-21 [1] CRAN (R 4.2.0) #> R.methodsS3 1.8.2 2022-06-13 [1] CRAN (R 4.2.0) #> R.oo 1.25.0 2022-06-12 [1] CRAN (R 4.2.0) #> R.utils 2.12.2 2022-11-11 [1] RSPM (R 4.2.0) #> reprex 2.0.2 2022-08-17 [1] RSPM (R 4.2.0) #> rlang 1.1.0 2023-03-14 [1] RSPM (R 4.2.0) #> rmarkdown 2.21 2023-03-26 [1] RSPM (R 4.2.0) #> rstudioapi 0.14 2022-08-22 [1] RSPM (R 4.2.0) #> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.2.0) #> styler 1.9.1 2023-03-04 [1] RSPM (R 4.2.0) #> vctrs 0.6.1 2023-03-22 [1] CRAN (R 4.2.3) #> withr 2.5.0 2022-03-03 [1] CRAN (R 4.2.0) #> xfun 0.38 2023-03-24 [1] CRAN (R 4.2.3) #> yaml 2.3.7 2023-01-23 [1] RSPM (R 4.2.0) #> #> [1] /home/emrys/R/x86_64-pc-linux-gnu-library/4.2 #> [2] /usr/local/lib/R/site-library #> [3] /usr/lib/R/site-library #> [4] /usr/lib/R/library #> #> ────────────────────────────────────────────────────────────────────────────── ```
elipousson commented 1 year ago

Thanks @gorkang. I have a Windows machine at work I can use to to figure out the issue (a good excuse to get more familiar with Rcpp and C++) sometime in the next few weeks. I'll share an update here and open a pull request if I make any progress, @AllanCameron.

elipousson commented 1 year ago

I tried installing my fork on a Windows machine this afternoon and I'm getting the same error pointing to an issue with box.cpp. With my very limited understanding of Rcpp and C++, I don't think I'll be able to address this issue but hopefully @AllanCameron may find the opportunity to come back to it in the future.