[R-pkg-devel] Problems with devtools::build() in R

Jarrett Phillips ph||||p@j@rrett1 @end|ng |rom gm@||@com
Wed May 17 17:05:46 CEST 2023


Hi Ivan,

Yes, I can build a Fortran program successfully.

cat >hello.f90 <<EOF
program hello
 print *, 'Hello world'
end program
EOF
gfortran -o hello hello.f90 && ./hello

returns Hello world as expected.

`which gfortran`  returns

/usr/local/bin/gfortran



`gfortran -print-search-dirs` returns


install: /usr/local/gfortran/lib/gcc/aarch64-apple-darwin22/12.2.0/

programs:
=/usr/local/gfortran/libexec/gcc/aarch64-apple-darwin22/12.2.0/:/usr/local/gfortran/libexec/gcc/aarch64-apple-darwin22/12.2.0/:/usr/local/gfortran/libexec/gcc/aarch64-apple-darwin22/:/usr/local/gfortran/lib/gcc/aarch64-apple-darwin22/12.2.0/:/usr/local/gfortran/lib/gcc/aarch64-apple-darwin22/:/usr/local/gfortran/lib/gcc/aarch64-apple-darwin22/12.2.0/../../../../aarch64-apple-darwin22/bin/aarch64-apple-darwin22/12.2.0/:/usr/local/gfortran/lib/gcc/aarch64-apple-darwin22/12.2.0/../../../../aarch64-apple-darwin22/bin/

libraries:
=/usr/local/gfortran/lib/gcc/aarch64-apple-darwin22/12.2.0/:/usr/local/gfortran/lib/gcc/aarch64-apple-darwin22/12.2.0/../../../../aarch64-apple-darwin22/lib/aarch64-apple-darwin22/12.2.0/:/usr/local/gfortran/lib/gcc/aarch64-apple-darwin22/12.2.0/../../../../aarch64-apple-darwin22/lib/:/usr/local/gfortran/lib/gcc/aarch64-apple-darwin22/12.2.0/../../../aarch64-apple-darwin22/12.2.0/:/usr/local/gfortran/lib/gcc/aarch64-apple-darwin22/12.2.0/../../../



file.path(R.home('etc'), 'Makeconf') in R returns


[1] "/Library/Frameworks/R.framework/Resources/etc/Makeconf"

Finally, yes, R CMD build fails for me bith through the Mac Terminal and
via devtools::build().


Cheers,

Jarrett

On Wed, May 17, 2023 at 3:42 AM Ivan Krylov <krylov.r00t using gmail.com> wrote:

> Can you build a Fortran program? I.e., does the following work?
>
> cat >hello.f90 <<EOF
> program hello
>  print *, 'Hello world'
> end program
> EOF
> gfortran -o hello hello.f90 && ./hello
>
> Does `which gfortran` confirm that it's the executable you expect it to
> be?
>
> What does `gfortran -print-search-dirs` say about the locations for its
> files? (Where does -lgfortran actually live?)
>
> What does your file.path(R.home('etc'), 'Makeconf') say about the
> library paths?
>
> (Using `R CMD build` to build the package doesn't help either, right? If
> yes, a faster way of reproducing the problem would be to run the
> following command:
>
> PKG_CPPFLAGS=-I/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include
> \
>  R CMD SHLIB *cpp
>
> ...in the src directory of your package, instead of waiting for R CMD
> build to try to install the resulting source package and fail.)
>
> --
> Best regards,
> Ivan
>

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list