[R-SIG-Mac] Cannot compile Fortran on macOS

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

[R-SIG-Mac] Cannot compile Fortran on macOS

Adelchi Azzalini
Hi.
In essence, my problem is that I cannot install a package which requires Fortran-77 compilation on my Mac.

More in detail, this is my own package 'mnormt' which exists on CRAN since 2006; it is currently at version 1.5-7. It has been developed in successive versions on a Linux machine, where it compiles with no problems. The macOS and MS-windows versions are created on CRAN, where it passes all pertaining checks.

Now, in the new pandemic world, I need create a new version of the package, but working from home, hence using my Mac laptop instead of the Linux desktop as in the past. Unfortunately, compilation or loading does not work. If I run

 R CMD check mnormt_1.5-7.tar.gz

first I get a bunch of warning messages such as

Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) ....  [-Wconversion]
Warning: ‘lxchng’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Warning: Label 10 at (1) defined but not used [-Wunused-label]

and finally it crashes with

Error: package or namespace load failed for ‘mnormt’:
 .onLoad failed in loadNamespace() for 'mnormt', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so':
  dlopen(/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so, 6): Symbol not found: ___addtf3
  Referenced from: /usr/local/lib/libquadmath.0.dylib
  Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
 in /usr/local/lib/libquadmath.0.dylib
Error: loading failed

Needless to say, I have no idea what this "addtf3" is or it should be. There is no such a symbol in the Fortran code.

I believe to have installed all ingredients indicated at https://mac.r-project.org/tools/
See the list below with details about my system and other installed tools.

Any suggestions for sorting this out?

Adelchi Azzalini


---------------------------------------------------
Installation info:

R> R.version
               _                          
platform       x86_64-apple-darwin17.0    
arch           x86_64                      
os             darwin17.0                  
system         x86_64, darwin17.0          
status                                    
major          4                          
minor          0.0                        
year           2020                        
month          04                          
day            24                          
svn rev        78286                      
language       R                          
version.string R version 4.0.0 (2020-04-24)
nickname       Arbor Day                  

--- macOS Mojave 10.14.6

--- Xcode version 11.3.1

--- Fortran

[aa@mac-2013:~] gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin18/8.2.0/lto-wrapper
Target: x86_64-apple-darwin18
Configured with: ../gcc-8.2.0/configure --prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/build_package/deps --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin18 --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
Thread model: posix
gcc version 8.2.0 (GCC)

[aa@mac-2013:~] echo $PATH
.:/Users/aa/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin/:/usr/X11R6/bin:/opt/local/bin:/Library/TeX/texbin:/usr/local/gfortran/bin

-- other tools indicated at https://mac.r-project.org/tools/
   xz-5.2.5/  is installed
   PCRE2 10.34 built with --disable-jit
   bzip2 Version 1.0.6 is installed
 
_______________________________________________
R-SIG-Mac mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Reply | Threaded
Open this post in threaded view
|

Re: [R-SIG-Mac] Cannot compile Fortran on macOS

R-SIG-Mac mailing list
Adelchi,

Why don’t you try Fink version of R?

Fink build mnormt on R 4.0 as well (although it is experimental).
https://github.com/fink/fink-distributions/issues/623

Fink allows you to install different versions of R (3.6, 3.5, 3.4, 3.3, 3.2 and 3.1).

For different versions, CRAN packages are separately installed (/sw/lib/R/3.6/site-library  and so on).


> 2020/05/19 22:45、Adelchi Azzalini <[hidden email]>のメール:
>
> Hi.
> In essence, my problem is that I cannot install a package which requires Fortran-77 compilation on my Mac.
>
> More in detail, this is my own package 'mnormt' which exists on CRAN since 2006; it is currently at version 1.5-7. It has been developed in successive versions on a Linux machine, where it compiles with no problems. The macOS and MS-windows versions are created on CRAN, where it passes all pertaining checks.
>
> Now, in the new pandemic world, I need create a new version of the package, but working from home, hence using my Mac laptop instead of the Linux desktop as in the past. Unfortunately, compilation or loading does not work. If I run
>
> R CMD check mnormt_1.5-7.tar.gz
>
> first I get a bunch of warning messages such as
>
> Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) ....  [-Wconversion]
> Warning: ‘lxchng’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> Warning: Label 10 at (1) defined but not used [-Wunused-label]
>
> and finally it crashes with
>
> Error: package or namespace load failed for ‘mnormt’:
> .onLoad failed in loadNamespace() for 'mnormt', details:
>  call: dyn.load(file, DLLpath = DLLpath, ...)
>  error: unable to load shared object '/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so':
>  dlopen(/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so, 6): Symbol not found: ___addtf3
>  Referenced from: /usr/local/lib/libquadmath.0.dylib
>  Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
> in /usr/local/lib/libquadmath.0.dylib
> Error: loading failed
>
> Needless to say, I have no idea what this "addtf3" is or it should be. There is no such a symbol in the Fortran code.
>
> I believe to have installed all ingredients indicated at https://mac.r-project.org/tools/
> See the list below with details about my system and other installed tools.
>
> Any suggestions for sorting this out?
>
> Adelchi Azzalini
>
>
> ---------------------------------------------------
> Installation info:
>
> R> R.version
>               _                          
> platform       x86_64-apple-darwin17.0    
> arch           x86_64                      
> os             darwin17.0                  
> system         x86_64, darwin17.0          
> status                                    
> major          4                          
> minor          0.0                        
> year           2020                        
> month          04                          
> day            24                          
> svn rev        78286                      
> language       R                          
> version.string R version 4.0.0 (2020-04-24)
> nickname       Arbor Day                  
>
> --- macOS Mojave 10.14.6
>
> --- Xcode version 11.3.1
>
> --- Fortran
>
> [aa@mac-2013:~] gfortran -v
> Using built-in specs.
> COLLECT_GCC=gfortran
> COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin18/8.2.0/lto-wrapper
> Target: x86_64-apple-darwin18
> Configured with: ../gcc-8.2.0/configure --prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/build_package/deps --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin18 --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
> Thread model: posix
> gcc version 8.2.0 (GCC)
>
> [aa@mac-2013:~] echo $PATH
> .:/Users/aa/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin/:/usr/X11R6/bin:/opt/local/bin:/Library/TeX/texbin:/usr/local/gfortran/bin
>
> -- other tools indicated at https://mac.r-project.org/tools/
>   xz-5.2.5/  is installed
>   PCRE2 10.34 built with --disable-jit
>   bzip2 Version 1.0.6 is installed
>
> _______________________________________________
> R-SIG-Mac mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

_______________________________________________
R-SIG-Mac mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Reply | Threaded
Open this post in threaded view
|

Re: [R-SIG-Mac] Cannot compile Fortran on macOS

Kevin Ushey
In reply to this post by Adelchi Azzalini
The main thing that stands out to me in that error:

  Referenced from: /usr/local/lib/libquadmath.0.dylib
  Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib

R bundles its own copies of libquadmath and libgcc:

kevinushey@Kevins-MBP:/Library/Frameworks/R.framework/Resources/lib
$ ls -la
total 19120
drwxrwxr-x  11 root  admin      352 Apr 24 03:23 .
drwxrwxr-x  18 root  admin      576 Apr 29 11:46 ..
-rwxrwxr-x   1 root  admin  4070896 Apr 24 03:23 libR.dylib
drwxrwxr-x   3 root  admin       96 Apr 24 03:22 libR.dylib.dSYM
-rwxrwxr-x   1 root  admin   201472 Apr 24 03:23 libRblas.dylib
drwxrwxr-x   3 root  admin       96 Apr 24 03:22 libRblas.dylib.dSYM
-rwxrwxr-x   1 root  admin  2181472 Apr 24 03:23 libRlapack.dylib
drwxrwxr-x   3 root  admin       96 Apr 24 03:22 libRlapack.dylib.dSYM
-rw-rw-r--   1 root  admin   160624 Apr 24 03:23 libgcc_s.1.dylib
-rwxrwxr-x   1 root  admin  2851008 Apr 24 03:23 libgfortran.5.dylib
-rwxrwxr-x   1 root  admin   309648 Apr 24 03:23 libquadmath.0.dylib

 which should normally be used during the link step. However, versions in
/usr/local/lib are being discovered instead, which presumably aren't
compatible.

The simplest fix is (likely) to move those files out of the way. Otherwise,
you'd likely have to muck around with Makevars / Makeconf to adjust the
linker flags so the correct versions of these libraries are found.

Best,
Kevin

On Tue, May 19, 2020 at 6:46 AM Adelchi Azzalini <[hidden email]>
wrote:

> Hi.
> In essence, my problem is that I cannot install a package which requires
> Fortran-77 compilation on my Mac.
>
> More in detail, this is my own package 'mnormt' which exists on CRAN since
> 2006; it is currently at version 1.5-7. It has been developed in successive
> versions on a Linux machine, where it compiles with no problems. The macOS
> and MS-windows versions are created on CRAN, where it passes all pertaining
> checks.
>
> Now, in the new pandemic world, I need create a new version of the
> package, but working from home, hence using my Mac laptop instead of the
> Linux desktop as in the past. Unfortunately, compilation or loading does
> not work. If I run
>
>  R CMD check mnormt_1.5-7.tar.gz
>
> first I get a bunch of warning messages such as
>
> Warning: Possible change of value in conversion from REAL(8) to INTEGER(4)
> ....  [-Wconversion]
> Warning: ‘lxchng’ may be used uninitialized in this function
> [-Wmaybe-uninitialized]
> Warning: Label 10 at (1) defined but not used [-Wunused-label]
>
> and finally it crashes with
>
> Error: package or namespace load failed for ‘mnormt’:
>  .onLoad failed in loadNamespace() for 'mnormt', details:
>   call: dyn.load(file, DLLpath = DLLpath, ...)
>   error: unable to load shared object
> '/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so':
>
> dlopen(/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so,
> 6): Symbol not found: ___addtf3
>   Referenced from: /usr/local/lib/libquadmath.0.dylib
>   Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
>  in /usr/local/lib/libquadmath.0.dylib
> Error: loading failed
>
> Needless to say, I have no idea what this "addtf3" is or it should be.
> There is no such a symbol in the Fortran code.
>
> I believe to have installed all ingredients indicated at
> https://mac.r-project.org/tools/
> See the list below with details about my system and other installed tools.
>
> Any suggestions for sorting this out?
>
> Adelchi Azzalini
>
>
> ---------------------------------------------------
> Installation info:
>
> R> R.version
>                _
> platform       x86_64-apple-darwin17.0
> arch           x86_64
> os             darwin17.0
> system         x86_64, darwin17.0
> status
> major          4
> minor          0.0
> year           2020
> month          04
> day            24
> svn rev        78286
> language       R
> version.string R version 4.0.0 (2020-04-24)
> nickname       Arbor Day
>
> --- macOS Mojave 10.14.6
>
> --- Xcode version 11.3.1
>
> --- Fortran
>
> [aa@mac-2013:~] gfortran -v
> Using built-in specs.
> COLLECT_GCC=gfortran
>
> COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin18/8.2.0/lto-wrapper
> Target: x86_64-apple-darwin18
> Configured with: ../gcc-8.2.0/configure --prefix=/usr/local/gfortran
> --with-gmp=/Users/fx/devel/gcc/build_package/deps
> --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin18
> --disable-multilib --with-native-system-header-dir=/usr/include
> --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
> Thread model: posix
> gcc version 8.2.0 (GCC)
>
> [aa@mac-2013:~] echo $PATH
>
> .:/Users/aa/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin/:/usr/X11R6/bin:/opt/local/bin:/Library/TeX/texbin:/usr/local/gfortran/bin
>
> -- other tools indicated at https://mac.r-project.org/tools/
>    xz-5.2.5/  is installed
>    PCRE2 10.34 built with --disable-jit
>    bzip2 Version 1.0.6 is installed
>
> _______________________________________________
> R-SIG-Mac mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>

        [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Mac mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Reply | Threaded
Open this post in threaded view
|

Re: [R-SIG-Mac] Cannot compile Fortran on macOS

David Winsemius
In reply to this post by R-SIG-Mac mailing list

On 5/19/20 1:46 PM, Yoshihiko Baba via R-SIG-Mac wrote:
> Adelchi,
>
> Why don’t you try Fink version of R?
>
> Fink build mnormt on R 4.0 as well (although it is experimental).
> https://github.com/fink/fink-distributions/issues/623


This should be considered contrary to recommended practice: From the
page for macOS tools that was cited by the OP we see:


"Although it is possible to compile R using tools from other package
managers such as Homebrew, MacPorts or Fink, such binaries are by
definition incompatible with macOS native libraries and applications. If
you choose one of those package managers, make sure you
compile/everything/using those tools including R and all packages and
libraries you intend to use."


I think it should have been offered as advice to only be followed by
persons with great experience in compiling and building packages on Macs.

Best;

David

>
> Fink allows you to install different versions of R (3.6, 3.5, 3.4, 3.3, 3.2 and 3.1).
>
> For different versions, CRAN packages are separately installed (/sw/lib/R/3.6/site-library  and so on).
>
>
>> 2020/05/19 22:45、Adelchi Azzalini <[hidden email]>のメール:
>>
>> Hi.
>> In essence, my problem is that I cannot install a package which requires Fortran-77 compilation on my Mac.
>>
>> More in detail, this is my own package 'mnormt' which exists on CRAN since 2006; it is currently at version 1.5-7. It has been developed in successive versions on a Linux machine, where it compiles with no problems. The macOS and MS-windows versions are created on CRAN, where it passes all pertaining checks.
>>
>> Now, in the new pandemic world, I need create a new version of the package, but working from home, hence using my Mac laptop instead of the Linux desktop as in the past. Unfortunately, compilation or loading does not work. If I run
>>
>> R CMD check mnormt_1.5-7.tar.gz
>>
>> first I get a bunch of warning messages such as
>>
>> Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) ....  [-Wconversion]
>> Warning: ‘lxchng’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>> Warning: Label 10 at (1) defined but not used [-Wunused-label]
>>
>> and finally it crashes with
>>
>> Error: package or namespace load failed for ‘mnormt’:
>> .onLoad failed in loadNamespace() for 'mnormt', details:
>>   call: dyn.load(file, DLLpath = DLLpath, ...)
>>   error: unable to load shared object '/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so':
>>   dlopen(/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so, 6): Symbol not found: ___addtf3
>>   Referenced from: /usr/local/lib/libquadmath.0.dylib
>>   Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
>> in /usr/local/lib/libquadmath.0.dylib
>> Error: loading failed
>>
>> Needless to say, I have no idea what this "addtf3" is or it should be. There is no such a symbol in the Fortran code.
>>
>> I believe to have installed all ingredients indicated at https://mac.r-project.org/tools/
>> See the list below with details about my system and other installed tools.
>>
>> Any suggestions for sorting this out?
>>
>> Adelchi Azzalini
>>
>>
>> ---------------------------------------------------
>> Installation info:
>>
>> R> R.version
>>                _
>> platform       x86_64-apple-darwin17.0
>> arch           x86_64
>> os             darwin17.0
>> system         x86_64, darwin17.0
>> status
>> major          4
>> minor          0.0
>> year           2020
>> month          04
>> day            24
>> svn rev        78286
>> language       R
>> version.string R version 4.0.0 (2020-04-24)
>> nickname       Arbor Day
>>
>> --- macOS Mojave 10.14.6
>>
>> --- Xcode version 11.3.1
>>
>> --- Fortran
>>
>> [aa@mac-2013:~] gfortran -v
>> Using built-in specs.
>> COLLECT_GCC=gfortran
>> COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin18/8.2.0/lto-wrapper
>> Target: x86_64-apple-darwin18
>> Configured with: ../gcc-8.2.0/configure --prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/build_package/deps --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin18 --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
>> Thread model: posix
>> gcc version 8.2.0 (GCC)
>>
>> [aa@mac-2013:~] echo $PATH
>> .:/Users/aa/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin/:/usr/X11R6/bin:/opt/local/bin:/Library/TeX/texbin:/usr/local/gfortran/bin
>>
>> -- other tools indicated at https://mac.r-project.org/tools/
>>    xz-5.2.5/  is installed
>>    PCRE2 10.34 built with --disable-jit
>>    bzip2 Version 1.0.6 is installed
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> _______________________________________________
> R-SIG-Mac mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

        [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Mac mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Reply | Threaded
Open this post in threaded view
|

Re: [R-SIG-Mac] Cannot compile Fortran on macOS

David Winsemius
In reply to this post by Kevin Ushey

On 5/19/20 1:54 PM, Kevin Ushey wrote:

> The main thing that stands out to me in that error:
>
>    Referenced from: /usr/local/lib/libquadmath.0.dylib
>    Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
>
> R bundles its own copies of libquadmath and libgcc:
>
> kevinushey@Kevins-MBP:/Library/Frameworks/R.framework/Resources/lib
> $ ls -la
> total 19120
> drwxrwxr-x  11 root  admin      352 Apr 24 03:23 .
> drwxrwxr-x  18 root  admin      576 Apr 29 11:46 ..
> -rwxrwxr-x   1 root  admin  4070896 Apr 24 03:23 libR.dylib
> drwxrwxr-x   3 root  admin       96 Apr 24 03:22 libR.dylib.dSYM
> -rwxrwxr-x   1 root  admin   201472 Apr 24 03:23 libRblas.dylib
> drwxrwxr-x   3 root  admin       96 Apr 24 03:22 libRblas.dylib.dSYM
> -rwxrwxr-x   1 root  admin  2181472 Apr 24 03:23 libRlapack.dylib
> drwxrwxr-x   3 root  admin       96 Apr 24 03:22 libRlapack.dylib.dSYM
> -rw-rw-r--   1 root  admin   160624 Apr 24 03:23 libgcc_s.1.dylib
> -rwxrwxr-x   1 root  admin  2851008 Apr 24 03:23 libgfortran.5.dylib
> -rwxrwxr-x   1 root  admin   309648 Apr 24 03:23 libquadmath.0.dylib
>
>   which should normally be used during the link step. However, versions in
> /usr/local/lib are being discovered instead, which presumably aren't
> compatible.


Kevin;


Is that the sort of situation that might be cause by mixing
homebrew-compiled and R.Framework-compiled packages?


David.

>
> The simplest fix is (likely) to move those files out of the way. Otherwise,
> you'd likely have to muck around with Makevars / Makeconf to adjust the
> linker flags so the correct versions of these libraries are found.
>
> Best,
> Kevin
>
> On Tue, May 19, 2020 at 6:46 AM Adelchi Azzalini <[hidden email]>
> wrote:
>
>> Hi.
>> In essence, my problem is that I cannot install a package which requires
>> Fortran-77 compilation on my Mac.
>>
>> More in detail, this is my own package 'mnormt' which exists on CRAN since
>> 2006; it is currently at version 1.5-7. It has been developed in successive
>> versions on a Linux machine, where it compiles with no problems. The macOS
>> and MS-windows versions are created on CRAN, where it passes all pertaining
>> checks.
>>
>> Now, in the new pandemic world, I need create a new version of the
>> package, but working from home, hence using my Mac laptop instead of the
>> Linux desktop as in the past. Unfortunately, compilation or loading does
>> not work. If I run
>>
>>   R CMD check mnormt_1.5-7.tar.gz
>>
>> first I get a bunch of warning messages such as
>>
>> Warning: Possible change of value in conversion from REAL(8) to INTEGER(4)
>> ....  [-Wconversion]
>> Warning: ‘lxchng’ may be used uninitialized in this function
>> [-Wmaybe-uninitialized]
>> Warning: Label 10 at (1) defined but not used [-Wunused-label]
>>
>> and finally it crashes with
>>
>> Error: package or namespace load failed for ‘mnormt’:
>>   .onLoad failed in loadNamespace() for 'mnormt', details:
>>    call: dyn.load(file, DLLpath = DLLpath, ...)
>>    error: unable to load shared object
>> '/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so':
>>
>> dlopen(/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so,
>> 6): Symbol not found: ___addtf3
>>    Referenced from: /usr/local/lib/libquadmath.0.dylib
>>    Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
>>   in /usr/local/lib/libquadmath.0.dylib
>> Error: loading failed
>>
>> Needless to say, I have no idea what this "addtf3" is or it should be.
>> There is no such a symbol in the Fortran code.
>>
>> I believe to have installed all ingredients indicated at
>> https://mac.r-project.org/tools/
>> See the list below with details about my system and other installed tools.
>>
>> Any suggestions for sorting this out?
>>
>> Adelchi Azzalini
>>
>>
>> ---------------------------------------------------
>> Installation info:
>>
>> R> R.version
>>                 _
>> platform       x86_64-apple-darwin17.0
>> arch           x86_64
>> os             darwin17.0
>> system         x86_64, darwin17.0
>> status
>> major          4
>> minor          0.0
>> year           2020
>> month          04
>> day            24
>> svn rev        78286
>> language       R
>> version.string R version 4.0.0 (2020-04-24)
>> nickname       Arbor Day
>>
>> --- macOS Mojave 10.14.6
>>
>> --- Xcode version 11.3.1
>>
>> --- Fortran
>>
>> [aa@mac-2013:~] gfortran -v
>> Using built-in specs.
>> COLLECT_GCC=gfortran
>>
>> COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin18/8.2.0/lto-wrapper
>> Target: x86_64-apple-darwin18
>> Configured with: ../gcc-8.2.0/configure --prefix=/usr/local/gfortran
>> --with-gmp=/Users/fx/devel/gcc/build_package/deps
>> --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin18
>> --disable-multilib --with-native-system-header-dir=/usr/include
>> --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
>> Thread model: posix
>> gcc version 8.2.0 (GCC)
>>
>> [aa@mac-2013:~] echo $PATH
>>
>> .:/Users/aa/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin/:/usr/X11R6/bin:/opt/local/bin:/Library/TeX/texbin:/usr/local/gfortran/bin
>>
>> -- other tools indicated at https://mac.r-project.org/tools/
>>     xz-5.2.5/  is installed
>>     PCRE2 10.34 built with --disable-jit
>>     bzip2 Version 1.0.6 is installed
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Mac mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

_______________________________________________
R-SIG-Mac mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Reply | Threaded
Open this post in threaded view
|

Re: [R-SIG-Mac] Cannot compile Fortran on macOS

Ken Beath
In reply to this post by David Winsemius
Plus one of the duties of package managers is to make sure that they build and pass CRAN checks. Doing that with a non standard environment seems a bit risky.

At the moment I can’t get anything to build on R-Devel which is making life difficult and I may raise a question if it still isn’t working when I’ve finished with the new experience that is online teaching.

> On 20 May 2020, at 10:49 am, David Winsemius <[hidden email]> wrote:
>
>
> On 5/19/20 1:46 PM, Yoshihiko Baba via R-SIG-Mac wrote:
>> Adelchi,
>>
>> Why don’t you try Fink version of R?
>>
>> Fink build mnormt on R 4.0 as well (although it is experimental).
>> https://github.com/fink/fink-distributions/issues/623
>
>
> This should be considered contrary to recommended practice: From the
> page for macOS tools that was cited by the OP we see:
>
>
> "Although it is possible to compile R using tools from other package
> managers such as Homebrew, MacPorts or Fink, such binaries are by
> definition incompatible with macOS native libraries and applications. If
> you choose one of those package managers, make sure you
> compile/everything/using those tools including R and all packages and
> libraries you intend to use."
>
>
> I think it should have been offered as advice to only be followed by
> persons with great experience in compiling and building packages on Macs.
>
> Best;
>
> David
>
>>
>> Fink allows you to install different versions of R (3.6, 3.5, 3.4, 3.3, 3.2 and 3.1).
>>
>> For different versions, CRAN packages are separately installed (/sw/lib/R/3.6/site-library  and so on).
>>
>>
>>> 2020/05/19 22:45、Adelchi Azzalini <[hidden email]>のメール:
>>>
>>> Hi.
>>> In essence, my problem is that I cannot install a package which requires Fortran-77 compilation on my Mac.
>>>
>>> More in detail, this is my own package 'mnormt' which exists on CRAN since 2006; it is currently at version 1.5-7. It has been developed in successive versions on a Linux machine, where it compiles with no problems. The macOS and MS-windows versions are created on CRAN, where it passes all pertaining checks.
>>>
>>> Now, in the new pandemic world, I need create a new version of the package, but working from home, hence using my Mac laptop instead of the Linux desktop as in the past. Unfortunately, compilation or loading does not work. If I run
>>>
>>> R CMD check mnormt_1.5-7.tar.gz
>>>
>>> first I get a bunch of warning messages such as
>>>
>>> Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) ....  [-Wconversion]
>>> Warning: ‘lxchng’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>>> Warning: Label 10 at (1) defined but not used [-Wunused-label]
>>>
>>> and finally it crashes with
>>>
>>> Error: package or namespace load failed for ‘mnormt’:
>>> .onLoad failed in loadNamespace() for 'mnormt', details:
>>>  call: dyn.load(file, DLLpath = DLLpath, ...)
>>>  error: unable to load shared object '/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so':
>>>  dlopen(/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so, 6): Symbol not found: ___addtf3
>>>  Referenced from: /usr/local/lib/libquadmath.0.dylib
>>>  Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
>>> in /usr/local/lib/libquadmath.0.dylib
>>> Error: loading failed
>>>
>>> Needless to say, I have no idea what this "addtf3" is or it should be. There is no such a symbol in the Fortran code.
>>>
>>> I believe to have installed all ingredients indicated at https://mac.r-project.org/tools/
>>> See the list below with details about my system and other installed tools.
>>>
>>> Any suggestions for sorting this out?
>>>
>>> Adelchi Azzalini
>>>
>>>
>>> ---------------------------------------------------
>>> Installation info:
>>>
>>> R> R.version
>>>               _
>>> platform       x86_64-apple-darwin17.0
>>> arch           x86_64
>>> os             darwin17.0
>>> system         x86_64, darwin17.0
>>> status
>>> major          4
>>> minor          0.0
>>> year           2020
>>> month          04
>>> day            24
>>> svn rev        78286
>>> language       R
>>> version.string R version 4.0.0 (2020-04-24)
>>> nickname       Arbor Day
>>>
>>> --- macOS Mojave 10.14.6
>>>
>>> --- Xcode version 11.3.1
>>>
>>> --- Fortran
>>>
>>> [aa@mac-2013:~] gfortran -v
>>> Using built-in specs.
>>> COLLECT_GCC=gfortran
>>> COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin18/8.2.0/lto-wrapper
>>> Target: x86_64-apple-darwin18
>>> Configured with: ../gcc-8.2.0/configure --prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/build_package/deps --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin18 --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
>>> Thread model: posix
>>> gcc version 8.2.0 (GCC)
>>>
>>> [aa@mac-2013:~] echo $PATH
>>> .:/Users/aa/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin/:/usr/X11R6/bin:/opt/local/bin:/Library/TeX/texbin:/usr/local/gfortran/bin
>>>
>>> -- other tools indicated at https://mac.r-project.org/tools/
>>>   xz-5.2.5/  is installed
>>>   PCRE2 10.34 built with --disable-jit
>>>   bzip2 Version 1.0.6 is installed
>>>
>>> _______________________________________________
>>> R-SIG-Mac mailing list
>>> [hidden email]
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>> _______________________________________________
>> R-SIG-Mac mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Mac mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>

_______________________________________________
R-SIG-Mac mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Reply | Threaded
Open this post in threaded view
|

Re: [R-SIG-Mac] Cannot compile Fortran on macOS

Simon Urbanek
Ken,

R can be built with just Xcode and GFortran (see also http://mac.r-project.org/tools/ ). If you have issues, those are very often due to conflicting package managers (Homebrew, macoports, fink ...) so a good exercise is to simply re-name /usr/local/ and setup a clean environment as above which is known to work. If you use CRAN R builds (either release or from http://mac.r-project.org/ ) then most packages will compile with just Xcode alone.

Cheers,
Simon


> On 20/05/2020, at 12:58 PM, Ken Beath <[hidden email]> wrote:
>
> Plus one of the duties of package managers is to make sure that they build and pass CRAN checks. Doing that with a non standard environment seems a bit risky.
>
> At the moment I can’t get anything to build on R-Devel which is making life difficult and I may raise a question if it still isn’t working when I’ve finished with the new experience that is online teaching.
>
>> On 20 May 2020, at 10:49 am, David Winsemius <[hidden email]> wrote:
>>
>>
>> On 5/19/20 1:46 PM, Yoshihiko Baba via R-SIG-Mac wrote:
>>> Adelchi,
>>>
>>> Why don’t you try Fink version of R?
>>>
>>> Fink build mnormt on R 4.0 as well (although it is experimental).
>>> https://github.com/fink/fink-distributions/issues/623
>>
>>
>> This should be considered contrary to recommended practice: From the
>> page for macOS tools that was cited by the OP we see:
>>
>>
>> "Although it is possible to compile R using tools from other package
>> managers such as Homebrew, MacPorts or Fink, such binaries are by
>> definition incompatible with macOS native libraries and applications. If
>> you choose one of those package managers, make sure you
>> compile/everything/using those tools including R and all packages and
>> libraries you intend to use."
>>
>>
>> I think it should have been offered as advice to only be followed by
>> persons with great experience in compiling and building packages on Macs.
>>
>> Best;
>>
>> David
>>
>>>
>>> Fink allows you to install different versions of R (3.6, 3.5, 3.4, 3.3, 3.2 and 3.1).
>>>
>>> For different versions, CRAN packages are separately installed (/sw/lib/R/3.6/site-library  and so on).
>>>
>>>
>>>> 2020/05/19 22:45、Adelchi Azzalini <[hidden email]>のメール:
>>>>
>>>> Hi.
>>>> In essence, my problem is that I cannot install a package which requires Fortran-77 compilation on my Mac.
>>>>
>>>> More in detail, this is my own package 'mnormt' which exists on CRAN since 2006; it is currently at version 1.5-7. It has been developed in successive versions on a Linux machine, where it compiles with no problems. The macOS and MS-windows versions are created on CRAN, where it passes all pertaining checks.
>>>>
>>>> Now, in the new pandemic world, I need create a new version of the package, but working from home, hence using my Mac laptop instead of the Linux desktop as in the past. Unfortunately, compilation or loading does not work. If I run
>>>>
>>>> R CMD check mnormt_1.5-7.tar.gz
>>>>
>>>> first I get a bunch of warning messages such as
>>>>
>>>> Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) ....  [-Wconversion]
>>>> Warning: ‘lxchng’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>>>> Warning: Label 10 at (1) defined but not used [-Wunused-label]
>>>>
>>>> and finally it crashes with
>>>>
>>>> Error: package or namespace load failed for ‘mnormt’:
>>>> .onLoad failed in loadNamespace() for 'mnormt', details:
>>>> call: dyn.load(file, DLLpath = DLLpath, ...)
>>>> error: unable to load shared object '/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so':
>>>> dlopen(/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so, 6): Symbol not found: ___addtf3
>>>> Referenced from: /usr/local/lib/libquadmath.0.dylib
>>>> Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
>>>> in /usr/local/lib/libquadmath.0.dylib
>>>> Error: loading failed
>>>>
>>>> Needless to say, I have no idea what this "addtf3" is or it should be. There is no such a symbol in the Fortran code.
>>>>
>>>> I believe to have installed all ingredients indicated at https://mac.r-project.org/tools/
>>>> See the list below with details about my system and other installed tools.
>>>>
>>>> Any suggestions for sorting this out?
>>>>
>>>> Adelchi Azzalini
>>>>
>>>>
>>>> ---------------------------------------------------
>>>> Installation info:
>>>>
>>>> R> R.version
>>>>              _
>>>> platform       x86_64-apple-darwin17.0
>>>> arch           x86_64
>>>> os             darwin17.0
>>>> system         x86_64, darwin17.0
>>>> status
>>>> major          4
>>>> minor          0.0
>>>> year           2020
>>>> month          04
>>>> day            24
>>>> svn rev        78286
>>>> language       R
>>>> version.string R version 4.0.0 (2020-04-24)
>>>> nickname       Arbor Day
>>>>
>>>> --- macOS Mojave 10.14.6
>>>>
>>>> --- Xcode version 11.3.1
>>>>
>>>> --- Fortran
>>>>
>>>> [aa@mac-2013:~] gfortran -v
>>>> Using built-in specs.
>>>> COLLECT_GCC=gfortran
>>>> COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin18/8.2.0/lto-wrapper
>>>> Target: x86_64-apple-darwin18
>>>> Configured with: ../gcc-8.2.0/configure --prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/build_package/deps --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin18 --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
>>>> Thread model: posix
>>>> gcc version 8.2.0 (GCC)
>>>>
>>>> [aa@mac-2013:~] echo $PATH
>>>> .:/Users/aa/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin/:/usr/X11R6/bin:/opt/local/bin:/Library/TeX/texbin:/usr/local/gfortran/bin
>>>>
>>>> -- other tools indicated at https://mac.r-project.org/tools/
>>>>  xz-5.2.5/  is installed
>>>>  PCRE2 10.34 built with --disable-jit
>>>>  bzip2 Version 1.0.6 is installed
>>>>
>>>> _______________________________________________
>>>> R-SIG-Mac mailing list
>>>> [hidden email]
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>> _______________________________________________
>>> R-SIG-Mac mailing list
>>> [hidden email]
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>
>
> _______________________________________________
> R-SIG-Mac mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

_______________________________________________
R-SIG-Mac mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Reply | Threaded
Open this post in threaded view
|

Re: [R-SIG-Mac] Cannot compile Fortran on macOS

Simon Urbanek
In reply to this post by Adelchi Azzalini

Adelchi,

as pointed out you have conflicting libraries in /usr/local - likely from some conflicting package manager. I would recommend re-naming /usr/local to remove the issue and installing a clean GNU Fortran (see http://mac.r-project.org/tools/ or from the official GNU Fortran pages which use the same binary), that's all you really need.

Cheers,
Simon



> On 20/05/2020, at 1:45 AM, Adelchi Azzalini <[hidden email]> wrote:
>
> Hi.
> In essence, my problem is that I cannot install a package which requires Fortran-77 compilation on my Mac.
>
> More in detail, this is my own package 'mnormt' which exists on CRAN since 2006; it is currently at version 1.5-7. It has been developed in successive versions on a Linux machine, where it compiles with no problems. The macOS and MS-windows versions are created on CRAN, where it passes all pertaining checks.
>
> Now, in the new pandemic world, I need create a new version of the package, but working from home, hence using my Mac laptop instead of the Linux desktop as in the past. Unfortunately, compilation or loading does not work. If I run
>
> R CMD check mnormt_1.5-7.tar.gz
>
> first I get a bunch of warning messages such as
>
> Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) ....  [-Wconversion]
> Warning: ‘lxchng’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> Warning: Label 10 at (1) defined but not used [-Wunused-label]
>
> and finally it crashes with
>
> Error: package or namespace load failed for ‘mnormt’:
> .onLoad failed in loadNamespace() for 'mnormt', details:
>  call: dyn.load(file, DLLpath = DLLpath, ...)
>  error: unable to load shared object '/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so':
>  dlopen(/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so, 6): Symbol not found: ___addtf3
>  Referenced from: /usr/local/lib/libquadmath.0.dylib
>  Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
> in /usr/local/lib/libquadmath.0.dylib
> Error: loading failed
>
> Needless to say, I have no idea what this "addtf3" is or it should be. There is no such a symbol in the Fortran code.
>
> I believe to have installed all ingredients indicated at https://mac.r-project.org/tools/
> See the list below with details about my system and other installed tools.
>
> Any suggestions for sorting this out?
>
> Adelchi Azzalini
>
>
> ---------------------------------------------------
> Installation info:
>
> R> R.version
>               _                          
> platform       x86_64-apple-darwin17.0    
> arch           x86_64                      
> os             darwin17.0                  
> system         x86_64, darwin17.0          
> status                                    
> major          4                          
> minor          0.0                        
> year           2020                        
> month          04                          
> day            24                          
> svn rev        78286                      
> language       R                          
> version.string R version 4.0.0 (2020-04-24)
> nickname       Arbor Day                  
>
> --- macOS Mojave 10.14.6
>
> --- Xcode version 11.3.1
>
> --- Fortran
>
> [aa@mac-2013:~] gfortran -v
> Using built-in specs.
> COLLECT_GCC=gfortran
> COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin18/8.2.0/lto-wrapper
> Target: x86_64-apple-darwin18
> Configured with: ../gcc-8.2.0/configure --prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/build_package/deps --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin18 --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
> Thread model: posix
> gcc version 8.2.0 (GCC)
>
> [aa@mac-2013:~] echo $PATH
> .:/Users/aa/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin/:/usr/X11R6/bin:/opt/local/bin:/Library/TeX/texbin:/usr/local/gfortran/bin
>
> -- other tools indicated at https://mac.r-project.org/tools/
>   xz-5.2.5/  is installed
>   PCRE2 10.34 built with --disable-jit
>   bzip2 Version 1.0.6 is installed
>
> _______________________________________________
> R-SIG-Mac mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

_______________________________________________
R-SIG-Mac mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Reply | Threaded
Open this post in threaded view
|

Re: [R-SIG-Mac] Cannot compile Fortran on macOS

Ken Beath
In reply to this post by Simon Urbanek
Simon,

I’m going to investigate further, but the problem is that 4.0 works fine but 4.1 doesn’t. I will check what is going wrong.

Ken

> On 20 May 2020, at 1:47 pm, Simon Urbanek <[hidden email]> wrote:
>
> Ken,
>
> R can be built with just Xcode and GFortran (see also http://mac.r-project.org/tools/ ). If you have issues, those are very often due to conflicting package managers (Homebrew, macoports, fink ...) so a good exercise is to simply re-name /usr/local/ and setup a clean environment as above which is known to work. If you use CRAN R builds (either release or from http://mac.r-project.org/ ) then most packages will compile with just Xcode alone.
>
> Cheers,
> Simon
>
>
>> On 20/05/2020, at 12:58 PM, Ken Beath <[hidden email]> wrote:
>>
>> Plus one of the duties of package managers is to make sure that they build and pass CRAN checks. Doing that with a non standard environment seems a bit risky.
>>
>> At the moment I can’t get anything to build on R-Devel which is making life difficult and I may raise a question if it still isn’t working when I’ve finished with the new experience that is online teaching.
>>
>>> On 20 May 2020, at 10:49 am, David Winsemius <[hidden email]> wrote:
>>>
>>>
>>> On 5/19/20 1:46 PM, Yoshihiko Baba via R-SIG-Mac wrote:
>>>> Adelchi,
>>>>
>>>> Why don’t you try Fink version of R?
>>>>
>>>> Fink build mnormt on R 4.0 as well (although it is experimental).
>>>> https://github.com/fink/fink-distributions/issues/623
>>>
>>>
>>> This should be considered contrary to recommended practice: From the
>>> page for macOS tools that was cited by the OP we see:
>>>
>>>
>>> "Although it is possible to compile R using tools from other package
>>> managers such as Homebrew, MacPorts or Fink, such binaries are by
>>> definition incompatible with macOS native libraries and applications. If
>>> you choose one of those package managers, make sure you
>>> compile/everything/using those tools including R and all packages and
>>> libraries you intend to use."
>>>
>>>
>>> I think it should have been offered as advice to only be followed by
>>> persons with great experience in compiling and building packages on Macs.
>>>
>>> Best;
>>>
>>> David
>>>
>>>>
>>>> Fink allows you to install different versions of R (3.6, 3.5, 3.4, 3.3, 3.2 and 3.1).
>>>>
>>>> For different versions, CRAN packages are separately installed (/sw/lib/R/3.6/site-library  and so on).
>>>>
>>>>
>>>>> 2020/05/19 22:45、Adelchi Azzalini <[hidden email]>のメール:
>>>>>
>>>>> Hi.
>>>>> In essence, my problem is that I cannot install a package which requires Fortran-77 compilation on my Mac.
>>>>>
>>>>> More in detail, this is my own package 'mnormt' which exists on CRAN since 2006; it is currently at version 1.5-7. It has been developed in successive versions on a Linux machine, where it compiles with no problems. The macOS and MS-windows versions are created on CRAN, where it passes all pertaining checks.
>>>>>
>>>>> Now, in the new pandemic world, I need create a new version of the package, but working from home, hence using my Mac laptop instead of the Linux desktop as in the past. Unfortunately, compilation or loading does not work. If I run
>>>>>
>>>>> R CMD check mnormt_1.5-7.tar.gz
>>>>>
>>>>> first I get a bunch of warning messages such as
>>>>>
>>>>> Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) ....  [-Wconversion]
>>>>> Warning: ‘lxchng’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>>>>> Warning: Label 10 at (1) defined but not used [-Wunused-label]
>>>>>
>>>>> and finally it crashes with
>>>>>
>>>>> Error: package or namespace load failed for ‘mnormt’:
>>>>> .onLoad failed in loadNamespace() for 'mnormt', details:
>>>>> call: dyn.load(file, DLLpath = DLLpath, ...)
>>>>> error: unable to load shared object '/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so':
>>>>> dlopen(/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so, 6): Symbol not found: ___addtf3
>>>>> Referenced from: /usr/local/lib/libquadmath.0.dylib
>>>>> Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
>>>>> in /usr/local/lib/libquadmath.0.dylib
>>>>> Error: loading failed
>>>>>
>>>>> Needless to say, I have no idea what this "addtf3" is or it should be. There is no such a symbol in the Fortran code.
>>>>>
>>>>> I believe to have installed all ingredients indicated at https://mac.r-project.org/tools/
>>>>> See the list below with details about my system and other installed tools.
>>>>>
>>>>> Any suggestions for sorting this out?
>>>>>
>>>>> Adelchi Azzalini
>>>>>
>>>>>
>>>>> ---------------------------------------------------
>>>>> Installation info:
>>>>>
>>>>> R> R.version
>>>>>             _
>>>>> platform       x86_64-apple-darwin17.0
>>>>> arch           x86_64
>>>>> os             darwin17.0
>>>>> system         x86_64, darwin17.0
>>>>> status
>>>>> major          4
>>>>> minor          0.0
>>>>> year           2020
>>>>> month          04
>>>>> day            24
>>>>> svn rev        78286
>>>>> language       R
>>>>> version.string R version 4.0.0 (2020-04-24)
>>>>> nickname       Arbor Day
>>>>>
>>>>> --- macOS Mojave 10.14.6
>>>>>
>>>>> --- Xcode version 11.3.1
>>>>>
>>>>> --- Fortran
>>>>>
>>>>> [aa@mac-2013:~] gfortran -v
>>>>> Using built-in specs.
>>>>> COLLECT_GCC=gfortran
>>>>> COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin18/8.2.0/lto-wrapper
>>>>> Target: x86_64-apple-darwin18
>>>>> Configured with: ../gcc-8.2.0/configure --prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/build_package/deps --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin18 --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
>>>>> Thread model: posix
>>>>> gcc version 8.2.0 (GCC)
>>>>>
>>>>> [aa@mac-2013:~] echo $PATH
>>>>> .:/Users/aa/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin/:/usr/X11R6/bin:/opt/local/bin:/Library/TeX/texbin:/usr/local/gfortran/bin
>>>>>
>>>>> -- other tools indicated at https://mac.r-project.org/tools/
>>>>> xz-5.2.5/  is installed
>>>>> PCRE2 10.34 built with --disable-jit
>>>>> bzip2 Version 1.0.6 is installed
>>>>>
>>>>> _______________________________________________
>>>>> R-SIG-Mac mailing list
>>>>> [hidden email]
>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>>> _______________________________________________
>>>> R-SIG-Mac mailing list
>>>> [hidden email]
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>>
>>> [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-SIG-Mac mailing list
>>> [hidden email]
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>>
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
>

_______________________________________________
R-SIG-Mac mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Reply | Threaded
Open this post in threaded view
|

Re: [R-SIG-Mac] Cannot compile Fortran on macOS

Adelchi Azzalini
In reply to this post by Simon Urbanek
Thanks to everyone that provided suggestions.

I was about to follow the recommended step of renaming /usr/local and reinstall a bunch of programs.
However, that renaming is blocked, presumably by Apple System Integrity Protection.
Is there any alternative to disabling this Apple "feature"?
Do you recommend to re-instate it after the re-construction of /usr/local/ ?
As you see, I am not familiar with Apple tricks.

Thanks again,

Adelchi
 


> On 20 May 2020, at 05:50, Simon Urbanek <[hidden email]> wrote:
>
>
> Adelchi,
>
> as pointed out you have conflicting libraries in /usr/local - likely from some conflicting package manager. I would recommend re-naming /usr/local to remove the issue and installing a clean GNU Fortran (see http://mac.r-project.org/tools/ or from the official GNU Fortran pages which use the same binary), that's all you really need.
>
> Cheers,
> Simon
>
>
>
>> On 20/05/2020, at 1:45 AM, Adelchi Azzalini <[hidden email]> wrote:
>>
>> Hi.
>> In essence, my problem is that I cannot install a package which requires Fortran-77 compilation on my Mac.
>>
>> More in detail, this is my own package 'mnormt' which exists on CRAN since 2006; it is currently at version 1.5-7. It has been developed in successive versions on a Linux machine, where it compiles with no problems. The macOS and MS-windows versions are created on CRAN, where it passes all pertaining checks.
>>
>> Now, in the new pandemic world, I need create a new version of the package, but working from home, hence using my Mac laptop instead of the Linux desktop as in the past. Unfortunately, compilation or loading does not work. If I run
>>
>> R CMD check mnormt_1.5-7.tar.gz
>>
>> first I get a bunch of warning messages such as
>>
>> Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) ....  [-Wconversion]
>> Warning: ‘lxchng’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>> Warning: Label 10 at (1) defined but not used [-Wunused-label]
>>
>> and finally it crashes with
>>
>> Error: package or namespace load failed for ‘mnormt’:
>> .onLoad failed in loadNamespace() for 'mnormt', details:
>> call: dyn.load(file, DLLpath = DLLpath, ...)
>> error: unable to load shared object '/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so':
>> dlopen(/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so, 6): Symbol not found: ___addtf3
>> Referenced from: /usr/local/lib/libquadmath.0.dylib
>> Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
>> in /usr/local/lib/libquadmath.0.dylib
>> Error: loading failed
>>
>> Needless to say, I have no idea what this "addtf3" is or it should be. There is no such a symbol in the Fortran code.
>>
>> I believe to have installed all ingredients indicated at https://mac.r-project.org/tools/
>> See the list below with details about my system and other installed tools.
>>
>> Any suggestions for sorting this out?
>>
>> Adelchi Azzalini
>>
>>
>> ---------------------------------------------------
>> Installation info:
>>
>> R> R.version
>>              _                          
>> platform       x86_64-apple-darwin17.0    
>> arch           x86_64                      
>> os             darwin17.0                  
>> system         x86_64, darwin17.0          
>> status                                    
>> major          4                          
>> minor          0.0                        
>> year           2020                        
>> month          04                          
>> day            24                          
>> svn rev        78286                      
>> language       R                          
>> version.string R version 4.0.0 (2020-04-24)
>> nickname       Arbor Day                  
>>
>> --- macOS Mojave 10.14.6
>>
>> --- Xcode version 11.3.1
>>
>> --- Fortran
>>
>> [aa@mac-2013:~] gfortran -v
>> Using built-in specs.
>> COLLECT_GCC=gfortran
>> COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin18/8.2.0/lto-wrapper
>> Target: x86_64-apple-darwin18
>> Configured with: ../gcc-8.2.0/configure --prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/build_package/deps --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin18 --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
>> Thread model: posix
>> gcc version 8.2.0 (GCC)
>>
>> [aa@mac-2013:~] echo $PATH
>> .:/Users/aa/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin/:/usr/X11R6/bin:/opt/local/bin:/Library/TeX/texbin:/usr/local/gfortran/bin
>>
>> -- other tools indicated at https://mac.r-project.org/tools/
>>  xz-5.2.5/  is installed
>>  PCRE2 10.34 built with --disable-jit
>>  bzip2 Version 1.0.6 is installed
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>

_______________________________________________
R-SIG-Mac mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Reply | Threaded
Open this post in threaded view
|

Re: [R-SIG-Mac] Cannot compile Fortran on macOS

Adelchi Azzalini


> On 20 May 2020, at 08:44, Adelchi Azzalini <[hidden email]> wrote:
>
> Thanks to everyone that provided suggestions.
>
> I was about to follow the recommended step of renaming /usr/local and reinstall a bunch of programs.
> However, that renaming is blocked, presumably by Apple System Integrity Protection.
> Is there any alternative to disabling this Apple "feature"?
> Do you recommend to re-instate it after the re-construction of /usr/local/ ?
> As you see, I am not familiar with Apple tricks.
>
> Thanks again,
>
> Adelchi


Please ignore the message above.
Right after sending it, I realized that the simple workaround was to move everything in
  /usr/local/
to
  /usr/local/local-2020520/

After reinstalling R, TeX, etc... compilation now works fine!

Thanks for your effective help.

Adelchi


>
>
>
>> On 20 May 2020, at 05:50, Simon Urbanek <[hidden email]> wrote:
>>
>>
>> Adelchi,
>>
>> as pointed out you have conflicting libraries in /usr/local - likely from some conflicting package manager. I would recommend re-naming /usr/local to remove the issue and installing a clean GNU Fortran (see http://mac.r-project.org/tools/ or from the official GNU Fortran pages which use the same binary), that's all you really need.
>>
>> Cheers,
>> Simon
>>
>>
>>
>>> On 20/05/2020, at 1:45 AM, Adelchi Azzalini <[hidden email]> wrote:
>>>
>>> Hi.
>>> In essence, my problem is that I cannot install a package which requires Fortran-77 compilation on my Mac.
>>>
>>> More in detail, this is my own package 'mnormt' which exists on CRAN since 2006; it is currently at version 1.5-7. It has been developed in successive versions on a Linux machine, where it compiles with no problems. The macOS and MS-windows versions are created on CRAN, where it passes all pertaining checks.
>>>
>>> Now, in the new pandemic world, I need create a new version of the package, but working from home, hence using my Mac laptop instead of the Linux desktop as in the past. Unfortunately, compilation or loading does not work. If I run
>>>
>>> R CMD check mnormt_1.5-7.tar.gz
>>>
>>> first I get a bunch of warning messages such as
>>>
>>> Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) ....  [-Wconversion]
>>> Warning: ‘lxchng’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>>> Warning: Label 10 at (1) defined but not used [-Wunused-label]
>>>
>>> and finally it crashes with
>>>
>>> Error: package or namespace load failed for ‘mnormt’:
>>> .onLoad failed in loadNamespace() for 'mnormt', details:
>>> call: dyn.load(file, DLLpath = DLLpath, ...)
>>> error: unable to load shared object '/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so':
>>> dlopen(/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so, 6): Symbol not found: ___addtf3
>>> Referenced from: /usr/local/lib/libquadmath.0.dylib
>>> Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
>>> in /usr/local/lib/libquadmath.0.dylib
>>> Error: loading failed
>>>
>>> Needless to say, I have no idea what this "addtf3" is or it should be. There is no such a symbol in the Fortran code.
>>>
>>> I believe to have installed all ingredients indicated at https://mac.r-project.org/tools/
>>> See the list below with details about my system and other installed tools.
>>>
>>> Any suggestions for sorting this out?
>>>
>>> Adelchi Azzalini
>>>
>>>
>>> ---------------------------------------------------
>>> Installation info:
>>>
>>> R> R.version
>>>             _                          
>>> platform       x86_64-apple-darwin17.0    
>>> arch           x86_64                      
>>> os             darwin17.0                  
>>> system         x86_64, darwin17.0          
>>> status                                    
>>> major          4                          
>>> minor          0.0                        
>>> year           2020                        
>>> month          04                          
>>> day            24                          
>>> svn rev        78286                      
>>> language       R                          
>>> version.string R version 4.0.0 (2020-04-24)
>>> nickname       Arbor Day                  
>>>
>>> --- macOS Mojave 10.14.6
>>>
>>> --- Xcode version 11.3.1
>>>
>>> --- Fortran
>>>
>>> [aa@mac-2013:~] gfortran -v
>>> Using built-in specs.
>>> COLLECT_GCC=gfortran
>>> COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin18/8.2.0/lto-wrapper
>>> Target: x86_64-apple-darwin18
>>> Configured with: ../gcc-8.2.0/configure --prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/build_package/deps --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin18 --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
>>> Thread model: posix
>>> gcc version 8.2.0 (GCC)
>>>
>>> [aa@mac-2013:~] echo $PATH
>>> .:/Users/aa/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin/:/usr/X11R6/bin:/opt/local/bin:/Library/TeX/texbin:/usr/local/gfortran/bin
>>>
>>> -- other tools indicated at https://mac.r-project.org/tools/
>>> xz-5.2.5/  is installed
>>> PCRE2 10.34 built with --disable-jit
>>> bzip2 Version 1.0.6 is installed
>>>
>>> _______________________________________________
>>> R-SIG-Mac mailing list
>>> [hidden email]
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>
>
> _______________________________________________
> R-SIG-Mac mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

_______________________________________________
R-SIG-Mac mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac
Reply | Threaded
Open this post in threaded view
|

Re: [R-SIG-Mac] Cannot compile Fortran on macOS

Ken Beath
Success. I also removed everything from /usr/local then reinstalled MacTex, R and gfortran, and now I can build on both 4.0 and 4.1. Presumably something has changed in the builds between 4.0 and 4.1 and that has interacted with the accumulated nearly 6 years of mess in /usr/local.

> On 20 May 2020, at 5:34 pm, Adelchi Azzalini <[hidden email]> wrote:
>
>
>
>> On 20 May 2020, at 08:44, Adelchi Azzalini <[hidden email]> wrote:
>>
>> Thanks to everyone that provided suggestions.
>>
>> I was about to follow the recommended step of renaming /usr/local and reinstall a bunch of programs.
>> However, that renaming is blocked, presumably by Apple System Integrity Protection.
>> Is there any alternative to disabling this Apple "feature"?
>> Do you recommend to re-instate it after the re-construction of /usr/local/ ?
>> As you see, I am not familiar with Apple tricks.
>>
>> Thanks again,
>>
>> Adelchi
>
>
> Please ignore the message above.
> Right after sending it, I realized that the simple workaround was to move everything in
>  /usr/local/
> to
>  /usr/local/local-2020520/
>
> After reinstalling R, TeX, etc... compilation now works fine!
>
> Thanks for your effective help.
>
> Adelchi
>
>
>>
>>
>>
>>> On 20 May 2020, at 05:50, Simon Urbanek <[hidden email]> wrote:
>>>
>>>
>>> Adelchi,
>>>
>>> as pointed out you have conflicting libraries in /usr/local - likely from some conflicting package manager. I would recommend re-naming /usr/local to remove the issue and installing a clean GNU Fortran (see http://mac.r-project.org/tools/ or from the official GNU Fortran pages which use the same binary), that's all you really need.
>>>
>>> Cheers,
>>> Simon
>>>
>>>
>>>
>>>> On 20/05/2020, at 1:45 AM, Adelchi Azzalini <[hidden email]> wrote:
>>>>
>>>> Hi.
>>>> In essence, my problem is that I cannot install a package which requires Fortran-77 compilation on my Mac.
>>>>
>>>> More in detail, this is my own package 'mnormt' which exists on CRAN since 2006; it is currently at version 1.5-7. It has been developed in successive versions on a Linux machine, where it compiles with no problems. The macOS and MS-windows versions are created on CRAN, where it passes all pertaining checks.
>>>>
>>>> Now, in the new pandemic world, I need create a new version of the package, but working from home, hence using my Mac laptop instead of the Linux desktop as in the past. Unfortunately, compilation or loading does not work. If I run
>>>>
>>>> R CMD check mnormt_1.5-7.tar.gz
>>>>
>>>> first I get a bunch of warning messages such as
>>>>
>>>> Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) ....  [-Wconversion]
>>>> Warning: ‘lxchng’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>>>> Warning: Label 10 at (1) defined but not used [-Wunused-label]
>>>>
>>>> and finally it crashes with
>>>>
>>>> Error: package or namespace load failed for ‘mnormt’:
>>>> .onLoad failed in loadNamespace() for 'mnormt', details:
>>>> call: dyn.load(file, DLLpath = DLLpath, ...)
>>>> error: unable to load shared object '/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so':
>>>> dlopen(/Users/aa/SW-aa/Pkg-mnormt/mnormt.Rcheck/00LOCK-mnormt/00new/mnormt/libs/mnormt.so, 6): Symbol not found: ___addtf3
>>>> Referenced from: /usr/local/lib/libquadmath.0.dylib
>>>> Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
>>>> in /usr/local/lib/libquadmath.0.dylib
>>>> Error: loading failed
>>>>
>>>> Needless to say, I have no idea what this "addtf3" is or it should be. There is no such a symbol in the Fortran code.
>>>>
>>>> I believe to have installed all ingredients indicated at https://mac.r-project.org/tools/
>>>> See the list below with details about my system and other installed tools.
>>>>
>>>> Any suggestions for sorting this out?
>>>>
>>>> Adelchi Azzalini
>>>>
>>>>
>>>> ---------------------------------------------------
>>>> Installation info:
>>>>
>>>> R> R.version
>>>>            _                          
>>>> platform       x86_64-apple-darwin17.0    
>>>> arch           x86_64                      
>>>> os             darwin17.0                  
>>>> system         x86_64, darwin17.0          
>>>> status                                    
>>>> major          4                          
>>>> minor          0.0                        
>>>> year           2020                        
>>>> month          04                          
>>>> day            24                          
>>>> svn rev        78286                      
>>>> language       R                          
>>>> version.string R version 4.0.0 (2020-04-24)
>>>> nickname       Arbor Day                  
>>>>
>>>> --- macOS Mojave 10.14.6
>>>>
>>>> --- Xcode version 11.3.1
>>>>
>>>> --- Fortran
>>>>
>>>> [aa@mac-2013:~] gfortran -v
>>>> Using built-in specs.
>>>> COLLECT_GCC=gfortran
>>>> COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin18/8.2.0/lto-wrapper
>>>> Target: x86_64-apple-darwin18
>>>> Configured with: ../gcc-8.2.0/configure --prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/build_package/deps --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin18 --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
>>>> Thread model: posix
>>>> gcc version 8.2.0 (GCC)
>>>>
>>>> [aa@mac-2013:~] echo $PATH
>>>> .:/Users/aa/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin/:/usr/X11R6/bin:/opt/local/bin:/Library/TeX/texbin:/usr/local/gfortran/bin
>>>>
>>>> -- other tools indicated at https://mac.r-project.org/tools/
>>>> xz-5.2.5/  is installed
>>>> PCRE2 10.34 built with --disable-jit
>>>> bzip2 Version 1.0.6 is installed
>>>>
>>>> _______________________________________________
>>>> R-SIG-Mac mailing list
>>>> [hidden email]
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>>
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
> _______________________________________________
> R-SIG-Mac mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>

_______________________________________________
R-SIG-Mac mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac