ocaml-cross / opam-cross-ios Goto Github PK
View Code? Open in Web Editor NEWAn OCaml cross-toolchain for iOS and several useful libraries
An OCaml cross-toolchain for iOS and several useful libraries
macOS Sonoma, M1 Mac Mini.
After following the README instructions for setting up a 5.0.0 switch for the simulator (ARCH=arm64 SUBARCH=arm64) attempting to build the sample program results in an ocamlfind error:
ocamlfind -toolchain ios ocamlopt -package re.pcre -linkpkg -output-complete-obj test_pcre.ml -o test_pcre.o
ocamlfind: Package `threads' not found
Querying threads does work:
ocamlfind query threads
/Users/nickmain/.opam/ios-sim/lib/ocaml/threads
URL link is no longer valid. The link below works:
https://sourceforge.net/projects/libpng/files/libpng16/older-releases/1.6.21/libpng-1.6.21.tar.gz
The ioscaml.sh generates an armv7s target for arm32. I believe this should be armv7, as I think Apple requires armv7 and armv7s is optional.
I try to get a simple example from http://www.mega-nerd.com/erikd/Blog/CodeHacking/Ocaml/index.html running on iOS but end up with the following error:
To my XCode configuration:
I added /Users/sascha/.opam/4.04.0+ios+amd64/ios-sysroot/lib/ocaml/
to my library and header search paths and added libasmrun.a
from /Users/sascha/.opam/4.04.0+ios+amd64/ios-sysroot/lib/ocaml/
as a library to XCode.
To install everything I followed your readme instructions,
Any assistance would be greatly appreciated!
FYI, I have upgraded this repo to OPAM 2.0 format, added new versions of cross toolchains, and ported extra packages in dboris/opam-cross-ios. Let me know if you are interested in some or all of these changes, and I can submit a PR.
Hi, could you please update this project for OCaml 4.04.1+?
I am attempting to follow the instructions in the readme and get the following errors for opam install ocaml-ios re-ios
:
* Missing dependency:
- ocaml-ios → ocaml-ios64 >= 5.0.0
unmet availability conditions: 'arch = "x86_64"'
I deviated from the instructions when installing conf-ios
by using ARCH=arm64 SUBARCH=arm64 PLATFORM=iPhoneSimulator
since the iOS simulator on Apple Silicon is now Arm, not Intel. I assume this is the cause of the errors.
Please take this into account when updating this package.
Could you up to this 4.03.0?
Would love to get some guidance how to resolve the following error:
opam install ocaml-ios re-ios
The following dependencies couldn't be met:
- ocaml-ios → ocaml-ios32
unmet availability conditions: conf-ios:arch = "arm" | conf-ios:arch = "i386"
- ocaml-ios → ocaml-ios64
unmet availability conditions: conf-ios:arch = "arm64" | conf-ios:arch = "amd64"
No solution found, exiting
Here's what gets written to conf-ios
when following the instructions in README.md
:
If I see how to update the README, or other I'll try to send a PR. Thanks.
arch: "arm64"
subarch: "arm64"
platform: "iPhoneOS"
sdk: "9.3"
sysroot:
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk"
cflags:
"-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -miphoneos-version-min="
ldflags:
"-Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk"
triple: "arm-apple-darwin"
triplereal: "aarch64-apple-darwin"
Hello, I am not sure if this is the right repo, but is there a plan to support cross-compilation from x64 Linux to x64/arm64 Mac? If there are big obstacles for that is there any description of them to estimate the cost of such support?
What about the reverted scenario of host mac and target linux?
Thank you.
See output below for build with ios32.
The definition in stdlib.h for system is as follows:
__swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable")
__API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED
__WATCHOS_PROHIBITED __TVOS_PROHIBITED
int system(const char *) __DARWIN_ALIAS_C(system);
We tried to install tgls-ios and got the following errors. Please see output below & let me know if you need further details.
--Mark
The following actions will be performed:
∗ install tgls-ios 0.8.5
=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫
�[KProcessing 1/1: [tgls-ios: http]
�[K
�[KProcessing 1/1: [tgls-ios: http]
�[K[tgls-ios.0.8.5] http://erratique.ch/software/tgls/releases/tgls-0.8.5.tbz downloaded
=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫
�[KProcessing 1/1: [tgls-ios: env ocaml]
�[K[ERROR] The compilation of tgls-ios failed at "env TOPKG_CONF_TOOLCHAIN=ios
TGLS_HOST_OS=Linux ocaml pkg/pkg.ml build --pinned false --with-gl
false".
�[KProcessing 1/1: [tgls-ios: ocamlfind ios]
#=== ERROR while installing tgls-ios.0.8.5 ====================================#
# opam-version 1.2.2
# os darwin
# command env TOPKG_CONF_TOOLCHAIN=ios TGLS_HOST_OS=Linux ocaml pkg/pkg.ml build --pinned false --with-gl false
# path /Users/mhayden/.opam/ios32/build/tgls-ios.0.8.5
# compiler 4.04.0+32bit
# exit-code 1
# env-file /Users/mhayden/.opam/ios32/build/tgls-ios.0.8.5/tgls-ios-8216-d2c37b.env
# stdout-file /Users/mhayden/.opam/ios32/build/tgls-ios.0.8.5/tgls-ios-8216-d2c37b.out
# stderr-file /Users/mhayden/.opam/ios32/build/tgls-ios.0.8.5/tgls-ios-8216-d2c37b.err
### stdout ###
# ocamlfind ocamlopt unix.cmxa -I /Users/mhayden/.opam/ios32/lib/ocamlbuild /Users/mhayden/.opam/ios32/lib/ocamlbuild/ocamlbuildlib.cmxa -linkpkg myocamlbuild.ml /Users/mhayden/.opam/ios32/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# ocamlfind ocamldep -package ctypes -package bytes -modules src/tgles2.ml > src/tgles2.ml.depends
# + ocamlfind ocamldep -package ctypes -package bytes -modules src/tgles2.ml > src/tgles2.ml.depends
# ocamlfind: Package `ctypes' not found
# Command exited with code 2.
### stderr ###
# pkg.ml: [ERROR] cmd ['ocamlbuild' '-use-ocamlfind' '-classic-display' '-tag' 'debug'
# [...]
# 'README.md' 'src/tgles2.a' 'src/tgles2.cmxa' 'src/tgles2.cma'
# 'src/tgles2.cmx' 'src/tgles2.cmi' 'src/tgles2.mli' 'src/tgles3.a'
# 'src/tgles3.cmxa' 'src/tgles3.cma' 'src/tgles3.cmx' 'src/tgles3.cmi'
# 'src/tgles3.mli' 'src/dlltgles2.so' 'src/libtgles2.a' 'src/dlltgles3.so'
# 'src/libtgles3.a' 'src/tgles2_top.a' 'src/tgles2_top.cmxa'
# 'src/tgles2_top.cma' 'src/tgles2_top.cmx' 'src/tgles3_top.a'
# 'src/tgles3_top.cmxa' 'src/tgles3_top.cma' 'src/tgles3_top.cmx'
# 'test/assert_sizes.c' 'test/trigles2.ml' 'test/trigles3.ml'
# 'test/linkgles2.ml' 'test/linkgles3.ml']: exited with 10
�[K
=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫
The following actions failed
∗ install tgls-ios 0.8.5
No changes have been performed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.