To solve that Fatal error in cpyext, I asked ai. It suggests me to reinstall the python bindings. That results a D:\miniforge-pypy3 folder.
Could you also add links to the dependences, so I don’t need to guess if I am using the right ones.
When I do the configure in cmake-gui, it tells me it needs pandoc. Don’t know if it is bring into by the dependences. I find a pandoc.exe and put it in the PATH, now configure is OK.
I tried ‘Build From a Source Tarball’ under conda.
cmake Configuring done.
But ‘make -j8’ says ‘make: *** No targets specified and no makefile found. Stop.’
I think it generate a sln file. So I opened the sln file and compile with VS. There are 7 errors.
Where is file ‘\DIA SDK\lib\amd64\diaguids.lib’ ?
(lf) D:\00masterLib>cd D:\00masterLib\lfortran-0.62.0
(lf) D:\00masterLib\lfortran-0.62.0>cmake -DWITH_LLVM=yes -DCMAKE_INSTALL_PREFIX=`pwd`/inst .
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
-- Found LLVM 22.1.4
-- Using LLVMConfig.cmake in: C:/Users/Cean/.conda/envs/lf/Library/lib/cmake/llvm
-- ZLIB LIBRARY PATH: C:/Users/Cean/.conda/envs/lf/Library/lib
Configuration results
---------------------
LFORTRAN_VERSION: 0.62.0
CPACK_PACKAGE_FILE_NAME: lfortran-0.62.0-Windows
C compiler : C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe
C++ compiler : C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe
Build type: Release
C compiler flags : /MD /O2 /Ob2 /DNDEBUG
C++ compiler flags : /MD /O2 /Ob2 /DNDEBUG /bigobj
Installation prefix: D:/00masterLib/lfortran-0.62.0/`pwd`/inst
WITH_LFORTRAN_ASSERT: no
LFORTRAN_STATIC_BIN: no
LFORTRAN_BUILD_TO_WASM: no
WITH_STACKTRACE: no
WITH_RUNTIME_STACKTRACE:
WITH_INTERNAL_ALLOC_CHECK: no
WITH_UNWIND: no
WITH_LIBUNWIND: no
WITH_BFD: no
WITH_LLVM_STACKTRACE: no
WITH_DWARFDUMP: no
WITH_LINKH: no
WITH_MACHO: no
HAVE_LFORTRAN_DEMANGLE: no
WITH_LLVM: yes
WITH_ZSTD: yes
USE_DYNAMIC_ZSTD: no
WITH_MLIR: no
WITH_XEUS: no
WITH_JSON: no
WITH_LSP: no
WITH_FMT: no
WITH_BENCHMARKS: no
WITH_LFORTRAN_BINARY_MODFILES: YES
WITH_RUNTIME_LIBRARY: YES
WITH_WHEREAMI: yes
WITH_ZLIB: yes
USE_DYNAMIC_ZLIB: no
WITH_TARGET_AARCH64: no
WITH_TARGET_X86: yes
WITH_TARGET_WASM: no
WITH_KOKKOS: no
WITH_CCACHE: no
CXXFLAGS: /DWIN32 /D_WINDOWS /W3 /GR /EHsc
CFLAGS: /DWIN32 /D_WINDOWS /W3
-- Configuring done (0.6s)
-- Generating done (2.1s)
-- Build files have been written to: D:/00masterLib/lfortran-0.62.0
Yes, I think most of it is LLVM. I am not happy about it either, and eventually for Debug builds we’ll get our own backends up and running and they will be much smaller. For Release builds LLVM is the best by far, so it’s good to keep it.
There are a few function pairs like these two in src\runtime\purelfortran_intrinsic_ieee_arithmetic.f90 has this error 5286.
Ambiguous generic interface IEEE_SUPPORT_DENORMAL: previously declared specific procedure SPIEEE_SUPPORT_DENORMAL is not distinguishable from this declaration. [DPIEEE_SUPPORT_DENORMAL]
AI corrected them with Remove OPTIONAL, use explicit kinds.
! IEEE_SUPPORT_DENORMAL
pure function spieee_support_denormal(x) result(r)
use iso_fortran_env, only: real32
real(real32), intent(in) :: x ! REQUIRED - NOT optional
logical :: r
! Most modern hardware supports denormals
r = .true.
end function
pure function dpieee_support_denormal(x) result(r)
use iso_fortran_env, only: real64
real(real64), intent(in) :: x !Remove OPTIONAL, use explicit kinds
logical :: r
r = .true.
end function
Error 6683: A kind type parameter must be a compile-time constant. [C_SIZE_T]
AI corrected it with Use the actual kind value directly
!integer(c_size_t) function c_sizeof(x)
!!type(*), intent(in) :: x
!integer, intent(in) :: x
!end function
integer(8) function c_sizeof(x) ! Use the numeric kind directly
integer, intent(in) :: x
end function
Now I have successfully build runtime lib. Is this one the right one? D:\00masterLib\lfortran-0.62.0\src\runtime\legacy\Release\lfortran_runtime_static.lib