Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building from source on macOS instructions outdated #62

Open
jhollway opened this issue May 9, 2022 · 4 comments
Open

Building from source on macOS instructions outdated #62

jhollway opened this issue May 9, 2022 · 4 comments
Assignees

Comments

@jhollway
Copy link
Collaborator

jhollway commented May 9, 2022

Describe the bug
The collection of instructions at the bottom of the README refer to older versions and do not seem to work anymore.

Expected behavior
Contemporary resources include:

Desktop (please complete the following information):

  • OS: macOS Monterey 12.2.1
  • R Version 4.2.0
  • RStudio Version 2022.02.2
  • Goldfish Version 1.5.2 (@develop)
@jhollway
Copy link
Collaborator Author

jhollway commented May 9, 2022

May relate to #57

@auzaheta
Copy link
Collaborator

auzaheta commented Sep 3, 2024

@jhollway, there is an updated version of the instructions for M* machines. Can you test if it is working?

Should we replace some of the current links in the documentation with the ones you suggest?

Here are the links we have in the README:

@jhollway
Copy link
Collaborator Author

jhollway commented Sep 4, 2024

It is working (after a restart), but not OpenMP.

I have a relatively new system. I followed the instructions, installing first homebrew, then gcc, and then updated Makevars and Makeconf with the M* related details (updating to g++-14, because that was the version homebrew downloaded.

Some suggestions:

  • We should tell new homebrew users that they will need to follow the instructions to make sure that homebrew commands are discoverable. This is declared in the next steps (below) but may be overlooked:
==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
    (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/hollway/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh
  • We should suggest people use usethis::edit_r_makevars() to (create,) open and edit their Makevars file. Unfortunately there is nothing similar for Makeconf, but perhaps I could add something like that to {manypkgs}?
  • It might be a good idea to have a table of contents that link to explicit instructions for each OS/processor. I fear some may read the "Mac OSX" section without realising there is a M1, M2, etc section below it with the correct instructions.
  • It only worked for me upon restarting R, but it still doesn't use OpenMP. This is the same outcome as before I used homebrew (since macOS includes C++ compilers, just not OpenMP).

Awaiting further instructions ;)

@jhollway
Copy link
Collaborator Author

jhollway commented Sep 4, 2024

Full output here:

==> Rcpp::compileAttributes()

* Updated R/RcppExports.R

==> R CMD INSTALL --preclean --no-multiarch --with-keep.source goldfish

* installing to library ‘/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library’
* installing *source* package ‘goldfish’ ...
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether /opt/homebrew/opt/gcc/bin/g++-14 accepts -g... yes
checking how to run the C++ preprocessor... /opt/homebrew/opt/gcc/bin/g++-14 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether /opt/homebrew/opt/gcc/bin/g++-14 accepts -g... (cached) yes
checking for macOS... found
configure: creating ./config.status
configure: WARNING: OpenMP unavailable and turned off.
config.status: creating src/Makevars

 --------------------------------------------------
  Configuration for goldfish version 
  ================

    openMP: -DARMA_DONT_USE_OPENMP
    cxxflags: -falign-functions=64 -Wall -g -O2
    libs:     

  --------------------------------------------------

** libs
using C++ compiler: ‘g++-14 (Homebrew GCC 14.2.0) 14.2.0’
using SDK: ‘MacOSX14.4.sdk’
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c DyNAM_MM_default.cpp -o DyNAM_MM_default.o
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c DyNAM_choice_default.cpp -o DyNAM_choice_default.o
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c DyNAM_rate_default.cpp -o DyNAM_rate_default.o
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c DyNAM_rate_ordered_default.cpp -o DyNAM_rate_ordered_default.o
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c REM_default.cpp -o REM_default.o
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c REM_ordered_default.cpp -o REM_ordered_default.o
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c RcppExports.cpp -o RcppExports.o
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c compute_coordination_selection.cpp -o compute_coordination_selection.o
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c compute_multinomial_selection.cpp -o compute_multinomial_selection.o
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c compute_poisson_selection.cpp -o compute_poisson_selection.o
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c convert_rdata_to_cdata.cpp -o convert_rdata_to_cdata.o
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c gather_progress.cpp -o gather_progress.o
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c gather_receiver_model.cpp -o gather_receiver_model.o
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c gather_sender_model.cpp -o gather_sender_model.o
/opt/homebrew/opt/gcc/bin/g++-14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppArmadillo/include' -isystem "/opt/homebrew/opt/gcc/include" -isysroot "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"   -DARMA_DONT_USE_OPENMP -fPIC  -falign-functions=64 -Wall -g -O2   -c gather_sender_receiver_model.cpp -o gather_sender_receiver_model.o
/opt/homebrew/opt/gcc/bin/g++-14 -dynamiclib -Wl,-ld_classic,-headerpad_max_install_names -undefined dynamic_lookup -falign-functions=64 -Wall -g -O2 -fPIC -L/Library/Frameworks/R.framework/Resources/lib -L/opt/homebrew/opt/gcc/lib -L/opt/homebrew/opt/gettext/lib --sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o goldfish.so DyNAM_MM_default.o DyNAM_choice_default.o DyNAM_rate_default.o DyNAM_rate_ordered_default.o REM_default.o REM_ordered_default.o RcppExports.o compute_coordination_selection.o compute_multinomial_selection.o compute_poisson_selection.o convert_rdata_to_cdata.o gather_progress.o gather_receiver_model.o gather_sender_model.o gather_sender_receiver_model.o -DARMA_DONT_USE_OPENMP -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L//opt/homebrew/opt/gcc/lib/gcc/14/ -lm -lgfortran -L/opt/homebrew/opt/gfortran/lib -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/opt/homebrew/opt/gettext/lib'
installing to /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/00LOCK-goldfish/00new/goldfish/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (goldfish)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants