zeutro / openabe

The OpenABE library - open source cryptographic library with attribute-based encryption implementations in C/C++
http://www.zeutro.com
GNU Affero General Public License v3.0
262 stars 71 forks source link

Cannot build anything on Mac #42

Closed mouse07410 closed 4 years ago

mouse07410 commented 4 years ago

Multiple problems. Mainly, the build scripts fail to pick a usable compiler (from the three installed and working!).

Compilers:

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin19/10.2.0/lto-wrapper
Target: x86_64-apple-darwin19
Configured with: /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc10/gcc10/work/gcc-10.2.0/configure --prefix=/opt/local --build=x86_64-apple-darwin19 --enable-languages=c,c++,objc,obj-c++,lto,fortran,jit --libdir=/opt/local/lib/gcc10 --includedir=/opt/local/include/gcc10 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-10 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-10 --with-gxx-include-dir=/opt/local/include/gcc10/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --enable-stage1-checking --disable-multilib --enable-lto --enable-libstdcxx-time --with-build-config=bootstrap-debug --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --enable-host-shared --disable-tls --with-pkgversion='MacPorts gcc10 10.2.0_1' --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (MacPorts gcc10 10.2.0_1) 
$ clang++ -v
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ clang -v
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Error attempting to build the relic dependency:

$ make
./download_relic.sh relic-toolkit-0.5.0
Clone github repo @ https://github.com/relic-toolkit/relic
fatal: destination path 'relic-toolkit-0.5.0.git' already exists and is not an empty directory.
HEAD is now at b984e901 Update LABEL with recent changes.
Create archive of source (without git files)
Create final tarball: relic-toolkit-0.5.0.tar.gz
mkdir: relic-toolkit-0.5.0: File exists
Fix symbols...
tar xf relic-toolkit-0.5.0.tar.gz
cd tmpbp-gMIo; \
     COMP="-O2 -funroll-loops -fomit-frame-pointer -Wno-incompatible-pointer-types -Wno-unused-function -Wno-implicit-function-declaration -Wno-incompatible-pointer-types-discards-qualifiers" cmake  -DCMAKE_INSTALL_PREFIX:PATH=/Users/ur20980/src/openabe/deps/root -DOPSYS=MACOSX -DARCH="X64" \
    -DWITH="BN;DV;FP;FPX;EP;EPX;PP;PC;MD" -DCHECK=off -DVERBS=off -DDEBUG=off -DMULTI=PTHREAD -DBENCH=0 -DTESTS=10 -DARITH=x64-asm-254 -DFP_PRIME=254 -DBN_PRECI=254 \
    -DFP_QNRES=on -DEP_METHD="PROJC;LWNAF;COMBS;INTER" -DFP_METHD="BASIC;COMBA;COMBA;MONTY;LOWER;SLIDE" -DFPX_METHD="INTEG;INTEG;LAZYR" -DPP_METHD="LAZYR;OATEP" \
    -DSEED="ZERO" -DRAND="CALL" ../relic-toolkit-0.5.0; \
    make && \
    make install && \
    cd ../tmpec-mVH9; \
     COMP="-O2 -funroll-loops -fomit-frame-pointer -Wno-unused-function -Wno-implicit-function-declaration -Wno-incompatible-pointer-types-discards-qualifiers" cmake  -DCMAKE_INSTALL_PREFIX:PATH=/Users/ur20980/src/openabe/deps/root -DOPSYS=MACOSX -DARCH="X64" \
    -DWITH="BN;DV;FP;EP;MD" -DCHECK=off -DVERBS=off -DDEBUG=off -DMULTI=PTHREAD -DBENCH=0 -DTESTS=0 -DARITH=gmp -DFP_PRIME=256 \
    -DFP_QNRES=off -DEP_METHD="PROJC;LWNAF;COMBS;INTER" -DFP_METHD="BASIC;COMBA;COMBA;MONTY;LOWER;SLIDE" -DFPX_METHD="INTEG;INTEG;LAZYR" -DPP_METHD="LAZYR;OATEP" \
    -DSEED="ZERO" -DRAND="CALL" -DLABEL="ec" ../relic-toolkit-0.5.0; \
    make && \
    make install && \
    sed -i -e '/^#define VERSION/d' /Users/ur20980/src/openabe/deps/root/include/relic/relic_conf.h && \
    sed -i -e '/^#define ep2_mul/i \
//#define ep2_mul' /Users/ur20980/src/openabe/deps/root/include/relic/relic_label.h && \
    sed -i -e '/^#define VERSION/d' /Users/ur20980/src/openabe/deps/root/include/relic_ec/relic_conf.h && \
    ../run_install_clean.sh && \
    touch ../relic-toolkit-0.5.0/.built
-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /opt/local/bin/g++
-- Check for working C compiler: /opt/local/bin/g++ - broken
CMake Error at /opt/local/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
  The C compiler

    "/opt/local/bin/g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp

    Run Build Command(s):/opt/local/bin/gmake cmTC_3cb7e/fast && gmake[1]: Entering directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'
    /opt/local/bin/gmake  -f CMakeFiles/cmTC_3cb7e.dir/build.make CMakeFiles/cmTC_3cb7e.dir/build
    gmake[2]: Entering directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_3cb7e.dir/testCCompiler.c.o
    /opt/local/bin/g++   -O3 -std=gnu18 -march=native -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk  -o CMakeFiles/cmTC_3cb7e.dir/testCCompiler.c.o -c /Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp/testCCompiler.c
    cc1plus: warning: command-line option '-std=gnu17' is valid for C/ObjC but not for C++
    /Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp/testCCompiler.c:2:3: error: #error "The CMAKE_C_COMPILER is set to a C++ compiler"
        2 | # error "The CMAKE_C_COMPILER is set to a C++ compiler"
          |   ^~~~~
    gmake[2]: *** [CMakeFiles/cmTC_3cb7e.dir/build.make:85: CMakeFiles/cmTC_3cb7e.dir/testCCompiler.c.o] Error 1
    gmake[2]: Leaving directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'
    gmake[1]: *** [Makefile:140: cmTC_3cb7e/fast] Error 2
    gmake[1]: Leaving directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:6 (project)

-- Configuring incomplete, errors occurred!
See also "/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeOutput.log".
See also "/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeError.log".
make[1]: *** No targets specified and no makefile found.  Stop.
-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /opt/local/bin/g++
-- Check for working C compiler: /opt/local/bin/g++ - broken
CMake Error at /opt/local/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
  The C compiler

    "/opt/local/bin/g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp

    Run Build Command(s):/opt/local/bin/gmake cmTC_a54df/fast && gmake[1]: Entering directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'
    /opt/local/bin/gmake  -f CMakeFiles/cmTC_a54df.dir/build.make CMakeFiles/cmTC_a54df.dir/build
    gmake[2]: Entering directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_a54df.dir/testCCompiler.c.o
    /opt/local/bin/g++   -O3 -std=gnu18 -march=native -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk  -o CMakeFiles/cmTC_a54df.dir/testCCompiler.c.o -c /Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp/testCCompiler.c
    cc1plus: warning: command-line option '-std=gnu17' is valid for C/ObjC but not for C++
    /Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp/testCCompiler.c:2:3: error: #error "The CMAKE_C_COMPILER is set to a C++ compiler"
        2 | # error "The CMAKE_C_COMPILER is set to a C++ compiler"
          |   ^~~~~
    gmake[2]: *** [CMakeFiles/cmTC_a54df.dir/build.make:85: CMakeFiles/cmTC_a54df.dir/testCCompiler.c.o] Error 1
    gmake[2]: Leaving directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'
    gmake[1]: *** [Makefile:140: cmTC_a54df/fast] Error 2
    gmake[1]: Leaving directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:6 (project)

-- Configuring incomplete, errors occurred!
See also "/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeOutput.log".
See also "/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeError.log".
make[1]: *** No targets specified and no makefile found.  Stop.
make: *** [relic-toolkit-0.5.0/.built] Error 2
mouse07410 commented 4 years ago

Closed by #44