Installing package fields

Everything related to the development of modules in jamovi
Post Reply
User avatar
dadedodo
Posts: 8
Joined: Sun Nov 21, 2021 9:27 pm

Installing package fields

Post by dadedodo »

Dear all,

I am trying to create a module that has some functions from the package fields (Jamovi 2.5.6). However, I got an error saying that I need gfortran to install the 'fields' package (attached the error code). Is there a solution to solve this issue? Thanks!

* installing *source* package ‘fields’ ...
** package ‘fields’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.3.9.4)’
sh: /opt/gfortran/bin/gfortran: No such file or directory
using SDK: ‘MacOSX14.4.sdk’
clang -arch x86_64 -I"/Applications/jamovi.app/Contents/Frameworks/R.framework/Versions/Current/Resources/bin/../include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c ExponentialUpperC.c -o ExponentialUpperC.o
clang -arch x86_64 -I"/Applications/jamovi.app/Contents/Frameworks/R.framework/Versions/Current/Resources/bin/../include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RdistEarth.c -o RdistEarth.o
clang -arch x86_64 -I"/Applications/jamovi.app/Contents/Frameworks/R.framework/Versions/Current/Resources/bin/../include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c addToDiagC.c -o addToDiagC.o
clang -arch x86_64 -I"/Applications/jamovi.app/Contents/Frameworks/R.framework/Versions/Current/Resources/bin/../include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c compactToMatC.c -o compactToMatC.o
clang -arch x86_64 -I"/Applications/jamovi.app/Contents/Frameworks/R.framework/Versions/Current/Resources/bin/../include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c expfnC.c -o expfnC.o
/opt/gfortran/bin/gfortran -arch x86_64 -fPIC -Wall -g -O2 -c fieldsF77Code.f -o fieldsF77Code.o
make: /opt/gfortran/bin/gfortran: No such file or directory
make: *** [fieldsF77Code.o] Error 1
User avatar
jonathon
Posts: 2733
Joined: Fri Jan 27, 2017 10:04 am

Re: Installing package fields

Post by jonathon »

hi,

this is an R issue, rather than a jamovi one ... you *could* try installing the appropriate fortran compiler, etc. etc. but this can often turn into a rabbit hole ... building native R packages under macOS isn't for the faint of heart.

what R package are you trying to use? i assume this is an R package you're adding to your module's DESCRIPTION file.

i may be able to manually add a built version of the package to our repo, so as to bypass this built step.

jonathon
User avatar
dadedodo
Posts: 8
Joined: Sun Nov 21, 2021 9:27 pm

Re: Installing package fields

Post by dadedodo »

Thanks for the quick replay. You are right, I am calling the installation from the DESCRITPTION file.
User avatar
jonathon
Posts: 2733
Joined: Fri Jan 27, 2017 10:04 am

Re: Installing package fields

Post by jonathon »

try that. i've added the fields binaries to the jamovi repo, and when you run `jmvtools::install()` now, it should pull the built binaries down, rather than the source versions.

jonathon
User avatar
dadedodo
Posts: 8
Joined: Sun Nov 21, 2021 9:27 pm

Re: Installing package fields

Post by dadedodo »

Hi Jonathon, I am still having some issues in getting fields installed. I have installed gfortran that it is recognize by R, but I got an error saying that my gfortran is for amr and the package requires intel. It seems that `jmvtools::install()` is still trying to use the source version. I am using jamovi 2.5.6. Thanks a lot for your support.
User avatar
jonathon
Posts: 2733
Joined: Fri Jan 27, 2017 10:04 am

Re: Installing package fields

Post by jonathon »

ah, that could be your issue. upgrade to 2.6 ...

jonathon
User avatar
dadedodo
Posts: 8
Joined: Sun Nov 21, 2021 9:27 pm

Re: Installing package fields

Post by dadedodo »

I am working on a project in which I have attendees using my module on Mac and Windows. I found that building a module on 2.5.6 in Mac or Windows works on both. Would this be the same with 2.6? Should I use the solid version of Jamovi whic has a longer life span?
User avatar
jonathon
Posts: 2733
Joined: Fri Jan 27, 2017 10:04 am

Re: Installing package fields

Post by jonathon »

> I found that building a module on 2.5.6 in Mac or Windows works on both.

it depends. if your have all non-native R packages, then it can sometimes work across platforms. in your case, you're using the `fields` package, and that has native code (which is why it wants a fortran compiler) ... so i wouldn't expect it to work across platform, and rather, you would need to build 5 different versions (eventually 6) ... one for macOS x64, one for macOS arm64, one for linux on x64, one for linux on arm64, and one for windows on x64 (and eventually, one for windows on arm64) ...

this is where we do some of the heavy lifting ... because if its in the jamovi library, we automatically build it for all the platforms.

i would target the 2.6 ... it will become the "solid" fairly soon.

jonathon
Post Reply