Giter Club home page Giter Club logo

polly's People

Contributors

arrtchiu avatar belveder79 avatar bkotsopoulossc avatar bkotzz avatar ckaminski avatar devexter avatar dvirtz avatar esteve avatar headupinclouds avatar ikliashchou avatar jbzdarkid avatar jcftang avatar kevinlsk avatar lucamartini avatar oliverdaniell avatar olliwang avatar pretyman avatar remyjette avatar riegl-gc avatar rsnitsch avatar ruslo avatar s-brain avatar skypjack avatar speps avatar stefan-sedlak avatar tony84727 avatar wangyida avatar xpol avatar xv-tom-l avatar yowidin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

polly's Issues

latest xcode toolchain projects lack Debug configuration

I recently updated polly and noticed I no longer have Debug configurations available in Xcode projects generated with the "xcode" toolchain. I've tried both "--config Debug" and "--config Release" as well as leaving the "--config" option empty. The only option I available in the application schemes for the Xcode targets is Release.

I'm building all the Hunter packages in release mode, but that is how I've always had it configured.

build.py --toolchain xcode --verbose --fwd
HUNTER_CONFIGURATION_TYPES=Release
--config Debug
--install
--jobs 8
--clear
--open

Clang cross toolchain

Since you can cross compile just about anything with a host clang, why not add a toolchain for this?

libcxx toolchain must not pass -stdlib=libc++ option to fortran

Building Eigen using hunter:

hunter_config(Eigen VERSION 3.2.4)
hunter_add_package(Eigen)
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})

results in a fortran related link error when using the libcxx toolchain.

I'm building from the command line with:

 build.py --install --toolchain libcxx --verbose

and end up with the following error.

CMake Error at /usr/local/share/cmake-3.2/Modules/CMakeTestFortranCompiler.cmake:54 (message):
  The Fortran compiler "/usr/local/bin/gfortran" is not able to compile a
  simple test program.

  It fails with the following output:

   Change Dir: /Users/dhirvonen/devel/hunter/_Base/xxxxxxx/015448b/b2b5fbe/Build/Eigen/Build/Eigen-release-prefix/src/Eigen-release-build/CMakeFiles/CMakeTmp



  Run Build Command:"/usr/bin/make" "cmTryCompileExec1400826321/fast"

  /Applications/Xcode.app/Contents/Developer/usr/bin/make -f
  CMakeFiles/cmTryCompileExec1400826321.dir/build.make
  CMakeFiles/cmTryCompileExec1400826321.dir/build

  /usr/local/bin/cmake -E cmake_progress_report
  /Users/dhirvonen/devel/hunter/_Base/xxxxxxx/015448b/b2b5fbe/Build/Eigen/Build/Eigen-release-prefix/src/Eigen-release-build/CMakeFiles/CMakeTmp/CMakeFiles
  1

  Building Fortran object
  CMakeFiles/cmTryCompileExec1400826321.dir/testFortranCompiler.f.o

  /usr/local/bin/gfortran -c
  /Users/dhirvonen/devel/hunter/_Base/xxxxxxx/015448b/b2b5fbe/Build/Eigen/Build/Eigen-release-prefix/src/Eigen-release-build/CMakeFiles/CMakeTmp/testFortranCompiler.f
  -o CMakeFiles/cmTryCompileExec1400826321.dir/testFortranCompiler.f.o

  Linking Fortran executable cmTryCompileExec1400826321

  /usr/local/bin/cmake -E cmake_link_script
  CMakeFiles/cmTryCompileExec1400826321.dir/link.txt --verbose=1

  /usr/local/bin/gfortran -stdlib=libc++
  CMakeFiles/cmTryCompileExec1400826321.dir/testFortranCompiler.f.o -o
  cmTryCompileExec1400826321

  gfortran: error: unrecognized command line option '-stdlib=libc++'

  make[4]: *** [cmTryCompileExec1400826321] Error 1

  make[3]: *** [cmTryCompileExec1400826321/fast] Error 2

There must be a way to avoid this inside libcxx.cmake, which currently specifies:

polly_add_cache_flag(CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++")
polly_add_cache_flag(CMAKE_SHARED_LINKER_FLAGS "-stdlib=libc++")

Why unset EFFECTIVE_PLATFORM_NAME

"-DTINYUNIT_TEST_CMD=$<TARGET_FILE:${TINYUNIT_TEST_TARGET_NAME}>"

This would result

"-DTINYUNIT_TEST_CMD=/Users/travis/build/tinyunit/tinyunit/build/RelWithDebInfo${EFFECTIVE_PLATFORM_NAME}/test_tinyunit_readme_sample.app/test_tinyunit_readme_sample"

ninja-vs-12-2013-win64 toolchain uses GCC

When using the ninja-vs-12-2013-win64 toolchain, CMake uses GCC rather than MSVC. Looking at build.py, it seems like it tries to use the vs envinronment

vs_ninja = toolchain_entry.is_ninja and toolchain_entry.vs_version
if toolchain_entry.is_nmake or vs_ninja:
  os.environ = detail.get_nmake_environment.get(
      toolchain_entry.arch, toolchain_entry.vs_version
  )

but I don't know if that's intended to get Ninja to use the correct compiler.

Here is the head of the log:

Execute command: [
  `where`
  `cmake`
]
[c:\Users\alex\Projects\swish]> "where" "cmake"
C:\ProgramData\chocolatey\bin\cmake.exe
Execute command: [
  `cmake`
  `--version`
]
[c:\Users\alex\Projects\swish]> "cmake" "--version"
cmake version 3.5.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
Execute command: [
  `cmake`
  `-HC:/Users/alex/Projects/swish/`
  `-Bc:\Users\alex\Projects\swish\_builds\ninja-vs-12-2013-win64`
  `-GNinja`
  `-DCMAKE_TOOLCHAIN_FILE=C:\Users\alex\Projects\polly\ninja-vs-12-2013-win64.cmake`
  `-DCMAKE_VERBOSE_MAKEFILE=ON`
  `-DPOLLY_STATUS_DEBUG=ON`
  `-DHUNTER_STATUS_DEBUG=ON`
  `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`
]
[c:\Users\alex\Projects\swish]> "cmake" "-HC:/Users/alex/Projects/swish/" "-Bc:\Users\alex\Projects\swish\_builds\ninja-vs-12-2013-win64" "-GNinja" "-DCMAKE_TOOLCHAIN_FILE=C:\Users\alex\Projects\polly\ninja-vs-12-2013-win64.cmake" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DPOLLY_STATUS_DEBUG=ON" "-DHUNTER_STATUS_DEBUG=ON" "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
-- [hunter *** DEBUG *** 2016-04-16T17:02:59] HUNTER_ROOT set using HOME environment variable
-- [hunter *** DEBUG *** 2016-04-16T17:02:59] HUNTER_ROOT: C:/Users/alex/.hunter
-- [hunter *** DEBUG *** 2016-04-16T17:02:59] Settings (initialize):
-- [hunter *** DEBUG *** 2016-04-16T17:02:59]   HunterGate done (NO)
-- [hunter *** DEBUG *** 2016-04-16T17:02:59]   Cache init (NO)
-- [polly] Used toolchain: Ninja / Visual Studio 2013 / x64
-- [polly *** DEBUG ***] Used tag: ninja-vs-12-2013-win64
-- [polly *** DEBUG ***] CMAKE_DEBUG_POSTFIX is empty
-- [polly *** DEBUG ***] CMAKE_DEBUG_POSTFIX set to 'd'
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [hunter *** DEBUG *** 2016-04-16T17:03:06] List of cache servers:
-- [hunter *** DEBUG *** 2016-04-16T17:03:06]   * https://github.com/ingenue/hunter-cache
-- [hunter *** DEBUG *** 2016-04-16T17:03:06] Settings (finalize):
-- [hunter *** DEBUG *** 2016-04-16T17:03:06]   HunterGate done (NO)
-- [hunter *** DEBUG *** 2016-04-16T17:03:06]   Cache init (NO)
-- [hunter *** DEBUG *** 2016-04-16T17:03:06] Variables from HunterGate:
-- [hunter *** DEBUG *** 2016-04-16T17:03:06]   HUNTER_GATE_ROOT: C:/Users/alex/.hunter
-- [hunter *** DEBUG *** 2016-04-16T17:03:06]   HUNTER_GATE_VERSION: 0.14.12
-- [hunter *** DEBUG *** 2016-04-16T17:03:06]   HUNTER_GATE_SHA1: 2d444140db0d53393b5490604006bb4f4896a444
-- [hunter] Calculating Config-SHA1
-- [hunter] Calculating Toolchain-SHA1
-- [hunter *** DEBUG *** 2016-04-16T17:03:07] [C:/Users/alex/Projects/swish/_builds/ninja-vs-12-2013-win64/_3rdParty/hunter/toolchain] > "C:/ProgramData/chocolatey/lib/cmake.portable/tools/cmake-3.5.1-win32-x86/bin/cmake.exe" "-DTOOLCHAIN_INFO_FILE=C:/Users/alex/Projects/swish/_builds/ninja-vs-12-2013-win64/_3rdParty/hunter/toolchain/toolchain.info" "-DCMAKE_TOOLCHAIN_FILE=C:/Users/alex/Projects/polly/ninja-vs-12-2013-win64.cmake" "-DHUNTER_SELF=C:/Users/alex/.hunter/_Base/Download/Hunter/0.14.12/2d44414/Unpacked" "-GNinja" "-HC:/Users/alex/Projects/swish/_builds/ninja-vs-12-2013-win64/_3rdParty/hunter/toolchain" "-BC:/Users/alex/Projects/swish/_builds/ninja-vs-12-2013-win64/_3rdParty/hunter/toolchain/_builds" "-DCMAKE_RELEASE_POSTFIX=" "-DCMAKE_DEBUG_POSTFIX=d"
-- [polly] Used toolchain: Ninja / Visual Studio 2013 / x64
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done

Verbosity levels

Currently the polly script either compiles everything silently or prints way too much information.

With the --verbose flag the generate_command.append('-DCMAKE_VERBOSE_MAKEFILE=ON') command within the polly.py script makes build output almost unreadable: it is very hard to notice any compiler warnings and errors while building. Of course you could simply pass a --fwd CMAKE_VERBOSE_MAKEFILE=OFF argument to the polly but I personally don't think that verbose output should be default behavior.

Without the --verbose flag where is literally no build progress at all.

My proposal is to introduce something like verbosity levels:

  • silent - same as current behavior without the --verbose flag
  • normal - normal CMake output without compiler arguments -DCMAKE_VERBOSE_MAKEFILE=OFF
  • full - same as current behavior with the --verbose flag

Is it possible to run tests against lib binary

I have a project that uses polly to build a library for iOS and OSX, I have added unit tests via ctest which executes a class that uses GTest

I have one question, I have to add all the library source files to the runUnitTest exe definition.

e.g. I have added the following to my to level CMakeLists.txt

# Unit Tests

if(IOS)
    add_test(
            NAME SimpleTest COMMAND "${CMAKE_COMMAND}" -E echo "iOS testing ignored"
    )
else()
    add_executable(runUnitTests foo_unit_tests.cpp ${LIB_SOURCE_FILES} )
    target_link_libraries(runUnitTests PUBLIC GTest::main)

    enable_testing()

    add_test(NAME SimpleTest COMMAND runUnitTests)
endif()

Is there a way force the library to build and link to it rather than pull in all the library source to the unit tests?

My library is defined as

add_library(foo SHARED ${LIB_SOURCE_FILES})

I hoped it would build and link to the tests if I added:

target_link_libraries(runUnitTests PUBLIC foo)

But that caused the linker to fail when trying to find the foo library symbols used in the tests.

ios-nocodesign* does not work but for IOS_SDK_VERSION 8.1

The ios-nocodesign*.cmake files contain a statement that forces the variable IOS_SDK_VERSION to 8.1.
We tested them at least with IOS_SDK_VERSION 9.1 and they work fine, but there is no explicitly way other than manually modify those files to change that parameter.
Is it possible to let the user to dynamically change it or update those file with a newer sdk version?
In the latter case, we can proceed with a pull request if needed.

Discussion: build.py output path override

This is probably a rare use case, but...

If a hunter (or any CMake) project resides on a disk that is shared across different machines, then it is possible for the same toolchain (say libcxx) to be run multiple times, which could lead to collisions. Currently, I don't think there is a way for a user to override the generated ${PROJECT}/_{install,build}/${TOOLCHAIN} paths. It is easy enough to create a dummy libcxx-linux.cmake or libccxx-osx.cmake toolchain to accomplish this, but there might be other scenarios where the user may want to modify or append to the generated path as well.

Setting public headers for Xcode framework target

I have built the 02-library example for Xcode with the following command:

build.py --clear --toolchain xcode --framework

This built a Framework, but it does not have any public headers in the framework Headers folder.

I added a public.h file to the example and added the following entry in the CMakeLists.txt

set_target_properties(
        foo PROPERTIES
        PUBLIC_HEADER public.h)

When building the public.h file is copied to '_install/xcode/lib/'

But the build fails with the error:

Expected only one lib in directory: .../_install/xcode/lib
But found: ['.../_install/xcode/lib/libfood.a', '.../_install/xcode/lib/public.h']

What is the correct way to configure the public headers for a framework build.

Conditional cmake configuration based on toolchain

What is best practice to configure cmake conditionally based on toolchain, it looks like 'POLLY_TOOLCHAIN_TAG' might be the way to go?

e.g. I only want to set target property 'XCODE_ATTRIBUTE_ENABLE_BITCODE YES' when using any of the iOS toolchains.

add a doxygen flag

Add a --doxygen flag assuming CMakeLists.txt contains something like the following example:

Doxygen example

${CMAKE_ROOT_DIR}/CMakeLists.txt

find_package(Doxygen)
option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND})

get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
  message(STATUS "VARIABLE: ${_variableName}=${${_variableName}}")
endforeach()

if(BUILD_DOCUMENTATION)
  if(NOT DOXYGEN_FOUND)
    message(FATAL_ERROR "Doxygen is needed to build the documentation.")
  endif()
  set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in)
  set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
  configure_file(${doxyfile_in} ${doxyfile} @ONLY)
  add_custom_target(doc
    COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    COMMENT "Generating API documentation with Doxygen"
    VERBATIM
    )
  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc)
  message("Generating doxygen comments")
endif()

${CMAKE_ROOT_DIR}/doc/Doxyfile.in

PROJECT_NAME           = "@CMAKE_PROJECT_NAME@"
PROJECT_NUMBER         = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
STRIP_FROM_PATH        = @PROJECT_SOURCE_DIR@ \
                         @PROJECT_BINARY_DIR@
INPUT                  = @doxy_main_page@ \
                         @PROJECT_SOURCE_DIR@ \
                         @PROJECT_BINARY_DIR@

EXCLUDE_PATTERNS       = */.svn/* \
                         */.git/* \
                         */doc/* \
                         */src/3rdparty/*

FILE_PATTERNS          = *.h \
                         *.hpp \
                         *.cc \
                         *.cpp \
                         *.c \

ENABLE_PREPROCESSING   = YES
MACRO_EXPANSION        = YES
EXPAND_ONLY_PREDEF     = NO

RECURSIVE              = YES
USE_MDFILE_AS_MAINPAGE = @doxy_main_page@

I can add this if there are no objections.

XCode 8 and iOS 10 Support

I recently updated to XCode 8 and the iOS 10 SDK. I have been using the ios-9-3.cmake toolchain with great success. I have tried to copy it to a new toolchain file, ios-10-0.cmake, updating set(IOS_SDK_VERSION 10.0). Unfortunately, this is not enough. I get the error message below when running cmake -GXcode -DCMAKE_TOOLCHAIN_FILE=polly/ios-10-0.cmake:

Found iOS SDK Version = 10.0
-- [polly] Used toolchain: iOS 10.0 Universal (iphoneos + iphonesimulator) / clang / c++11 support
-- The C compiler identification is AppleClang 8.0.0.8000038
-- The CXX compiler identification is AppleClang 8.0.0.8000038
-- Check for working C compiler using: Xcode
-- Check for working C compiler using: Xcode -- broken
CMake Error at /usr/local/Cellar/cmake/3.5.2/share/cmake/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
is not able to compile a simple test program.

It fails with the following output:

Change Dir: /Users/<...>/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/xcodebuild" "-project"
"CMAKE_TRY_COMPILE.xcodeproj" "build" "-target" "cmTC_e2b54"
"-configuration" "Debug"

=== BUILD TARGET cmTC_e2b54 OF PROJECT CMAKE_TRY_COMPILE WITH CONFIGURATION
Debug ===

Check dependencies

Signing for "cmTC_e2b54" requires a development team. Select a development
team in the project editor.

Code signing is required for product type 'Application' in SDK 'iOS 10.0'

** BUILD FAILED **

The following build commands failed:

  Check dependencies

(1 failure)

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred!
See also "/Users/<...>/CMakeFiles/CMakeOutput.log".
See also "/Users/<...>/CMakeFiles/CMakeError.log".

As one can see XCode now requires a development team for code signing to work. I tried adding set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "iPhone Developer Team") but this results in:

Check dependencies

No profiles for 'com.example' were found: Xcode couldn't find a
provisioning profile matching 'com.example'.

Code signing is required for product type 'Application' in SDK 'iOS 10.0'

Does anyone have an idea to get around this issue?

Single toolchain for Android platform

Instead of having a toolchain for every ABI, NDK version and API combination of Android, why not have a file that requires an environment variable to be set specifying the versions?

I use this myself because I can never end up with the same NDK versions. I'm not even sure why that exists at all.

Like this:

if(DEFINED POLLY_ANDROID_NDK_CMAKE_)
  return()
else()
  set(POLLY_ANDROID_NDK_CMAKE_ 1)
endif()

set(ANDROID_NDK_VERSION $ENV{ANDROID_NDK_VERSION})
set(ANDROID_NATIVE_API_LEVEL $ENV{ANDROID_NATIVE_API_LEVEL})
set(ANDROID_ABI $ENV{ANDROID_ABI})
set(ANDROID_NDK $ENV{ANDROID_NDK})

include("${CMAKE_CURRENT_LIST_DIR}/../polly/utilities/polly_clear_environment_variables.cmake")

include("${CMAKE_CURRENT_LIST_DIR}/../polly/utilities/polly_init.cmake")

polly_init(
    "Android NDK ${ANDROID_NDK_VERSION} / \
API ${ANDROID_NATIVE_API_LEVEL} / ${ANDROID_ABI} / \
c++11 support"
    "Unix Makefiles"
)

include("${CMAKE_CURRENT_LIST_DIR}/../polly/utilities/polly_common.cmake")

include("${CMAKE_CURRENT_LIST_DIR}/../polly/flags/cxx11.cmake") # before toolchain!

include("${CMAKE_CURRENT_LIST_DIR}/../polly/os/android.cmake")

ios-9-2 toolchain failure

I had been building a framework for iOS without error using:

./buildtools/polly/bin/build.py --clear --toolchain ios-9-2 --framework --config Release

I have been adding unit tests and I upgraded Boost to 1.60.0, I did this while building the framework for Xcode toolchain without error.

On going back to build with the iOS-9-2 toolchain the build now fails, I have Xcode 7.2.1 installed and it appears I am seeing the following issue

At the end of the ticket the simplest solution appears to be:

Another workaround is to pass PLATFORM_NAME=iphonesimulator to xcodebuild, in addition to -sdk iphonesimulator.

I'd like to try this, but I'm not sure which is the right .cmake to add the option.

Add .polly

Use ~/.polly and local .polly (do we need local?) to add some default user's arguments like --jobs N or --fwd HUNTER_CONFIGURATION_TYPES=Release. .polly can be ini-like file. E.g. say we have several devices:

  • iPad with iOS 9.0
  • iPhone with iOS 9.1
  • HTC One with Android API 21
  • Prestigio with Android API 19

~/.polly can contain:

[global] # reserved type
  jobs = N
  fwd = HUNTER_CONFIGURATION_TYPES=Release # is it correct syntax?
  verbose = True
[ipad]
  toolchain = ios-9-0-armv7
[iphone]
  toolchain = ios-9-1-armv7
[htc]
  toolchain = android-ndk-r10e-api-21-arm64-v8a
[prest]
  toolchain = android-ndk-r10e-api-19-armeabi-v7a-neon

Usage: build.py --type htc or build.py --class htc

"minor" changes to build.py command require --clear

I've noticed simple command line changes to build.py require rebuilding entirely due to the need for --clear on subsequent runs. For example, after running

build.py 

cleanly, I then realized I wanted to install the output, so I tried

build.py --install

But this seems to trigger the warning

Looks like cmake arguments changed. Please remove build directory by adding '--clear'.

Which forces a full (possibly very length) rebuild. The same is true with adding --verbose. I suppose this requires more internal logic, but it does limit an otherwise very convenient build.py script. Definitely not critical.

iOS version not found

Hi ruslo!, thank you for your great project.
Currently, I'm working on Xcode 7.3. and I can only build when I choose iOS version is 9.3. when I build with other iOS version, errors will appear

cmake -H. -B_builds/ios-8-0 -GXcode -DCMAKE_TOOLCHAIN_FILE="${POLLY_ROOT}/ios-8-0.cmake" -DHUNTER_STATUS_DEBUG=ON

result:
iOS version 8.0 not found (64)
CMake Error at /Users/hungbv/Desktop/polly/utilities/polly_fatal_error.cmake:10 (message):
Call Stack (most recent call first):
/Users/hungbv/Desktop/polly/os/iphone.cmake:63 (polly_fatal_error)
/Users/hungbv/Desktop/polly/ios-8-0.cmake:36 (include)
/usr/local/Cellar/cmake/3.5.2/share/cmake/Modules/CMakeDetermineSystem.cmake:98 (include)
CMakeLists.txt:9 (PROJECT)

Could you please let me know how to solve this problem? thank you :)

CLI flexibility to reduce exponential toolchain file explosion

I've started adding a number of toolchains I need to support based on combinations of : ANDROID_TOOLCHAIN_NAME + ANDROID_NATIVE_API_LEVEL + ANDROID_ABI + etc. There are similar combinations for *nix platforms and ios. This seems headed for an explosion of *.cmake toolchains in the ${POLLY_ROOT} directory. I'm wondering if it would make sense to extend to build.py command line options to provide dynamic toolchain configurations. I suppose that introduces a fair amount of additional complexity to avoid "undefined" toolchains. We would probably need to define a top level ND matrix of valid parameter configurations for each base toolchain (e.g., android.toolchain.cmake, etc.) with appropriate warnings for bad or untested configurations.

@ruslo I'm fairly sure you've already thought through this at some level, but I wanted to post a discussion item here to review options.

Proposal: --framework 'identity'

I'd like to add an optional identity parameter for --framework option code signing. If no argument is specified it can default to 'iPhone Developer' for backwards compatibility, but this can get in the way of distribution.

https://github.com/ruslo/polly/blob/master/bin/detail/create_framework.py#L132

@ruslo: You implemented this feature, so I wanted to check with you before adding.

    sign_cmd = [
        'codesign', '--force', '--sign', 'iPhone Developer', framework_dir
    ]
    detail.call.call(sign_cmd, logging)

Proposal: --info <info.plist> override as modifier for --framework option

Allow project specific override of polly/scripts/Info.plist. This will allow customization of CFBundleIdentifier and other parameters.

@ruslo: If this makes sense I can implement it and push.

https://github.com/ruslo/polly/blob/master/bin/detail/create_framework.py#L111

 framework_plist = os.path.join(framework_dir, 'Info.plist')
    shutil.copy(
        os.path.join(polly_root, 'scripts', 'Info.plist'),  <== override this
        framework_plist
    )

Build failed while run with caffe framework

I tried with ios-8-2.cmake tool chain against "https://github.com/BVLC/caffe" to bulid caffe lib_a,dylip for iOS. Generate Xcode project completed. While build the Xcode project i got the below error
"/Users/Macpro_ios_v2/caffe/src/caffe/common.cpp:1:10: 'glog/logging.h' file not found"
while cross compiling mac to iOS only i am getting this issue.
Environment: Xcode 6.2, iOS 8.2, CMake 3.2
Please help me to fix this issue.

Using clang-analyze in Hunter build

Should the clang-analyze script should continue to rebuild with clang after reporting warnings for a library using clang analyze?

I've attached my console log for a build which uses opencv, the build exits after opencv fails to build.

/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Source/modules/core/src/matrix.cpp:3650:13: warning: Access to field 'dims' results in a dereference of a null pointer (loaded from variable 'm')
    create( m->dims, &m->size[0], m->type );
            ^~~~~~~
/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Source/modules/core/src/matrix.cpp:3741:19: warning: Access to field 'dims' results in a dereference of a null pointer (loaded from field 'hdr')
        m.create( hdr->dims, hdr->size, rtype );
                  ^~~~~~~~~
/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Source/modules/core/src/matrix.cpp:3833:24: warning: Called C++ object pointer is null
    size_t hidx = h & (hdr->hashtab.size() - 1), nidx = hdr->hashtab[hidx];
                       ^~~~~~~~~~~~~~~~~~~
/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Source/modules/core/src/matrix.cpp:3855:24: warning: Called C++ object pointer is null

[hunter ** FATAL ERROR **] Build step failed (dir: /home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV
[hunter ** FATAL ERROR **] [Directory:/home/oliver.daniell/jenkins/workspace/.hunter/_Base/Download/Hunter/0.11.18-seebyte/036f433/Unpacked/cmake/projects/OpenCV]

------------------------------ WIKI -------------------------------
    https://github.com/ruslo/hunter/wiki/error.external.build.failed
-------------------------------------------------------------------

CMake Error at /home/oliver.daniell/jenkins/workspace/.hunter/_Base/Download/Hunter/0.11.18-seebyte/036f433/Unpacked/cmake/modules/hunter_wiki.cmake:12 (message):
Call Stack (most recent call first):
  /home/oliver.daniell/jenkins/workspace/.hunter/_Base/Download/Hunter/0.11.18-seebyte/036f433/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_wiki)
  /home/oliver.daniell/jenkins/workspace/.hunter/_Base/Download/Hunter/0.11.18-seebyte/036f433/Unpacked/cmake/modules/hunter_download.cmake:384 (hunter_fatal_error)
  /home/oliver.daniell/jenkins/workspace/.hunter/_Base/Download/Hunter/0.11.18-seebyte/036f433/Unpacked/cmake/projects/OpenCV/hunter.cmake:165 (hunter_download)
  /home/oliver.daniell/jenkins/workspace/.hunter/_Base/Download/Hunter/0.11.18-seebyte/036f433/Unpacked/cmake/modules/hunter_add_package.cmake:87 (include)
  modules/CMakeLists.txt:3 (hunter_add_package)


    size_t hidx = h & (hdr->hashtab.size() - 1), nidx = hdr->hashtab[hidx];
                       ^~~~~~~~~~~~~~~~~~~
/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Source/modules/core/src/matrix.cpp:3877:24: warning: Called C++ object pointer is null
    size_t hidx = h & (hdr->hashtab.size() - 1), nidx = hdr->hashtab[hidx];
                       ^~~~~~~~~~~~~~~~~~~
/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Source/modules/core/src/matrix.cpp:3899:16: warning: Access to field 'dims' results in a dereference of a null pointer (loaded from field 'hdr')
    int i, d = hdr->dims;
               ^~~~~~~~~
/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Source/modules/core/src/matrix.cpp:3924:24: warning: Called C++ object pointer is null
    size_t hidx = h & (hdr->hashtab.size() - 1), nidx = hdr->hashtab[hidx], previdx=0;
                       ^~~~~~~~~~~~~~~~~~~
/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Source/modules/core/src/matrix.cpp:3943:24: warning: Called C++ object pointer is null
    size_t hidx = h & (hdr->hashtab.size() - 1), nidx = hdr->hashtab[hidx], previdx=0;
                       ^~~~~~~~~~~~~~~~~~~
/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Source/modules/core/src/matrix.cpp:3962:16: warning: Access to field 'dims' results in a dereference of a null pointer (loaded from field 'hdr')
    int i, d = hdr->dims;
               ^~~~~~~~~
/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Source/modules/core/src/matrix.cpp:4017:20: warning: Called C++ object pointer is null
    size_t hsize = hdr->hashtab.size();
                   ^~~~~~~~~~~~~~~~~~~
/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Source/modules/core/src/matrix.cpp:4228:26: warning: Array access (from variable 'minidx') results in a null pointer dereference
            _minidx[i] = minidx[i];
                         ^~~~~~~~~
/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Source/modules/core/src/matrix.cpp:4231:26: warning: Array access (from variable 'maxidx') results in a null pointer dereference
            _maxidx[i] = maxidx[i];
                         ^~~~~~~~~
31 warnings generated.
+ rm -f /tmp/polly-clang-analyze.out.3VF2M
+ rm -f /tmp/polly-clang-analyze.bin.83JNc
+ '[' 1 == 1 ']'
+ exit 1
make[5]: Leaving directory `/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Build/OpenCV-Release-prefix/src/OpenCV-Release-build'
make[4]: Leaving directory `/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Build/OpenCV-Release-prefix/src/OpenCV-Release-build'
make[5]: *** [modules/core/CMakeFiles/opencv_core.dir/src/matrix.cpp.o] Error 1
make[4]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make[3]: Leaving directory `/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Build/OpenCV-Release-prefix/src/OpenCV-Release-build'
make[3]: *** [all] Error 2
make[2]: Leaving directory `/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Build'
make[1]: Leaving directory `/home/oliver.daniell/jenkins/workspace/.hunter/_Base/036f433/9b60785/8934262/Build/OpenCV/Build'
make[2]: *** [OpenCV-Release-prefix/src/OpenCV-Release-stamp/OpenCV-Release-install] Error 2
make[1]: *** [CMakeFiles/OpenCV-Release.dir/all] Error 2
make: *** [all] Error 2
-- Configuring incomplete, errors occurred!
See also "/home/oliver.daniell/jenkins/workspace/MSHDF/b0491c07/_builds/analyze-Debug/CMakeFiles/CMakeOutput.log".
Command exit with status "1": [/home/oliver.daniell/jenkins/workspace/MSHDF/b0491c07]> "cmake" "-H." "-B/home/oliver.daniell/jenkins/workspace/MSHDF/b0491c07/_builds/analyze-Debug" "-DCMAKE_BUILD_TYPE=Debug" "-GUnix Makefiles" "-DCMAKE_TOOLCHAIN_FILE=/home/oliver.daniell/jenkins/workspace/MSHDF/b0491c07/polly/analyze.cmake" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DPOLLY_STATUS_DEBUG=ON" "-DHUNTER_STATUS_DEBUG=ON" 

Log: /home/oliver.daniell/jenkins/workspace/MSHDF/b0491c07/_builds/analyze-Debug/_3rdParty/polly/log.txt
*** FAILED ***
Run script: /home/oliver.daniell/jenkins/workspace/MSHDF/b0491c07/polly/bin/build.py
Toolchain: analyze
Config: Debug
Command '['/usr/bin/python3', '/home/oliver.daniell/jenkins/workspace/MSHDF/b0491c07/polly/bin/build.py', '--toolchain', 'analyze', '--config', 'Debug', '--verbose', '--clear', '--test']' returned non-zero exit status 1
None
Build step 'Conditional step (single)' marked build as failure
Finished: FAILURE```

Error debugging the generated .so library on Android

While trying to debug a library compiled with Polly for Android, we are getting the following error:

/[...]/development/android-ndk-r10e/build/core/add-application.mk:199: *** Android NDK: Aborting... . Stop.

The suggestion that comes along with the error is:

  • Rebuilt with the NDK_DEBUG=1 option when calling 'ndk-build'.

We are compiling the library in debug mode (CMAKE_BUILD_TYPE=Debug) and, as far as I see from the log of the compiler, the right flags are set (-O0 -g and so on).

It seems that gdbserver and gdb.setup are not created, thus it is not possible to debug the application on the target system.
Am I missing something or Polly actually lacks it?

Android MIPS architecture missed

The Android MIPS architecture is missed in the list of available toolchains.
Is there a particular reason, thus it doesn't worth it to try to add such a toolchain and send a pull request?
I need it as an user and I'd be glad to contribute to the project if needed.

Thank you.

Android toolchain breaks ExternalProject_Add behaviour

ExternalProject_Add command heavily depends on the find_package command in order to find SVN, GIT, and other applications. But the android toolchain explicitly sets the find_program behaviour to ignore host applications with the following command set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY ).

This leads to the following error error: could not find svn for checkout ${name}

According to the CMake documentation:

By default at first the directories listed in CMAKE_FIND_ROOT_PATH are searched, then the CMAKE_SYSROOT directory is searched, and then the non-rooted directories will be searched.

So I assume it's safe to remove the CMAKE_FIND_ROOT_PATH_MODE_PROGRAM line.

--framework with *.a and *.dylib in _install/<toolchain>/lib complains

I changed configurations and ended up with a *.a and *.dylib in my _install//lib/ folder. The build.py --framework option complained about multiple libs. This was with commit: a9443b4 . This isn't exactly as bug... (How should it know which type of lib to use?) It is easy enough to delete one and then re-run, but possibly an additional option is required to specify the desired framework type in cases where both libs are present. How do you want to handle this (or just leave as is)? I can probably modify as needed once I get past a couple deadlines.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.