CASMcode
CASMcode copied to clipboard
std::unary_function
The casm-boost-cpp17
conda package compiles boost 1.66.0 with c++17. But this version of boost uses std::unary_function
which was deprecated in c++11 and removed in the c++17 standard. Compilers were still supporting it, but now that support is being removed by default, for example it results in an error from clang in the latest OSX version.
Until casm-boost-cpp17
is updated, a fix is to use the _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
compiler flag. So an example configuration script could be:
CASM_PREFIX=$CONDA_PREFIX
CASM_CXXFLAGS="-O3 -Wall -DNDEBUG -fcolor-diagnostics "
CASM_CXXFLAGS+="-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION "
CASM_CXXFLAGS+=" -I$CASM_PREFIX/include "
CASM_CC="ccache cc"
CASM_CXX="ccache c++"
CASM_PYTHON="python"
CASM_LDFLAGS="-L$CASM_PREFIX/lib -Wl,-rpath,$CASM_PREFIX/lib"
CASM_CONFIGFLAGS="--prefix=$CASM_PREFIX "
CASM_CONFIGFLAGS+="--with-zlib=$CASM_PREFIX "
CASM_CONFIGFLAGS+="--with-boost=$CASM_PREFIX "
../configure CXXFLAGS="${CASM_CXXFLAGS}" CC="$CASM_CC" CXX="$CASM_CXX" PYTHON="$CASM_PYTHON" LDFLAGS="${CASM_LDFLAGS}" ${CASM_CONFIGFLAGS}