Skip to content

Commit

Permalink
Support both cpu platforms for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Sep 2, 2024
1 parent 3391266 commit f2a7603
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@ if [ "${arch}" = "x86_64" ]; then
echo "Setting up compilation for a ${platform} 64-bit system"
sed -e"s/@config@/blpapi3_64/" src/Makevars.in > src/Makevars
flavour="64"
if [ "${platform}" = "osx" ]; then
cpu="x86"
fi
elif [ "${arch}" = "arm64" ]; then
echo "Setting up compilation for a ${platform} 64-bit system"
sed -e"s/@config@/blpapi3_64/" src/Makevars.in > src/Makevars
flavour="64"
if [ "${platform}" = "osx" ]; then
cpu="arm"
fi
elif [ "${arch}" = "i686" ]; then
echo "Setting up compilation for a ${platform} 32-bit system"
sed -e"s/@config@/blpapi3_32/" src/Makevars.in > src/Makevars
Expand Down Expand Up @@ -80,7 +86,7 @@ download() {
#: ${blpBranch="master"}
: ${blpBranch="feature/release_3.24.6.1"}

## Check for header files and download if needed
## Check for header files and download if needed, this looks at repo blp in directory headers/
cwd=$(pwd)
mkdir -p blp/${platform}
cd blp/${platform}
Expand All @@ -92,11 +98,13 @@ fi
tar xfz ${blpHeaders} -C ../../inst
cd ${cwd}

## Get and install precompiled shared library
## Get and install precompiled shared library, this looks at repo blp in directoris 'PlatformFlavourCpu'
## Here flavour is mostly redundant as of 2024 as 32 bit is no longer built at CRAN but we support user who may have it
## The Cpu tag is used only on macos and it used to distinguish between (old) x86_64 and newer arm64
mkdir -p inst/blp
cd blp/${platform}
if [ ! -f ${blpLibrary} ]; then
download https://github.com/Rblp/blp/raw/${blpBranch}/${platform}${flavour}/blpLibrary.tar.gz
download https://github.com/Rblp/blp/raw/${blpBranch}/${platform}${flavour}${cpu}/blpLibrary.tar.gz
else
echo "** using ${blpLibrary}"
fi
Expand Down

0 comments on commit f2a7603

Please sign in to comment.