Skip to content

new compilers from Apple

3 messages · John C. Tull, Jan de Leeuw

#
The following setup on SL compiles R-devel and passes check.

  C compiler:                /Developer/usr/bin/llvm-gcc -std=gnu99 -m64 -O4 -Wall -fopenmp -mtune=native
  Fortran 77 compiler:       /usr/local/bin/gfortran-4.5 -m64 -O4 -Wall -fopenmp -mtune=native
  C++ compiler:              /Developer/usr/bin/llvm-g++ -m64 -O4 -Wall -fopenmp -mtune=native
  Fortran 90/95 compiler:    /usr/local/bin/gfortran-4.5 -m64 -O4 -Wall -fopenmp -mtune=native
  Obj-C compiler:	     /Developer/usr/bin/llvm-gcc -m64 -O4 -Wall -fopenmp -mtune=native

This compiles at breakneck speed (compared to gcc-4.2 or gcc-4.5). In fact, with recommended packages, 
for all of R-devel:

time make -j8 
real	2m33.028s
user	3m59.076s
sys	0m33.248s

NB: I still have problems with CC and OBJC equal to clang (from Apple) 
or to clang (from the llvm svn), even without the -fopenmp flag. 

===============================================================
     Jan de Leeuw, 11667 Steinhoff Rd, Frazier Park, CA 93225
     home 661-245-1725 mobile 661-231-5416 work 310-825-9550
     .mac: jdeleeuw +++  aim: deleeuwjan +++ skype: j_deleeuw
===============================================================
             We are always the same age inside.
	 		                 Gertrude Stein
#
Jan,

Can you elaborate on how you invoke these settings for a R-devel  
build? Do you pass these along in a Terminal session, assuming BASH  
shell, via a series of export commands? I'd like to build this myself  
using llvm and see how it turns out.

Certainly, speeding up compile times is a nice benefit. Have you  
tested any R commands to compare performance of this build versus  
gcc-4.2? I wonder if the gains are passed along to application  
performance as well.

Thanks,
John
On Oct 26, 2009, at 11:18 PM, Jan de Leeuw wrote:

            
#
Yes. Here is part of the bash profile

export CC=/Developer/usr/bin/llvm-gcc
export CXX=/Developer/usr/bin/llvm-g++
export OBJC=/Developer/usr/bin/llvm-gcc
export F77=/usr/local/bin/gfortran
export FC=/usr/local/bin//gfortran
export CFLAGS="-std=gnu99 -m64 -O4 -Wall -fopenmp -mtune=native"
export CXXFLAGS="-m64 -O4 -Wall -fopenmp -mtune=native"
export OBJCFLAGS="-std=gnu99 -m64 -O4 -Wall -fopenmp -mtune=native"
export FFLAGS="-m64 -O4 -Wall -fopenmp -mtune=native"
export FCFLAGS="-m64 -O4 -Wall -fopenmp -mtune=native"
export LDFLAGS="-m64 -fopenmp"

I haven't done any timing comparisons (yet).

-- Jan
On Oct 27, 2009, at 10:39 , John C. Tull wrote:

            
===
Jan de Leeuw; Distinguished Professor and Chair, UCLA Department of Statistics;
Director: UCLA Center for Environmental Statistics (CES);
Editor: Journal of Multivariate Analysis, Journal of Statistical Software;
US mail: 8125 Math Sciences Bldg, Box 951554, Los Angeles, CA 90095-1554
phone (310)-825-9550;  fax (310)-206-5658;  email: deleeuw at stat.ucla.edu
.mac: jdeleeuw ++++++  aim: deleeuwjan ++++++ skype: j_deleeuw
homepages: http://gifi.stat.ucla.edu ++++++ http://www.cuddyvalley.org
 -------------------------------------------------------------------------------------------------
          No matter where you go, there you are. --- Buckaroo Banzai
                   http://gifi.stat.ucla.edu/sounds/nomatter.au                                  
 -------------------------------------------------------------------------------------------------