codon icon indicating copy to clipboard operation
codon copied to clipboard

windows support

Open talebi1 opened this issue 2 years ago • 22 comments

Hi, Do you have plan to support windows?

talebi1 avatar Dec 08 '22 21:12 talebi1

image

mxrch avatar Dec 10 '22 13:12 mxrch

I spent a night trying to compile to Windows lol

nullmastermind avatar Dec 12 '22 02:12 nullmastermind

I tried to compile in MSYS2+Mingw64 on windows 10 64bits, but failed. And the files take so many disk space, I have to delete them now.

I am look forwards to a pre-compiled windows building too.

retsyo avatar Dec 12 '22 04:12 retsyo

Windows users are so "codon."

"codon" means lonely in Vietnamese (cô đơn)

nullmastermind avatar Dec 12 '22 04:12 nullmastermind

Right now, you can use WLS to run Codon.

We plan to support Windows in the future. There are only a few POSIXy things that need to be ported over. However, none of the developers use or have access to Windows machines, so we cannot provide an ETA at the moment.

inumanag avatar Dec 12 '22 20:12 inumanag

Is there any updates about this.

liudonghua123 avatar Jan 03 '23 00:01 liudonghua123

Cant i just use codon to generate LLVM IR then throw it in an LLVM backend to transform it into a native windows exe?

ghost avatar Feb 11 '23 07:02 ghost

Same question as @PunchCakee.

TashaSkyUp avatar Mar 12 '23 05:03 TashaSkyUp

You can get a free windows like this: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/

For the developers that don't have windows.

Code4SAFrankie avatar Mar 23 '23 17:03 Code4SAFrankie

Right now, you can use WLS to run Codon.

We plan to support Windows in the future. There are only a few POSIXy things that need to be ported over. However, none of the developers use or have access to Windows machines, so we cannot provide an ETA at the moment.

are we in the future yet 👀?

oSethoum avatar Mar 24 '23 02:03 oSethoum

have anyone use zig to compile this

WingDust avatar Mar 25 '23 12:03 WingDust

@PunchCakee probably not--- you will need to compile libcodonrt as well for it to work.

@oSethoum et al.: We currently do not have anybody with Windows development experience on our team and thus cannot prioritize the native Windows version anytime soon (probably by the end of '23 at least). However:

  1. You can use and test Codon on WSL (which is probably good enough for testing and playing with it), and
  2. We will gladly accept patches and PRs that will bring the Windows support and CI testing from people who are familiar with Windows development.

inumanag avatar Mar 25 '23 23:03 inumanag

Any progress now?

mushroomfire avatar Apr 26 '23 07:04 mushroomfire

Cant i just use codon to generate LLVM IR then throw it in an LLVM backend to transform it into a native windows exe?

Nope. I tried.

    ninja: build stopped: subcommand failed.





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


-- Configuring incomplete, errors occurred!

GhDamghani avatar May 03 '23 21:05 GhDamghani

What needs to be ported? I could try adding windows support since i think its really beneficial if i want to make consumer desktop software because the majority of market share goes to window (for home operating systems).

ghost avatar May 18 '23 08:05 ghost

This is finally happening: use #403 to track the progress.

inumanag avatar Jun 09 '23 17:06 inumanag

short story

where can I download ml.exe for windows 64bits?

long one

there is no sys\mman.h for MSYS2+Mingw64, so I download https://github.com/mcgarrah/mman-win32 according to https://msys2-users.narkive.com/xA2wbH0c/does-msys2-support-mmap-mman

then after

makedir d
cd d
cmake -G "MSYS Makefiles" ..
make 

I get

[  2%] Built target bz2
[  4%] Built target backtrace
[  4%] Built target fmt
[  5%] Built target peg2cpp
[  5%] Built target codon_jupyter
[ 11%] Built target re2
[ 22%] Built target zlibstatic
[ 42%] Built target liblzma
[ 50%] Built target gc
[ 50%] Built target libomp-needed-headers
[ 50%] Built target libomp-needed-windows-files
[ 50%] Building ASM_MASM object _deps/openmp-build/runtime/src/CMakeFiles/omp.dir/z_Windows_
NT-586_asm.asm.obj
/bin/sh: line 1: ml: command not found
make[2]: *** [_deps/openmp-build/runtime/src/CMakeFiles/omp.dir/build.make:495: _deps/openmp-build/runtime/src/CMakeFiles/omp.dir/z_Windows_NT-586_asm.asm.obj] Error 127
make[1]: *** [CMakeFiles/Makefile2:2005: _deps/openmp-build/runtime/src/CMakeFiles/omp.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

retsyo avatar Sep 03 '23 09:09 retsyo

You can get a free windows like this: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/

For the developers that don't have windows.

psst... massgrave.dev

xandaaah avatar Mar 23 '24 21:03 xandaaah

I'm a former developer. I might be able to test stuff. I have a Windows 10 64 bit machine and I could make another drive a Windows 11 machine. I won't be able to do 8 hours a day, but maybe a couple of hours if I have time. I also have built a python application that has been running for quite some time.

jschwar313 avatar Mar 24 '24 12:03 jschwar313

You can get a free windows like this: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/ For the developers that don't have windows.

psst... massgrave.dev

massgrave is so goated

sohdahh avatar Mar 26 '24 02:03 sohdahh

Hey guys I tested for serval env to compile codon project, with all are failed:

git clone https://github.com/exaloop/llvm-project.git --depth=1
git clone https://github.com/exaloop/codon.git --depth=1 --branch=windows

The LLVM has been built successfully, so the codon build will passing the -DCMAKE_PREFIX_PATH="C:/exaloop/llvm/install_dir".

  • Windows 11, VS2022, MSVC v143
CMAKE_C_COMPILER=cl.exe
CMAKE_CXX_COMPILER=cl.exe
CMAKE_ASM_COMPILER=ml64.exe
CMAKE_GENERATOR=ninja.exe

It will finally stoped at the kmp.h include file which VS2022 (and newer) MSVC compiler not support compile both C/CXX and ASM together.

  • Windows 11, VS2022, Clang/LLVM
CMAKE_C_COMPILER=clang-cl.exe
CMAKE_CXX_COMPILER=clang-cl.exe
CMAKE_ASM_COMPILER=lld-link.exe
CMAKE_GENERATOR=ninja.exe

Compilation returns multi lld-link.exe error.

  • Windows 11, Intel oneAPI(intel 64 + VS2022), Intel C/C++
CMAKE_C_COMPILER=icx.exe
CMAKE_CXX_COMPILER=icx.exe
CMAKE_ASM_COMPILER=ml64.exe
CMAKE_GENERATOR=ninja.exe

somewhat failed too, put a reason here later.......

  • Windows 11, Git for Windows(MinGW64), GCC 14
CMAKE_C_COMPILER=gcc.exe
CMAKE_CXX_COMPILER=g++.exe
CMAKE_GENERATOR=ninja.exe

The compilation stop at a asm file that can't do something like this:

  SE7EN@Zephyrus MINGW64 ~/Desktop/cobuild
  $ cmake --build .
  [1/201] Building ASM_MASM object _deps/openmp-build/runtime/src/CMakeFiles/omp.dir/z_Windows_NT-586_asm.asm.obj
  FAILED: _deps/openmp-build/runtime/src/CMakeFiles/omp.dir/z_Windows_NT-586_asm.asm.obj
  ml -Domp_EXPORTS -IC:/Users/SE7EN/Desktop/codon/. -IC:/Users/SE7EN/Desktop/cobuild/_deps/openmp-build/runtime/src -IC:/Users/SE7EN/Desktop/cobuild/_deps/openmp-src/runtime/src -IC:/Users/SE7EN/Desktop/cobuild/_deps/openmp-src/runtime/src/i18n -IC:/Users/SE7EN/Desktop/cobuild/_deps/openmp-src/runtime/src/include -IC:/Users/SE7EN/Desktop/cobuild/_deps/openmp-src/runtime/src/thirdparty/ittnotify -D _CRT_SECURE_NO_ninja: fatal: GetOverlappedResult: The handle is invalid.
  
  WARNINGS -D _CRT_SECURE_NO_DEPRECATE -D _WINDOWS -D _WINNT -D _WIN32_WINNT=0x0501 -D _USRDLL  -D_M_AMD64 -DOMPT_SUPPORT=0 -DOMPD_SUPPORT=0 -c -Fo _deps/openmp-build/runtime/src/CMakeFiles/omp.dir/z_Windows_NT-586_asm.asm.obj C:/Users/SE7EN/Desktop/cobuild/_deps/openmp-src/runtime/src/z_Windows_NT-586_asm.asm
  CreateProcess failed: The system cannot find the file specified.
  • Ubuntu 22.04 LTS, GCC Mingw64 Cross Compiling (I have 2 machine for one is real Linux not WSL)
CMAKE_C_COMPILER=x86_64-w64-mingw32-gcc 
CMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++
CMAKE_ASM_COMPILER=x86_64-w64-mingw32-as

Error happens on checking on unsinged short/int/long:

-- Check size of unsigned short
CMake Error at /usr/share/cmake-3.22/Modules/CheckTypeSize.cmake:139 (try_compile):
  Cannot copy output executable

    ''

  to destination specified by COPY_FILE:

    '/home/txmascot/desktop/codon/build2/CMakeFiles/CheckTypeSize/CMAKE_SIZEOF_UNSIGNED_SHORT.bin'

  Unable to find the executable at any of:

    /home/txmascot/desktop/codon/build2/CMakeFiles/CMakeTmp/cmTC_9c73d
    /home/txmascot/desktop/codon/build2/CMakeFiles/CMakeTmp/Debug/cmTC_9c73d
    /home/txmascot/desktop/codon/build2/CMakeFiles/CMakeTmp/Development/cmTC_9c73d

Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/CheckTypeSize.cmake:270 (__check_type_size_impl)
  /usr/share/cmake-3.22/Modules/TestBigEndian.cmake:55 (CHECK_TYPE_SIZE)
  /usr/share/cmake-3.22/Modules/TestBigEndian.cmake:37 (__TEST_BIG_ENDIAN_LEGACY_IMPL)
  build2/_deps/xz-src/cmake/tuklib_integer.cmake:21 (test_big_endian)
  build2/_deps/xz-src/CMakeLists.txt:129 (tuklib_integer)

Having new testing results will update comments here.

TaiXeflar avatar May 19 '24 08:05 TaiXeflar