Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::unary_function #336

Open
bpuchala opened this issue Nov 14, 2023 · 0 comments
Open

std::unary_function #336

bpuchala opened this issue Nov 14, 2023 · 0 comments

Comments

@bpuchala
Copy link
Contributor

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}

Also see this or this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant