After Xcode Update, “python3 setup.py build_ext --inplace” breaks because it uses libstdc++ instead of...












2















I updated xcode-select install to the latest version, which doesn't support libstdc++ anymore, therefore libraries such as 'iostream' can't be found when I run:



$ python3 setup.py build_ext --inline


Error message



running build_ext
building '_pafprocess' extension
swigging pafprocess.i to pafprocess_wrap.cpp
swig -python -c++ -o pafprocess_wrap.cpp pafprocess.i
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Users/luchovilla/Py/posEst/lib/python3.6/site-packages/numpy/core/include -I. -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pafprocess.cpp -o build/temp.macosx-10.6-intel-3.6/pafprocess.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++
standard library instead [-Wstdlibcxx-not-found]
pafprocess.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
^~~~~~~~~~
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1


I found this explanation: ld: library not found for -lstdc++.6



and this vague solution: https://forums.developer.apple.com/thread/106114



Is there a way I can append pass '-std=libc++' to the clang command?.



Setup.py file lookes like this:



from distutils.core import setup, Extension
import numpy
import os

# os.environ['CC'] = 'g++';
setup(name='pafprocess_ext', version='1.0',
ext_modules=[
Extension('_pafprocess', ['pafprocess.cpp', 'pafprocess.i'],
swig_opts=['-c++'],
depends=["pafprocess.h"],
include_dirs=[numpy.get_include(), '.'])
],
py_modules=[
"pafprocess"
]
)









share|improve this question

























  • Can you share the result of /usr/bin/clang --version?

    – Louis Dionne
    Nov 15 '18 at 18:03











  • @LouisDionne Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin18.2.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

    – leanGuardia
    Nov 15 '18 at 18:30











  • I'm surprised -- I think it should pick up the libc++ headers by default. Can you try running echo '#include <iostream>' | /usr/bin/clang -xc++ -fsyntax-only -v - and report here (e.g. a link to a gist)?

    – Louis Dionne
    Nov 16 '18 at 17:13











  • I created it here: gist.github.com/leanguardia/b4eba7b7254b227b94d864e6bae3b68e, hopefully, this gives you some insight, thank you for the help.

    – leanGuardia
    Nov 16 '18 at 22:58











  • I'm puzzled -- so this command works but not the one used by swig? Something else is wrong here. It's hard for me to help further without a reproducer.

    – Louis Dionne
    Nov 19 '18 at 17:11
















2















I updated xcode-select install to the latest version, which doesn't support libstdc++ anymore, therefore libraries such as 'iostream' can't be found when I run:



$ python3 setup.py build_ext --inline


Error message



running build_ext
building '_pafprocess' extension
swigging pafprocess.i to pafprocess_wrap.cpp
swig -python -c++ -o pafprocess_wrap.cpp pafprocess.i
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Users/luchovilla/Py/posEst/lib/python3.6/site-packages/numpy/core/include -I. -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pafprocess.cpp -o build/temp.macosx-10.6-intel-3.6/pafprocess.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++
standard library instead [-Wstdlibcxx-not-found]
pafprocess.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
^~~~~~~~~~
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1


I found this explanation: ld: library not found for -lstdc++.6



and this vague solution: https://forums.developer.apple.com/thread/106114



Is there a way I can append pass '-std=libc++' to the clang command?.



Setup.py file lookes like this:



from distutils.core import setup, Extension
import numpy
import os

# os.environ['CC'] = 'g++';
setup(name='pafprocess_ext', version='1.0',
ext_modules=[
Extension('_pafprocess', ['pafprocess.cpp', 'pafprocess.i'],
swig_opts=['-c++'],
depends=["pafprocess.h"],
include_dirs=[numpy.get_include(), '.'])
],
py_modules=[
"pafprocess"
]
)









share|improve this question

























  • Can you share the result of /usr/bin/clang --version?

    – Louis Dionne
    Nov 15 '18 at 18:03











  • @LouisDionne Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin18.2.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

    – leanGuardia
    Nov 15 '18 at 18:30











  • I'm surprised -- I think it should pick up the libc++ headers by default. Can you try running echo '#include <iostream>' | /usr/bin/clang -xc++ -fsyntax-only -v - and report here (e.g. a link to a gist)?

    – Louis Dionne
    Nov 16 '18 at 17:13











  • I created it here: gist.github.com/leanguardia/b4eba7b7254b227b94d864e6bae3b68e, hopefully, this gives you some insight, thank you for the help.

    – leanGuardia
    Nov 16 '18 at 22:58











  • I'm puzzled -- so this command works but not the one used by swig? Something else is wrong here. It's hard for me to help further without a reproducer.

    – Louis Dionne
    Nov 19 '18 at 17:11














2












2








2








I updated xcode-select install to the latest version, which doesn't support libstdc++ anymore, therefore libraries such as 'iostream' can't be found when I run:



$ python3 setup.py build_ext --inline


Error message



running build_ext
building '_pafprocess' extension
swigging pafprocess.i to pafprocess_wrap.cpp
swig -python -c++ -o pafprocess_wrap.cpp pafprocess.i
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Users/luchovilla/Py/posEst/lib/python3.6/site-packages/numpy/core/include -I. -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pafprocess.cpp -o build/temp.macosx-10.6-intel-3.6/pafprocess.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++
standard library instead [-Wstdlibcxx-not-found]
pafprocess.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
^~~~~~~~~~
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1


I found this explanation: ld: library not found for -lstdc++.6



and this vague solution: https://forums.developer.apple.com/thread/106114



Is there a way I can append pass '-std=libc++' to the clang command?.



Setup.py file lookes like this:



from distutils.core import setup, Extension
import numpy
import os

# os.environ['CC'] = 'g++';
setup(name='pafprocess_ext', version='1.0',
ext_modules=[
Extension('_pafprocess', ['pafprocess.cpp', 'pafprocess.i'],
swig_opts=['-c++'],
depends=["pafprocess.h"],
include_dirs=[numpy.get_include(), '.'])
],
py_modules=[
"pafprocess"
]
)









share|improve this question
















I updated xcode-select install to the latest version, which doesn't support libstdc++ anymore, therefore libraries such as 'iostream' can't be found when I run:



$ python3 setup.py build_ext --inline


Error message



running build_ext
building '_pafprocess' extension
swigging pafprocess.i to pafprocess_wrap.cpp
swig -python -c++ -o pafprocess_wrap.cpp pafprocess.i
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Users/luchovilla/Py/posEst/lib/python3.6/site-packages/numpy/core/include -I. -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pafprocess.cpp -o build/temp.macosx-10.6-intel-3.6/pafprocess.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++
standard library instead [-Wstdlibcxx-not-found]
pafprocess.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
^~~~~~~~~~
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1


I found this explanation: ld: library not found for -lstdc++.6



and this vague solution: https://forums.developer.apple.com/thread/106114



Is there a way I can append pass '-std=libc++' to the clang command?.



Setup.py file lookes like this:



from distutils.core import setup, Extension
import numpy
import os

# os.environ['CC'] = 'g++';
setup(name='pafprocess_ext', version='1.0',
ext_modules=[
Extension('_pafprocess', ['pafprocess.cpp', 'pafprocess.i'],
swig_opts=['-c++'],
depends=["pafprocess.h"],
include_dirs=[numpy.get_include(), '.'])
],
py_modules=[
"pafprocess"
]
)






python xcode setup.py libstdc++ libc++






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 20:10







leanGuardia

















asked Nov 14 '18 at 19:57









leanGuardialeanGuardia

114




114













  • Can you share the result of /usr/bin/clang --version?

    – Louis Dionne
    Nov 15 '18 at 18:03











  • @LouisDionne Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin18.2.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

    – leanGuardia
    Nov 15 '18 at 18:30











  • I'm surprised -- I think it should pick up the libc++ headers by default. Can you try running echo '#include <iostream>' | /usr/bin/clang -xc++ -fsyntax-only -v - and report here (e.g. a link to a gist)?

    – Louis Dionne
    Nov 16 '18 at 17:13











  • I created it here: gist.github.com/leanguardia/b4eba7b7254b227b94d864e6bae3b68e, hopefully, this gives you some insight, thank you for the help.

    – leanGuardia
    Nov 16 '18 at 22:58











  • I'm puzzled -- so this command works but not the one used by swig? Something else is wrong here. It's hard for me to help further without a reproducer.

    – Louis Dionne
    Nov 19 '18 at 17:11



















  • Can you share the result of /usr/bin/clang --version?

    – Louis Dionne
    Nov 15 '18 at 18:03











  • @LouisDionne Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin18.2.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

    – leanGuardia
    Nov 15 '18 at 18:30











  • I'm surprised -- I think it should pick up the libc++ headers by default. Can you try running echo '#include <iostream>' | /usr/bin/clang -xc++ -fsyntax-only -v - and report here (e.g. a link to a gist)?

    – Louis Dionne
    Nov 16 '18 at 17:13











  • I created it here: gist.github.com/leanguardia/b4eba7b7254b227b94d864e6bae3b68e, hopefully, this gives you some insight, thank you for the help.

    – leanGuardia
    Nov 16 '18 at 22:58











  • I'm puzzled -- so this command works but not the one used by swig? Something else is wrong here. It's hard for me to help further without a reproducer.

    – Louis Dionne
    Nov 19 '18 at 17:11

















Can you share the result of /usr/bin/clang --version?

– Louis Dionne
Nov 15 '18 at 18:03





Can you share the result of /usr/bin/clang --version?

– Louis Dionne
Nov 15 '18 at 18:03













@LouisDionne Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin18.2.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

– leanGuardia
Nov 15 '18 at 18:30





@LouisDionne Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin18.2.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

– leanGuardia
Nov 15 '18 at 18:30













I'm surprised -- I think it should pick up the libc++ headers by default. Can you try running echo '#include <iostream>' | /usr/bin/clang -xc++ -fsyntax-only -v - and report here (e.g. a link to a gist)?

– Louis Dionne
Nov 16 '18 at 17:13





I'm surprised -- I think it should pick up the libc++ headers by default. Can you try running echo '#include <iostream>' | /usr/bin/clang -xc++ -fsyntax-only -v - and report here (e.g. a link to a gist)?

– Louis Dionne
Nov 16 '18 at 17:13













I created it here: gist.github.com/leanguardia/b4eba7b7254b227b94d864e6bae3b68e, hopefully, this gives you some insight, thank you for the help.

– leanGuardia
Nov 16 '18 at 22:58





I created it here: gist.github.com/leanguardia/b4eba7b7254b227b94d864e6bae3b68e, hopefully, this gives you some insight, thank you for the help.

– leanGuardia
Nov 16 '18 at 22:58













I'm puzzled -- so this command works but not the one used by swig? Something else is wrong here. It's hard for me to help further without a reproducer.

– Louis Dionne
Nov 19 '18 at 17:11





I'm puzzled -- so this command works but not the one used by swig? Something else is wrong here. It's hard for me to help further without a reproducer.

– Louis Dionne
Nov 19 '18 at 17:11












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53307894%2fafter-xcode-update-python3-setup-py-build-ext-inplace-breaks-because-it-use%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53307894%2fafter-xcode-update-python3-setup-py-build-ext-inplace-breaks-because-it-use%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Xamarin.iOS Cant Deploy on Iphone

Glorious Revolution

Dulmage-Mendelsohn matrix decomposition in Python