flr / FLa4a

The repository for the JRC initiative on stock assessment
https://fishreg.jrc.ec.europa.eu/web/a4a
12 stars 6 forks source link

sca function generates error #131

Closed francoisturcot closed 5 years ago

francoisturcot commented 5 years ago

Hi,

FLCore version 2.6.12 and FLa4a 1.1.2 on mac in R version 3.5.2.

sca function (with my data or example ple4 data) generates this error message:

sh: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/FLa4a/bin/linux/a4a: cannot execute binary file Error in file(file, "r") : impossible d'ouvrir la connexion De plus : Warning message: In file(file, "r") : impossible d'ouvrir le fichier '/var/folders/d_/0b934x8n1pgf8stvvq282t0c0000gn/T//RtmpLVOqqG/file1f52f605c5/a4a.par' : No such file or directory

I know there is some french in there but I think it's readable.. any ideas on what I could try to fix this?

Thanks.

François

iagomosqueira commented 5 years ago

The code is not detecting OSX and tries to find the Linux executable at

/Library/Frameworks/R.framework/Versions/3.5/Resources/library/FLa4a/bin/linux/a4a

Could you try to run

library(FLa4a)
FLa4a:::os.type('osx')
FLa4a:::os.type('linux')

and tell us if they return TRUE or FALSE?

Also, the result of

Sys.info()["sysname"]
.Platform$OS.type

What version of OSX are you using?

francoisturcot commented 5 years ago

FLa4a:::os.type('osx') Error in match.arg(type) : 'arg' should be one of “linux”, “windows”, “else” FLa4a:::os.type('linux') [1] TRUE

FLa4a:::os.type("else") [1] TRUE

Sys.info()["sysname"] sysname "Darwin" .Platform$OS.type [1] "unix"

el capitan 10.11.6

iagomosqueira commented 5 years ago

Can you install your own R packages? If so, you can upgrade FLa4a to the current version, 1.6.5. For example using

devtools::install_github("flr/FLa4a")

FLa4a:::os.type('osx') should return TRUE in your machine.

If you need the binary package from the repository, we are working to get the OSX package compilation working in travis, as we don't have access to a Mac at the moment.

francoisturcot commented 5 years ago

So installing the newest version fixed the os issue:

FLa4a:::os.type('osx') sysname TRUE

but I get a different error message now when using the sca fuction:

fit <- sca(ple4, ple4.indices) Error in file(file, "r") : impossible d'ouvrir la connexion De plus : Warning message: In file(file, "r") : impossible d'ouvrir le fichier '/var/folders/d_/0b934x8n1pgf8stvvq282t0c0000gn/T//RtmpPSbXjP/file1792029a62/nllik.out' : No such file or directory

iagomosqueira commented 5 years ago

We need to update the a4a executable for OSX. It now returns likelihood by component. Trying to compile the tpl and will push a new version as soon as possible.

francoisturcot commented 5 years ago

Okay, thank you for your time!

iagomosqueira commented 5 years ago

I have just pushed a new OSX executable, but I could only test it as an executable, and it run. Could you have a go and let us know, please?

francoisturcot commented 5 years ago

It works now. Thank you!

iagomosqueira commented 5 years ago

Great. will be pushing an OSX package to the repository as well, many other packages are now in there.