Closed 11janson closed 9 months ago
Please post your complete issue here, thanks.
Please post your complete issue here, thanks.
hello,I have complete this issue.
I believe the issue here is that the system
function is not available on iOS. From the MacOSX.sdk stdlib.h
__swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)")
__API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED
__WATCHOS_PROHIBITED __TVOS_PROHIBITED
int system(const char *) __DARWIN_ALIAS_C(system);
A fix for you could be to conditionally compile the system
call in DecisionTree-inl.h
. That is the only place it is used. We would welcome a PR and I can help land it. It should be really simple to fix.
I believe the issue here is that the
system
function is not available on iOS. From the MacOSX.sdkstdlib.h
__swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)") __API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED __WATCHOS_PROHIBITED __TVOS_PROHIBITED int system(const char *) __DARWIN_ALIAS_C(system);
A fix for you could be to conditionally compile the
system
call inDecisionTree-inl.h
. That is the only place it is used. We would welcome a PR and I can help land it. It should be really simple to fix.
Thanks. I will push a PR a few days later.
@11janson since we don't officially support iOS, your best bet moving forward is to fork GTSAM and either remove that function or conditionally compile it for your purposes. Closing this issue.
I believe the issue here is that the
system
function is not available on iOS. From the MacOSX.sdkstdlib.h
__swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)") __API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED __WATCHOS_PROHIBITED __TVOS_PROHIBITED int system(const char *) __DARWIN_ALIAS_C(system);
A fix for you could be to conditionally compile the
system
call inDecisionTree-inl.h
. That is the only place it is used. We would welcome a PR and I can help land it. It should be really simple to fix.Thanks. I will push a PR a few days later.
Did you push a PR for this?
Thanks for your reply. I want to use gtsam with an iPad app, so need to compile gtsam on the iOS, but failed both on the Conan and vcpkg, and looks like same errors:
/Users/janson/.conan2/p/b/gtsamd04a918ac3f64/b/src/gtsam/discrete/DecisionTree-inl.h:966:9: error: 'system' is unavailable: not available on iOS
Description
https://github.com/conan-io/conan-center-index/issues/21725 https://github.com/conan-io/conan-center-index/issues/21725
Steps to reproduce
this is the whole logs using Conan:
janson@jansondeMac-mini simple_cmake_project % conan install . --output-folder=build --build=missing --profile:host=ios_profile --profile:build=default
======== Input profiles ======== Profile host: [settings] arch=armv8 build_type=Release compiler=apple-clang compiler.libcxx=libc++ compiler.version=12.0 os=iOS os.sdk=iphoneos os.version=12.0
Profile build: [settings] arch=x86_64 build_type=Release compiler=apple-clang compiler.cppstd=gnu17 compiler.libcxx=libc++ compiler.version=15 os=Macos
======== Computing dependency graph ======== Graph root conanfile.txt: /Users/janson/Documents/workspace2024/conan/examples2/tutorial/consuming_packages/simple_cmake_project/conanfile.txt Requirements boost/1.82.0#7c9cc60d65d6942a56d4806ab85bda7c - Cache bzip2/1.0.8#411fc05e80d47a89045edc1ee6f23c1d - Cache eigen/3.4.0#2e192482a8acff96fe34766adca2b24c - Cache gtsam/4.2.0a9#d31b625288070edd7a353e83cb69a44f - Cache libbacktrace/cci.20210118#ec1aa63bbc10145c6a299e68e711670c - Cache zlib/1.3#06023034579559bb64357db3a53f88a4 - Cache Build requirements b2/4.10.1#8dc3df1cc73ad65d86cbdfd31fdb011f - Cache Resolved version ranges zlib/[>=1.2.11 <2]: zlib/1.3
======== Computing necessary packages ======== Requirements boost/1.82.0#7c9cc60d65d6942a56d4806ab85bda7c:f460c9c58437ba7aad62d1be01b0a9088b624d15 - Build bzip2/1.0.8#411fc05e80d47a89045edc1ee6f23c1d:83af81a24462d537e70c80a5a894761fa7012d4e#ccc1d60f9ad48fea001aef89781209ab - Cache eigen/3.4.0#2e192482a8acff96fe34766adca2b24c:da39a3ee5e6b4b0d3255bfef95601890afd80709#b2e7c2d86c5d1dbefc534889aa72e12c - Cache gtsam/4.2.0a9#d31b625288070edd7a353e83cb69a44f:d72c1e1aa3a94fb3df4629a2ec154f20a5e3ffdf - Build libbacktrace/cci.20210118#ec1aa63bbc10145c6a299e68e711670c:f982d85e89b5609eade6f460978e5f30efe96dea#a377bd42178e7944fbd92deceac11063 - Cache zlib/1.3#06023034579559bb64357db3a53f88a4:f982d85e89b5609eade6f460978e5f30efe96dea#0e0c0ada7b5cc66c1f65ff993522b764 - Cache Build requirements b2/4.10.1#8dc3df1cc73ad65d86cbdfd31fdb011f:82339cc4d6db7990c1830d274cd12e7c91ab18a1#93ca405597cc44478fec2b8fe8c855ec - Cache
======== Installing packages ======== b2/4.10.1: Already installed! (1 of 7) bzip2/1.0.8: Already installed! (2 of 7) eigen/3.4.0: Already installed! (3 of 7) libbacktrace/cci.20210118: Already installed! (4 of 7) zlib/1.3: Already installed! (5 of 7)
-------- Installing package boost/1.82.0 (6 of 7) -------- boost/1.82.0: Building from source boost/1.82.0: Package boost/1.82.0:f460c9c58437ba7aad62d1be01b0a9088b624d15 boost/1.82.0: Building your package in /Users/janson/.conan2/p/b/boost7267bb74a7057/b boost/1.82.0: Calling generate() boost/1.82.0: Generators folder: /Users/janson/.conan2/p/b/boost7267bb74a7057/b/build-release/conan boost/1.82.0: Generating aggregated env files boost/1.82.0: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh'] boost/1.82.0: Calling build() boost/1.82.0: WARN: replace_in_file didn't find pattern '$(>) > $(<)' in '/Users/janson/.conan2/p/boost07b80a7bd5806/s/src/libs/stacktrace/build/Jamfile.v2' file. boost/1.82.0: WARN: replace_in_file didn't find pattern 'local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;' in '/Users/janson/.conan2/p/boost07b80a7bd5806/s/src/tools/build/src/tools/gcc.jam' file. boost/1.82.0: WARN: replace_in_file didn't find pattern 'local no-threading = android beos haiku sgi darwin vxworks ;' in '/Users/janson/.conan2/p/boost07b80a7bd5806/s/src/tools/build/src/tools/gcc.jam' file. boost/1.82.0: WARN: replace_in_file didn't find pattern '@numa' in '/Users/janson/.conan2/p/boost07b80a7bd5806/s/src/libs/fiber/build/Jamfile.v2' file.
boost/1.82.0: WARN: Patching user-config.jam
boost/1.82.0: WARN:
using zlib : 1.3 : "/Users/janson/.conan2/p/b/zlibbd1591f44d1a1/p/include" "/Users/janson/.conan2/p/b/zlibbd1591f44d1a1/p/lib" z ;
using bzip2 : 1.0.8 : "/Users/janson/.conan2/p/b/bzip2b42aa1836710f/p/include" "/Users/janson/.conan2/p/b/bzip2b42aa1836710f/p/lib" bz2 ;
using "clang-darwin" : : "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk -arch arm64 :