Skip to content

Commit

Permalink
Use release 3.24.6.1 (#397)
Browse files Browse the repository at this point in the history
* Use feature/release_3.24.6.1 branch of blp repo

* Enable macOS in CI as it is arm64 based now

Dump logs in CI if failure

Update install_name_tool call

* Download branch is now a variable

* Adjust src/Makevars.win to blp branch too

* Support both cpu platforms for macOS

* Edit to DESCRIPTION::Description [ci skip]

* Revert from feature/release_3.24.6.1 to master following blp merge

* Update ChangeLog for recent PRs
  • Loading branch information
eddelbuettel authored Sep 11, 2024
1 parent 890fb5f commit a16d3fd
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 64 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
strategy:
matrix:
include:
#- {os: macOS-latest}
- {os: macOS-latest}
- {os: ubuntu-latest}

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
- name: Checkout
uses: actions/checkout@v4

- name: Setup
Expand All @@ -35,6 +35,10 @@ jobs:
- name: Test
run: ./run.sh run_tests

- name: Logs
run: ./run.sh dump_logs
if: failure()

#- name: Coverage
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: ./run.sh coverage
12 changes: 12 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2024-09-05 John Laing <[email protected]>

* src/bsrch.cpp: Correct over-use of Name{}
* R/bsrch.R: Add example of bsrch()
* man/bsrch.R: Idem

2024-09-01 Dirk Eddelbuettel <[email protected]>

* src/bds.cpp: Correct over-use of Name{}

2024-08-27 Dirk Eddelbuettel <[email protected]>

* DESCRIPTION (Version, Date): Roll micro version and date
Expand All @@ -20,6 +30,8 @@
* src/lookup.cpp: Idem

* src/Makevars.in: Remove obsolete C++11 setter
* src/Makevars.in: Set to development branch of blp repo for testing
* src/Makevars.win: Idem

* .editorconfig: Added

Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ LinkingTo: Rcpp, BH
Description: An R Interface to 'Bloomberg' is provided via the 'Blp API'.
SystemRequirements: A valid Bloomberg installation. The API headers and
dynamic library are downloaded from <https://github.com/Rblp/blp> during the
build step. See <https://bloomberg.github.io/blpapi-docs/cpp/3.8> as well as
build step. See <https://bloomberg.github.io/blpapi-docs/cpp/3.24.6> as well as
<https://www.bloomberg.com/professional/support/api-library/> for API
documentation. A recent-enough compiler with C++11 support is required.
documentation.
URL: https://dirk.eddelbuettel.com/code/rblpapi.html, https://github.com/Rblp/Rblpapi
BugReports: https://github.com/Rblp/Rblpapi/issues
License: file LICENSE
Expand Down
23 changes: 18 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##
## configure -- Unix build preparation system
##
## Copyright (C) 2015 - 2022 Dirk Eddelbuettel and Jeroen Ooms.
## Copyright (C) 2015 - 2024 Dirk Eddelbuettel and Jeroen Ooms.
##
## This file is part of Rblpapi
##
Expand Down Expand Up @@ -46,6 +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 @@ -73,24 +83,27 @@ download() {
## respects enviroment variable so 'blpHeaders="/opt/blp/blpHeaders_1.2.3.tar.gz" ./configure' works
: ${blpHeaders="blpHeaders.tar.gz"}
: ${blpLibrary="blpLibrary.tar.gz"}
: ${blpBranch="master"}

## 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}
if [ ! -f ${blpHeaders} ]; then
download https://github.com/Rblp/blp/raw/master/headers/${platform}/blpHeaders.tar.gz
download https://github.com/Rblp/blp/raw/${blpBranch}/headers/${platform}/blpHeaders.tar.gz
else
echo "** using ${blpHeaders}"
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/master/${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
2 changes: 1 addition & 1 deletion src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ PKG_CPPFLAGS = -I../inst/include/ -I.
PKG_LIBS = -l$(BBG_LIB) -L../inst/blp -Wl,-rpath,$(BBG_RPATH)

all: $(SHLIB)
@if command -v install_name_tool; then echo "fixing"; install_name_tool -change libblpapi3_64.so '@loader_path/../blp/libblpapi3_64.so' Rblpapi.so; fi
@if command -v install_name_tool; then echo "fixing"; install_name_tool -add_rpath @loader_path/../blp Rblpapi.so; fi
109 changes: 55 additions & 54 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,54 +1,55 @@
## -*- mode: Makefile; tab-width: 8 -*-
##
## Makefile.win -- Windows build system
##
## Copyright (C) 2015 Whit Armstrong and Dirk Eddelbuettel
##
## This file is part of Rblpapi
##
## Rblpapi is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 2 of the License, or
## (at your option) any later version.
##
## Rblpapi is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Rblpapi. If not, see <http://www.gnu.org/licenses/>.


## Distinguish between 32 and 64 bit windows
ifeq "$(WIN)" "64"
FLV = x64
else
FLV = i386
endif

## Standard compiler / linker flags including windows flavor
CXX_STD = CXX11
PKG_CPPFLAGS = -I../inst/include -I.
PKG_LIBS = -lblpapi3_${WIN} -L${FLV}


## SHLIB target is built by R, blpLibrary is a target we use to expand the tar.gz
all: blpLibrary $(SHLIB)

## target to ensure tar.gz files get unpacked
## the opening '@' ensures operations are executed 'quietly'
## in order to see commands as they happens add a 'v' to the tar and cp commands
## curl has '-k' flag to suppress certificate warnings
blpLibrary:
@if [ ! -d ../inst ]; then mkdir -p ../inst; fi
@if [ ! -d ../blp/win/${FLV} ]; then mkdir -p ../blp/win/${FLV}; fi
@if [ ! -f ../blp/win/${FLV}/blpHeaders.tar.gz ]; then curl -s -k -L -O https://github.com/Rblp/blp/raw/master/headers/windows/blpHeaders.tar.gz; mv blpHeaders.tar.gz ../blp/win/${FLV}; tar xfz ../blp/win/${FLV}/blpHeaders.tar.gz -C ../inst; fi
@if [ ! -f ../blp/win/${FLV}/blpLibrary.tar.gz ]; then curl -s -k -L -O https://github.com/Rblp/blp/raw/master/win${WIN}/blpLibrary.tar.gz; mv blpLibrary.tar.gz ../blp/win/${FLV}; tar xfz ../blp/win/${FLV}/blpLibrary.tar.gz; fi
@if [ ! -d ${FLV} ]; then mkdir -p ${FLV}; fi
@cp blpapi3_${WIN}.dll ${FLV}
@if [ ! -d ../inst/libs/${FLV} ]; then mkdir -p ../inst/libs/${FLV}; fi
@cp blpapi3_${WIN}.dll ../inst/libs/${FLV}

## Ensure the blpLibrary target is always executed
.Phony: blpLibrary
## -*- mode: Makefile; tab-width: 8 -*-
##
## Makefile.win -- Windows build system
##
## Copyright (C) 2015 - 2024 Whit Armstrong and Dirk Eddelbuettel
##
## This file is part of Rblpapi
##
## Rblpapi is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 2 of the License, or
## (at your option) any later version.
##
## Rblpapi is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Rblpapi. If not, see <http://www.gnu.org/licenses/>.


## Distinguish between 32 and 64 bit windows
ifeq "$(WIN)" "64"
FLV = x64
else
FLV = i386
endif

## Standard compiler / linker flags including windows flavor
# CXX_STD = CXX11
PKG_CPPFLAGS = -I../inst/include -I.
PKG_LIBS = -lblpapi3_${WIN} -L${FLV}


## SHLIB target is built by R, blpLibrary is a target we use to expand the tar.gz
all: blpLibrary $(SHLIB)

## target to ensure tar.gz files get unpacked
## the opening '@' ensures operations are executed 'quietly'
## in order to see commands as they happens add a 'v' to the tar and cp commands
## curl has '-k' flag to suppress certificate warnings
BRANCH = "master"
blpLibrary:
@if [ ! -d ../inst ]; then mkdir -p ../inst; fi
@if [ ! -d ../blp/win/${FLV} ]; then mkdir -p ../blp/win/${FLV}; fi
@if [ ! -f ../blp/win/${FLV}/blpHeaders.tar.gz ]; then curl -s -k -L -O https://github.com/Rblp/blp/raw/${BRANCH}/headers/windows/blpHeaders.tar.gz; mv blpHeaders.tar.gz ../blp/win/${FLV}; tar xfz ../blp/win/${FLV}/blpHeaders.tar.gz -C ../inst; fi
@if [ ! -f ../blp/win/${FLV}/blpLibrary.tar.gz ]; then curl -s -k -L -O https://github.com/Rblp/blp/raw/${BRANCH}/win${WIN}/blpLibrary.tar.gz; mv blpLibrary.tar.gz ../blp/win/${FLV}; tar xfz ../blp/win/${FLV}/blpLibrary.tar.gz; fi
@if [ ! -d ${FLV} ]; then mkdir -p ${FLV}; fi
@cp blpapi3_${WIN}.dll ${FLV}
@if [ ! -d ../inst/libs/${FLV} ]; then mkdir -p ../inst/libs/${FLV}; fi
@cp blpapi3_${WIN}.dll ../inst/libs/${FLV}

## Ensure the blpLibrary target is always executed
.Phony: blpLibrary

0 comments on commit a16d3fd

Please sign in to comment.