Skip to content
Prev 41785 / 63421 Next

Including multiple third party libraries in an extension

On Nov 13, 2011, at 9:55 PM, Tyler Pirtle wrote:

            
No. Several OSes support multiple architectures, for example Mac OS X 10.5 supports PowerPC and Intel, each of them with 32-bit or 64-bit. That gives a total of 4 architectures: i386, x86_64, ppc and ppc64. Therefore R binary for that platform has to support multiple architectures so the way this is done is to keep only one set of non-binary files and several sets of binary files, each for one architecture. On Windows there are 32-bit and 64-bit binaries (i386 and x64) so there are two sets of binary files - 32-bit and for 64-bit. This allows common distribution without the mess of having multiple builds for each architecture.
No, if you don't have configure and Makefile, R will build every architecture it supports, e.g.:

* installing *source* package 'fastmatch' ...
** package 'fastmatch' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
gcc-4.2 -arch i386 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/i386  -I/usr/local/include    -fPIC  -g -O2 -c fastmatch.c -o fastmatch.o
gcc-4.2 -arch i386 -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o fastmatch.so fastmatch.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /private/tmp/rl/fastmatch/libs/i386
*** arch - ppc
gcc-4.2 -arch ppc -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/ppc  -I/usr/local/include    -fPIC  -g -O2 -c fastmatch.c -o fastmatch.o
gcc-4.2 -arch ppc -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o fastmatch.so fastmatch.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /private/tmp/rl/fastmatch/libs/ppc
*** arch - x86_64
gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64  -I/usr/local/include    -fPIC  -g -O2 -c fastmatch.c -o fastmatch.o
gcc-4.2 -arch x86_64 -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o fastmatch.so fastmatch.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /private/tmp/rl/fastmatch/libs/x86_64
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded

* DONE (fastmatch)


As you can see, it compiled and installed the binaries for all three architectures (Intel 32-bit, PowerPC 32-bin and Intel 64-bit -- we don't support ppc64 anymore). That is possible since R is taking care of all the building so it can do the right thing with me even having to specify what yo do.

Cheers,
Simon