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

Fix build on macOS #2008

Merged
merged 1 commit into from Mar 16, 2021
Merged

Fix build on macOS #2008

merged 1 commit into from Mar 16, 2021

Conversation

bryanwweber
Copy link
Contributor

@bryanwweber bryanwweber commented Mar 15, 2021

Description of the Change

The changes in #1990 require C++11 compiler support. On macOS 10.14 with
XCode 11.3, the -std=c++11 flag must be specified to the compiler.

I was getting errors when compiling like:

clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I../.. -I../../include -I../../src -I../../externals/Eigen -I../../externals/fmtlib -I../../externals/msgpack-c/include -I/Users/bryan/.pyenv/versions/thermostate-dev/include -I/Users/bryan/.pyenv/versions/3.9.1/include/python3.9 -c ../../src/AbstractState.cpp -o build/temp.macosx-10.14-x86_64-3.9/../../src/AbstractState.o
In file included from ../../src/AbstractState.cpp:14:
In file included from ../../include/AbstractState.h:11:
In file included from ../../include/CachedElement.h:11:
In file included from ../../include/CoolPropTools.h:15:
../../include/CPstrings.h:45:61: error: expected expression
        s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char ch) {
                                                            ^
../../include/CPstrings.h:61:52: error: expected expression
        s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char ch) {

Benefits

Fix this compiling error on macOS

Possible Drawbacks

This should only affect macOS, but I haven't tested on newer versions of macOS than 10.14, so I'm not sure if this is required for newer versions of XCode.

Verification Process

I built the Python wrapper on macOS 10.14, as well as used CMake to build the shared libraries.

Applicable Issues

#1990 introduced this change to strings.

The changes in CoolProp#1990 require C++11 compiler support. On macOS 10.14 with
XCode 11.3, the -std=c++11 flag must be specified to the compiler.
@ibell
Copy link
Contributor

ibell commented Mar 16, 2021

Yup, I think we are finally going to require c++11.

@ibell ibell merged commit 2ea29cf into CoolProp:master Mar 16, 2021
@bryanwweber bryanwweber deleted the fix-macos-python branch March 16, 2021 03:46
zmeri pushed a commit to zmeri/CoolProp that referenced this pull request Aug 26, 2022
The changes in CoolProp#1990 require C++11 compiler support. On macOS 10.14 with
XCode 11.3, the -std=c++11 flag must be specified to the compiler.
@jowr jowr added this to the v6.4.2 milestone Dec 7, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants