s2geometry icon indicating copy to clipboard operation
s2geometry copied to clipboard

use of undeclared identifier 'BN_bn2lebinpad' during macOS installation

Open ghost opened this issue 5 years ago • 2 comments

I raised a previous issue where I was unable to install the S2 library because of a missing gtest.h file. I omitted that file from the folder just to try and install S2 which is how I got to this error. After successfully making the S2 binary (without googletest), I was unable to complete the installation where I must install the library (final step of https://s2geometry.io/about/platforms) with the following error:

...
[ 95%] Building CXX object CMakeFiles/s2.dir/src/s2/util/math/exactfloat/exactfloat.cc.o
/Users/bsod88/Desktop/SomeProject/s2geometry/src/s2/util/math/exactfloat/exactfloat.cc:139:15: error: use of undeclared
      identifier 'BN_bn2lebinpad'
  S2_CHECK_EQ(BN_bn2lebinpad(bn, bytes.data(), bytes.size()), bytes.size());
              ^
/Users/bsod88/Desktop/SomeProject/s2geometry/src/s2/base/logging.h:32:21: note: expanded from macro 'S2_CHECK_EQ'
#define S2_CHECK_EQ CHECK_EQ
                    ^
1 error generated.
make[2]: *** [CMakeFiles/s2.dir/src/s2/util/math/exactfloat/exactfloat.cc.o] Error 1
make[1]: *** [CMakeFiles/s2.dir/all] Error 2
make: *** [all] Error 2

macOS & terminal ver 10.15.2 cmake ver 3.16.4 s2geometry ver latest as of 2020-02-26

ghost avatar Feb 26 '20 18:02 ghost

How did you install OpenSSL?

jmr avatar Sep 01 '20 18:09 jmr

I had this problem when trying to install s2 on OSX using openssl installed via homebrew. The solution was to add the openssl path into the LDFLAGS and CPPFLAGS:

  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
  export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"

Or for R users:

install.packages(
    's2',
    configure.args="LDFLAGS=-L/usr/local/opt/[email protected]/lib CPPFLAGS=-I/usr/local/opt/[email protected]/include"
)

SimonGreenhill avatar Aug 10 '21 04:08 SimonGreenhill