conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.27k stars 981 forks source link

Fail build the getting started example #4759

Closed MartinDelille closed 5 years ago

MartinDelille commented 5 years ago

To help us debug your issue please explain:

I tried to follow the tutorial here without success: https://docs.conan.io/en/latest/getting_started.html

  1. I cloned the code here in order to avoid copy/paste mistake: https://github.com/conan-community/poco-md5-example
  2. I create the build folder: mkdir build && cd build
  3. I ran conan install .. which result in a first error:

Poco/1.9.0@pocoproject/stable: WARN: Can't find a 'Poco/1.9.0@pocoproject/stable' package for the specified settings, options and dependencies:

ERROR: Missing prebuilt package for 'Poco/1.9.0@pocoproject/stable' Try to build it from sources with "--build Poco" Or read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-missing-prebuilt-package"

4. I followed the advice by entering the command `conan install .. --build Poco` but it failed again:

-- Building: Data -- Building: Zip -- Configuring done -- Generating done CMake Warning: Manually-specified variables were not used by the project:

CMAKE_EXPORT_NO_PACKAGE_REGISTRY
CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_DATAROOTDIR
CMAKE_INSTALL_INCLUDEDIR
CMAKE_INSTALL_LIBDIR
CMAKE_INSTALL_LIBEXECDIR
CMAKE_INSTALL_OLDINCLUDEDIR
CMAKE_INSTALL_SBINDIR

-- Build files have been written to: /Users/martin/.conan/data/Poco/1.9.0/pocoproject/stable/build/69dd885229d93087ed28ec19fe62042c86f78cfc/build Scanning dependencies of target Foundation [ 0%] Building CXX object Foundation/CMakeFiles/Foundation.dir/src/ASCIIEncoding.cpp.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] In file included from /Users/martin/.conan/data/Poco/1.9.0/pocoproject/stable/build/69dd885229d93087ed28ec19fe62042c86f78cfc/poco/Foundation/src/ASCIIEncoding.cpp:15: In file included from /Users/martin/.conan/data/Poco/1.9.0/pocoproject/stable/build/69dd885229d93087ed28ec19fe62042c86f78cfc/poco/Foundation/include/Poco/ASCIIEncoding.h:21: In file included from /Users/martin/.conan/data/Poco/1.9.0/pocoproject/stable/build/69dd885229d93087ed28ec19fe62042c86f78cfc/poco/Foundation/include/Poco/Foundation.h:111: /Users/martin/.conan/data/Poco/1.9.0/pocoproject/stable/build/69dd885229d93087ed28ec19fe62042c86f78cfc/poco/Foundation/include/Poco/Alignment.h:35:10: fatal error: 'cstddef' file not found

include

     ^~~~~~~~~

1 warning and 1 error generated. make[2]: [Foundation/CMakeFiles/Foundation.dir/src/ASCIIEncoding.cpp.o] Error 1 make[1]: [Foundation/CMakeFiles/Foundation.dir/all] Error 2 make: *** [all] Error 2 Poco/1.9.0@pocoproject/stable: Poco/1.9.0@pocoproject/stable: ERROR: Package '69dd885229d93087ed28ec19fe62042c86f78cfc' build failed Poco/1.9.0@pocoproject/stable: WARN: Build folder /Users/martin/.conan/data/Poco/1.9.0/pocoproject/stable/build/69dd885229d93087ed28ec19fe62042c86f78cfc ERROR: Poco/1.9.0@pocoproject/stable: Error in build() method, line 124 cmake.build() ConanException: Error 512 while executing cmake --build 'build'


I add the `/Users/martin/.conan/profiles/default` content if it helps:

[settings] os=Macos os_build=Macos arch=x86_64 arch_build=x86_64 compiler=apple-clang compiler.version=10.0 compiler.libcxx=libstdc++ build_type=Release [options] [build_requires] [env]


I tried to enter the command `conan profile update settings.compiler.libcxx=libstdc++11 default` but it result in an error when trying to install with `conan install ..`:

ERROR: Invalid setting 'libstdc++11' is not a valid 'settings.compiler.libcxx' value. Possible values are ['libc++', 'libstdc++'] Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"



Any idea what's going wrong?

I'm on *macOS 10.14* and using conan version 1.13.0 installed via *Homebrew*.
uilianries commented 5 years ago

Hi @MartinDelille !

ERROR: Missing prebuilt package for 'Poco/1.9.0@pocoproject/stable'

It occurs because Poco team don't distribute your configuration. I'll open a PR providing a new update.

ERROR: Invalid setting 'libstdc++11' is not a valid 'settings.compiler.libcxx' value.

On Mac OS is only possible to use libstdc++ or libc++. Did you try libc++?

Regards!

uilianries commented 5 years ago

Related PRs:

MartinDelille commented 5 years ago

It work indeed with libc++!

memsharded commented 5 years ago

Hi @MartinDelille

Glad that it worked!

The error was having libstdc++ in your default profile, I would like to understand how that happened, because in theory, libc++ should be the default for OSX.

It would be useful to reproduce if you tried:

$ conan profile new mydefault --detect
$ conan profile show mydefault

And paste the output. Thanks!

MartinDelille commented 5 years ago

Hi @memsharded,

I followed your instruction and the detect version is indeed libc++ as you can see in the output below:

$ conan profile new mydefault --detect                                                                                                              
Found apple-clang 10.0
Profile created with detected settings: /Users/martin/.conan/profiles/mydefault
$ conan profile show mydefault                                                                                                             3976ms 
Configuration for profile mydefault:

[settings]
os=Macos
os_build=Macos
arch=x86_64
arch_build=x86_64
compiler=apple-clang
compiler.version=10.0
compiler.libcxx=libc++
build_type=Release
[options]
[build_requires]
[env]

In fact what happened is that I intent to run the two following commands:

$ conan profile new default --detect  # Generates default profile detecting GCC and sets old ABI
$ conan profile update settings.compiler.libcxx=libstdc++11 default  # Sets libcxx to C++11 ABI

Since it produce an error I corrected by and from libstdc++11 to libstdc++.

I was confused by the Important note at step 6 which didn't applied in my case: I guess precising that macOS or clang user are not concerned by this information would help no?

memsharded commented 5 years ago

Hi @MartinDelille

I was confused by the Important note at step 6 which didn't applied in my case: I guess precising that macOS or clang user are not concerned by this information would help no?

Do you mean the Important note that reads:

"If you are using GCC compiler >= 5.1, Conan will set the compiler.libcxx to the old ABI for backwards compatibility. You can change this with the following commands:"

With GCC compiler >= 5.1 in bold font? πŸ˜„ πŸ˜…

uilianries commented 5 years ago

Hi again!

Poco team just merged the improvements. The new packages will be available in few hours.

https://travis-ci.org/pocoproject/conan-poco/builds/508299242

MartinDelille commented 5 years ago

@memsharded Ok my mistake I thought I had both compiler since gcc is in my path but I realized the it is in fact clang behind:

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
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

At least I learn something today! πŸ˜…

uilianries commented 5 years ago

Hi @MartinDelille !

Please let me know if you need anything else or we are good to close this issue.

Regards!

MartinDelille commented 5 years ago

No it's fine thank you for your help!