You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vignettes/Rcpp-FAQ.Rnw
+18-10Lines changed: 18 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -444,34 +444,42 @@ To install XCode Command Line Tools, one must do the following:
444
444
\item Open \texttt{Terminal} found in \texttt{/Applications/Utilities/}
445
445
\item Type the following:
446
446
<<osx_xcode,engine='bash', eval = F>>=
447
-
xcode-select--install
447
+
$xcode-select--install
448
448
@
449
449
\item Press "Install" on the window that pops up.
450
450
\item After the installation is complete, type the following in \texttt{Terminal} to ensure the installation was successful:
451
451
452
-
<<osx_xcode,engine='bash', eval = F>>=
453
-
gcc--version
452
+
<<osx_xcode_gcc,engine='bash', eval = F>>=
453
+
$gcc--version
454
454
@
455
455
\end{enumerate}
456
456
457
457
After major system's update, e.g. 10.11 to 10.12, you may need to accept the terms and licenses associated the the Xcode command line tools prior to being allowed to compile again.
458
458
459
459
To do so, open the \texttt{Terminal} found in \texttt{/Applications/Utilities/} and type:
460
460
461
-
<<osx_xcode,engine='bash', eval = F>>=
462
-
git
461
+
<<osx_xcode_git,engine='bash', eval = F>>=
462
+
$git
463
463
@
464
464
465
465
Press spacebar to move down to the end of the file. There, you should see a prompt asking whether or not you accept the terms via either "Yes" or "No". Enter "Yes" if you agree to the terms to have the command line tools reactivated.
466
466
467
467
\subsubsection{Differing Mac OS X R Versions Leading to Binary Failures}
468
468
469
-
There are currently two distinct versions of R for OS X. The first version is a legacy version meant for Mac OS X 10.6 (Snow Leopard) - 10.8 (Mountain Lion). The second version is for more recent system Mac OS X 10.9 (Maverick), 10.10 (Yosemite), 10.11 (El Capitan). The distinction comes as a result of a change in the compilers shipped with the operating system. As a result, avoid sending package binaries if it is known that your collaborators are working on older systems as the R binaries for these two versions will not be able to mix.
469
+
There are currently two distinct versions of R for OS X. The first version is a legacy version meant for Mac OS X 10.6 (Snow Leopard) - 10.8 (Mountain Lion). The second version is for more recent system Mac OS X 10.9 (Mavericks), 10.10 (Yosemite), 10.11 (El Capitan). The distinction comes as a result of a change in the compilers shipped with the operating system. As a result, avoid sending package binaries if it is known that your collaborators are working on older systems as the R binaries for these two versions will not be able to mix.
470
470
471
471
\subsubsection{No OpenMP Support}
472
-
The OS X operating environment lacks the ability to parallelize sections of code using the \href{http://openmp.org/wp/}{OpenMP} standard. As a result, make sure to protect any parallelized sections of code with:
472
+
The OS X operating environment lacks the ability to parallelize sections of code using the \href{http://openmp.org/wp/}{OpenMP} standard. As a result, make sure to protect any reference to OpenMP. In this case, protect the inclusion of headers with:
473
+
474
+
<<osx_openmp_header, engine="Rcpp", eval = F>>=
475
+
#ifdef _OPENMP
476
+
#include <omp.h>
477
+
#endif
478
+
@
479
+
480
+
And when one goes to parallelize portions of code use:
473
481
474
-
<<osx_openmp, engine="Rcpp", eval = F>>=
482
+
<<osx_openmp_code, engine="Rcpp", eval = F>>=
475
483
#ifdef _OPENMP
476
484
//multithreadedOpenMPversionofcode
477
485
#else
@@ -481,7 +489,7 @@ The OS X operating environment lacks the ability to parallelize sections of code
481
489
482
490
Doing so will enable the parallelization of the process on Linux and Windows. In the event that Apple enables OpenMP later on, this code will also allow for parallelization to occur.
483
491
484
-
The reason for the lack of OpenMP support is because the under OS X, you are not using the \texttt{gcc} compiler. Instead, all the requests are being redirected to \texttt{llvm}. As of LLVM 3.7, the \href{https://clang-omp.github.io/}{community initiative} to enable OpenMP has been merged into the \href{http://openmp.llvm.org/}{official branch}. Thus, there is hope in the next release of Xcode (around WWDC in June 2016) that OpenMP will work on OS X.
492
+
The reason for the lack of OpenMP support is because under OS X, you are not using the \texttt{gcc} compiler. Instead, all the requests are being redirected to \texttt{llvm}. As of LLVM 3.7, the \href{https://clang-omp.github.io/}{community initiative} to enable OpenMP has been merged into the \href{http://openmp.llvm.org/}{official branch}. Thus, there is hope in the next release of Xcode (around WWDC in June 2016) that OpenMP will work on OS X.
485
493
486
494
487
495
\subsubsection{Additional Information / Help}
@@ -492,7 +500,7 @@ Below are additional resources that provide information regarding compiling Rcpp
492
500
\item A helpful post was provided by Brian Ripley regarding the use of compiling R code with OS X in April 2014 \href{https://stat.ethz.ch/pipermail/r-sig-mac/2014-April/010835.html}{on the \code{r-sig-mac} list}, which is generally recommended for OS X-specific questions and further consultation.
493
501
\item Another helpful write-up for installation / compilation on OS X Mavericks is
494
502
provided \href{http://www.bioconductor.org/developers/how-to/mavericks-howto/}{by the BioConductor project}.
495
-
\item Lastly, another resource that exists for installation / compilation help is provided at \url{thecoatlessprofessor.com/programming/r-compiler-tools-for-rcpp-on-os-x/}.
503
+
\item Lastly, another resource that exists for installation / compilation help is provided at \url{http://thecoatlessprofessor.com/programming/r-compiler-tools-for-rcpp-on-os-x/}.
496
504
\end{enumerate}
497
505
498
506
\textbf{Note:} If you are running into trouble compiling code with RcppArmadillo, please also see \faq{q:OSXArma} listed below.
0 commit comments