mhunter1 / dynr

Dynamic Modeling in R
5 stars 6 forks source link

dynr installation issues 2023 #276

Open symiin opened 1 year ago

symiin commented 1 year ago

I am starting a list of installation issues on various platforms. Dynr all the arma branch make build fine so this is something only on the master branch @mhunter1

  1. Mac Monterey. R version = "R version 4.2.2 (2022-10-31)" Error: object ‘shortPathName’ is not exported by 'namespace:utils' Execution halted ERROR: lazy loading failed for package ‘dynr’
    • removing ‘/private/var/folders/rq/51l3j2n56c11zfmf16bqqqg92wm6cf/T/RtmpV8Xjj1/Rinst713b7537d2b6/dynr’

      ERROR: package installation failed

symiin commented 1 year ago

Windows 11, R.Version = "R version 4.2.2 (2022-10-31 ucrt)" dynr working before but recently shows this error C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: C:/R/local323/lib/x64/libgsl.a(error.o):error.c:(.text+0x3b): undefined reference to `__imp___iob_func'

jeksterslab commented 1 year ago

I am starting a list of installation issues on various platforms. Dynr all the arma branch make build fine so this is something only on the master branch @mhunter1

1. Mac Monterey. R version = "R version 4.2.2 (2022-10-31)"
   Error: object ‘shortPathName’ is not exported by 'namespace:utils'
   Execution halted
   ERROR: lazy loading failed for package ‘dynr’

* removing ‘/private/var/folders/rq/51l3j2n56c11zfmf16bqqqg92wm6cf/T/RtmpV8Xjj1/Rinst713b7537d2b6/dynr’
  -----------------------------------
  ERROR: package installation failed

I fixed this bug on my sandbox build by running the following before building:

sed -i 's/importFrom(\"utils\", \"str\", \".DollarNames\", \"packageVersion\", \"shortPathName\")/import(utils)/' NAMESPACE
sed -i 's/Imports: MASS/Imports: utils, MASS/' DESCRIPTION.in
sed -i 's/Imports: MASS/Imports: utils, MASS/' DESCRIPTION

I replaced importFrom("utils", "str", ".DollarNames", "packageVersion", "shortPathName") with import(utils) in the NAMESPACE file and added utils under Imports in the DESCRIPTION file. If this fix is acceptable I can implement it on the master branch. @mhunter1 @symiin

Note that code with shortPathName(), which is a Windows only function, is not covered by unix-like machines, thus the importFrom("utils", "shortPathName") is being flagged as an error. The solution I have bypasses that by simply importing utils (import(utils)).

jeksterslab commented 1 year ago

Windows 11, R.Version = "R version 4.2.2 (2022-10-31 ucrt)" dynr working before but recently shows this error C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: C:/R/local323/lib/x64/libgsl.a(error.o):error.c:(.text+0x3b): undefined reference to `__imp___iob_func'

I think the issue here is the incompatibility of the toolchain in the newer versions of R. I tried installing dynr in Windows using the compatible Rtools version. I totally abandoned local323 and relied on the headers and binaries produced by Rtools.

mhunter1 commented 1 year ago

I replaced importFrom("utils", "str", ".DollarNames", "packageVersion", "shortPathName") with import(utils) in the NAMESPACE file and added utils under Imports in the DESCRIPTION file. If this fix is acceptable I can implement it on the master branch.

@jeksterslab No, Do not do this. I have the beginning of an alternative fix committed here: d30054fb1800f2b65a765f1db3ec2c4b35e297e7

jeksterslab commented 1 year ago

I replaced importFrom("utils", "str", ".DollarNames", "packageVersion", "shortPathName") with import(utils) in the NAMESPACE file and added utils under Imports in the DESCRIPTION file. If this fix is acceptable I can implement it on the master branch.

@jeksterslab No, Do not do this. I have the beginning of an alternative fix committed here: d30054f

@mhunter1 Sure. I only implemented my fix on my sandbox builds. From here on I will base my builds on your latest commit.