Hello.
I’m trying to compile hello-world.kt with kotlin-native compiler. But it start to fetch its dependencies.
Could I use default system clang\llvm for it? My system (debian linux) has clang-6.0/llvm-6.0 installed.
Thank you.
konanc -o hello-native hello-native.kt
Downloading native dependencies (LLVM, sysroot etc). This is a one-time action performed only on the first run of the compiler.
Downloading dependency: https://download.jetbrains.com/kotlin/native/clang-llvm-5.0.0-linux-x86-64.tar.gz
konanc -version
info: kotlinc-native 1.2.50-dev-515 (JRE 1.8.0_172-b11)
Kotlin/Native: 0.7
If you already downloaded the compiler manually you may specify the path to its root directory using konan.home project property (e.g. in gradle.properties). konan.home=/home/user/kotlin-native-0.5
In this case the compiler will not be downloaded by the plugin.
My system has downloaded and installed kotlin-native compiler. /opt/kotlin-native-linux-0.7
My system has environment variables for kotlin-native compiler. env | grep KOTLIN KOTLIN_HOME=/opt/kotlin-native-linux-0.7 env | grep PATH PATH=...:/opt/kotlin-native-linux-0.7/bin:...
When I try to do konanc -o hello-native hello-native.kt
kotlin-native compiler begin to download clang-llvm-5.0.0-linux-x86-64.tar.gz and extract it to the home directory ~/.konan/dependencies/clang-llvm-5.0.0-linux-x86-64.
Why? Could It use my system default clang6.0/llvm6.0?
I do understand. The problem is that we are talking about kotlin native compiler, not LLVM. It is based on llvm, but I am not sure that it can use just any user provided instance of llvm compiler, at least it is probably not supported. If you really want to use your own llvm, then you should download your own instance of kotlin compiler and then replaces LLVM references inside by those of your own llvm. Then you can follow the documentation and use custom kotlin native distribution you created instead of downloading something new.