diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8c5b19a..6dc91e6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 @@ -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 diff --git a/ChangeLog b/ChangeLog index 7a6f7ac..fee08d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2024-09-05 John Laing + + * src/bsrch.cpp: Correct over-use of Name{} + * R/bsrch.R: Add example of bsrch() + * man/bsrch.R: Idem + +2024-09-01 Dirk Eddelbuettel + + * src/bds.cpp: Correct over-use of Name{} + 2024-08-27 Dirk Eddelbuettel * DESCRIPTION (Version, Date): Roll micro version and date @@ -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 diff --git a/DESCRIPTION b/DESCRIPTION index 2463993..07fcb21 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 during the - build step. See as well as + build step. See as well as 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 diff --git a/configure b/configure index 5319380..f4f8498 100755 --- a/configure +++ b/configure @@ -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 ## @@ -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 @@ -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 diff --git a/src/Makevars.in b/src/Makevars.in index 0e2bede..03dfb60 100644 --- a/src/Makevars.in +++ b/src/Makevars.in @@ -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 diff --git a/src/Makevars.win b/src/Makevars.win index e1e22d2..449a391 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -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 . - - -## 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 . + + +## 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