conda-forge / lfortran-feedstock

A conda-smithy repository for lfortran.
BSD 3-Clause "New" or "Revised" License
6 stars 9 forks source link

Update LFortran to 0.41.0 #98

Closed certik closed 1 month ago

certik commented 1 month ago

Checklist

certik commented 1 month ago

@conda-forge-admin, please rerender

conda-forge-admin commented 1 month ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

certik commented 1 month ago

On macOS ARM we get:

[  1%] Building C object src/runtime/legacy/CMakeFiles/lfortran_runtime_static.dir/__/__/libasr/runtime/lfortran_intrinsics.c.o
/Users/runner/miniforge3/conda-bld/lfortran_1728925557488/work/src/libasr/runtime/lfortran_intrinsics.c:2595:5: error: call to undeclared function 'gettimeofday'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 2595 |     gettimeofday(&tv, NULL);
      |     ^
1 error generated.

It's weird, since the code in question is:

#elif defined(__APPLE__) && !defined(__aarch64__)
    // For non-ARM-based Apple platforms, use current time functions
    struct timeval tv;
    gettimeofday(&tv, NULL);

So it looks like the !defined(__aarch64__) evaluated to true on arm, while it should evaluate to false. I see, I think it's because we are cross compiling from Apple Intel. This was implemented in https://github.com/lfortran/lfortran/pull/4987. @HarshitaKalani, do you know how to work around this?

certik commented 1 month ago

On Windows we get an error:

[ 80%] Linking CXX executable lfortran.exe
LINK: command "C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1429~1.301\bin\HostX64\x64\link.exe /nologo @CMakeFiles\lfortran.dir\objects1.rsp /out:lfortran.exe /implib:lfortran.lib /pdb:%SRC_DIR%\src\bin\lfortran.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console -LIBPATH:%PREFIX%\Library\lib ..\lfortran\lfortran_lib.lib ..\libasr\asr.lib ..\runtime\legacy\lfortran_runtime_static.lib %PREFIX%\Library\lib\libxeus-zmq.lib %PREFIX%\Library\lib\libxeus.lib %PREFIX%\Library\lib\LLVMMCJIT.lib %PREFIX%\Library\lib\LLVMOrcJIT.lib %PREFIX%\Library\lib\LLVMExecutionEngine.lib %PREFIX%\Library\lib\LLVMRuntimeDyld.lib %PREFIX%\Library\lib\LLVMPasses.lib %PREFIX%\Library\lib\LLVMCoroutines.lib %PREFIX%\Library\lib\LLVMipo.lib %PREFIX%\Library\lib\LLVMFrontendOpenMP.lib %PREFIX%\Library\lib\LLVMLinker.lib %PREFIX%\Library\lib\LLVMIRPrinter.lib %PREFIX%\Library\lib\LLVMVectorize.lib %PREFIX%\Library\lib\LLVMJITLink.lib %PREFIX%\Library\lib\LLVMOrcTargetProcess.lib %PREFIX%\Library\lib\LLVMOrcShared.lib %PREFIX%\Library\lib\LLVMWindowsDriver.lib %PREFIX%\Library\lib\LLVMOption.lib %PREFIX%\Library\lib\LLVMX86CodeGen.lib %PREFIX%\Library\lib\LLVMAsmPrinter.lib %PREFIX%\Library\lib\LLVMCFGuard.lib %PREFIX%\Library\lib\LLVMGlobalISel.lib %PREFIX%\Library\lib\LLVMInstrumentation.lib %PREFIX%\Library\lib\LLVMSelectionDAG.lib %PREFIX%\Library\lib\LLVMCodeGen.lib %PREFIX%\Library\lib\LLVMTarget.lib %PREFIX%\Library\lib\LLVMBitWriter.lib %PREFIX%\Library\lib\LLVMObjCARCOpts.lib %PREFIX%\Library\lib\LLVMScalarOpts.lib %PREFIX%\Library\lib\LLVMAggressiveInstCombine.lib %PREFIX%\Library\lib\LLVMInstCombine.lib %PREFIX%\Library\lib\LLVMTransformUtils.lib %PREFIX%\Library\lib\LLVMAnalysis.lib %PREFIX%\Library\lib\LLVMProfileData.lib %PREFIX%\Library\lib\LLVMSymbolize.lib %PREFIX%\Library\lib\LLVMDebugInfoPDB.lib C:\Program Files\Microsoft Visual Studio\2022\Enterprise\\DIA SDK\lib\amd64\diaguids.lib %PREFIX%\Library\lib\LLVMDebugInfoMSF.lib %PREFIX%\Library\lib\LLVMDebugInfoBTF.lib %PREFIX%\Library\lib\LLVMDebugInfoDWARF.lib %PREFIX%\Library\lib\LLVMObject.lib %PREFIX%\Library\lib\LLVMIRReader.lib %PREFIX%\Library\lib\LLVMAsmParser.lib %PREFIX%\Library\lib\LLVMBitReader.lib %PREFIX%\Library\lib\LLVMCore.lib %PREFIX%\Library\lib\LLVMRemarks.lib %PREFIX%\Library\lib\LLVMBitstreamReader.lib %PREFIX%\Library\lib\LLVMTextAPI.lib %PREFIX%\Library\lib\LLVMX86AsmParser.lib %PREFIX%\Library\lib\LLVMX86Desc.lib %PREFIX%\Library\lib\LLVMCodeGenTypes.lib %PREFIX%\Library\lib\LLVMMCParser.lib %PREFIX%\Library\lib\LLVMX86Disassembler.lib %PREFIX%\Library\lib\LLVMX86Info.lib %PREFIX%\Library\lib\LLVMMCDisassembler.lib %PREFIX%\Library\lib\LLVMMC.lib %PREFIX%\Library\lib\LLVMBinaryFormat.lib %PREFIX%\Library\lib\LLVMTargetParser.lib %PREFIX%\Library\lib\LLVMDebugInfoCodeView.lib %PREFIX%\Library\lib\LLVMSupport.lib %PREFIX%\Library\lib\z.lib %PREFIX%\Library\lib\LLVMDemangle.lib psapi.lib shell32.lib ole32.lib uuid.lib advapi32.lib %PREFIX%\Library\lib\zstd.lib delayimp.lib -delayload:shell32.dll -delayload:ole32.dll kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:lfortran.exe.manifest" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'atls.lib'
NMAKE : fatal error U1077: 'D:\bld\lfortran_1728925631801\_build_env\Library\bin\cmake.exe' : return code '0xffffffff'
Stop.
conda-forge-admin commented 1 month ago

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found some lint.

Here's what I've got...

For recipe/meta.yaml:

conda-forge-admin commented 1 month ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

certik commented 1 month ago

Now the error on macOS arm is:

[ 16%] Building Fortran object CMakeFiles/lfortran_intrinsic_iso_fortran_env.dir/pure/lfortran_intrinsic_iso_fortran_env.f90.o
2024-10-14 18:16:05.563 xcodebuild[12072:65753] [MT] DVTSDK: Skipped SDK /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk; its version (11.0) is below required minimum (13.0) for the macosx platform.
2024-10-14 18:16:06.947 xcodebuild[12072:65753] Writing error result bundle to /var/folders/4b/7k50gk0j4f5bjk3799wdt8nw0000gn/T/ResultBundle_2024-14-10_18-16-0006.xcresult
xcodebuild: error: SDK "/Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk" cannot be located.
2024-10-14 18:16:08.649 xcodebuild[12074:65777] [MT] DVTSDK: Skipped SDK /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk; its version (11.0) is below required minimum (13.0) for the macosx platform.
2024-10-14 18:16:09.294 xcodebuild[12074:65777] Writing error result bundle to /var/folders/4b/7k50gk0j4f5bjk3799wdt8nw0000gn/T/ResultBundle_2024-14-10_18-16-0009.xcresult
xcodebuild: error: SDK "/Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk" cannot be located.
cc: error: sh -c '/Applications/Xcode_15.2.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -find clang 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
xcode-select: Failed to locate 'clang', requesting installation of command line developer tools.
The command 'cc -c 'CMakeFiles/lfortran_intrinsic_iso_fortran_env.dir/pure/lfortran_intrinsic_iso_fortran_env.f90.o.empty.c' -o 'CMakeFiles/lfortran_intrinsic_iso_fortran_env.dir/pure/lfortran_intrinsic_iso_fortran_env.f90.o'' failed.
make[5]: *** [CMakeFiles/lfortran_intrinsic_iso_fortran_env.dir/build.make:75: CMakeFiles/lfortran_intrinsic_iso_fortran_env.dir/pure/lfortran_intrinsic_iso_fortran_env.f90.o] Error 11
make[4]: *** [CMakeFiles/Makefile2:171: CMakeFiles/lfortran_intrinsic_iso_fortran_env.dir/all] Error 2
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/build_runtime.dir/build.make:70: CMakeFiles/build_runtime] Error 2
make[1]: *** [CMakeFiles/Makefile2:312: CMakeFiles/build_runtime.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
Traceback (most recent call last):

But macOS Intel works. This is due to lfortran trying to call "cc" and it fails. We should not be calling clang when cross compiling, only compiling to mod files. The issue might be with cmake support of LFortran, thus too new cmake.

certik commented 1 month ago

macOS works now. Just the Windows error remains:

[ 80%] Linking CXX executable lfortran.exe
LINK: command "C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1429~1.301\bin\HostX64\x64\link.exe /nologo @CMakeFiles\lfortran.dir\objects1.rsp /out:lfortran.exe /implib:lfortran.lib /pdb:%SRC_DIR%\src\bin\lfortran.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console -LIBPATH:%PREFIX%\Library\lib ..\lfortran\lfortran_lib.lib ..\libasr\asr.lib ..\runtime\legacy\lfortran_runtime_static.lib %PREFIX%\Library\lib\libxeus-zmq.lib %PREFIX%\Library\lib\libxeus.lib %PREFIX%\Library\lib\LLVMMCJIT.lib %PREFIX%\Library\lib\LLVMOrcJIT.lib %PREFIX%\Library\lib\LLVMExecutionEngine.lib %PREFIX%\Library\lib\LLVMRuntimeDyld.lib %PREFIX%\Library\lib\LLVMPasses.lib %PREFIX%\Library\lib\LLVMCoroutines.lib %PREFIX%\Library\lib\LLVMipo.lib %PREFIX%\Library\lib\LLVMFrontendOpenMP.lib %PREFIX%\Library\lib\LLVMLinker.lib %PREFIX%\Library\lib\LLVMIRPrinter.lib %PREFIX%\Library\lib\LLVMVectorize.lib %PREFIX%\Library\lib\LLVMJITLink.lib %PREFIX%\Library\lib\LLVMOrcTargetProcess.lib %PREFIX%\Library\lib\LLVMOrcShared.lib %PREFIX%\Library\lib\LLVMWindowsDriver.lib %PREFIX%\Library\lib\LLVMOption.lib %PREFIX%\Library\lib\LLVMX86CodeGen.lib %PREFIX%\Library\lib\LLVMAsmPrinter.lib %PREFIX%\Library\lib\LLVMCFGuard.lib %PREFIX%\Library\lib\LLVMGlobalISel.lib %PREFIX%\Library\lib\LLVMInstrumentation.lib %PREFIX%\Library\lib\LLVMSelectionDAG.lib %PREFIX%\Library\lib\LLVMCodeGen.lib %PREFIX%\Library\lib\LLVMTarget.lib %PREFIX%\Library\lib\LLVMBitWriter.lib %PREFIX%\Library\lib\LLVMObjCARCOpts.lib %PREFIX%\Library\lib\LLVMScalarOpts.lib %PREFIX%\Library\lib\LLVMAggressiveInstCombine.lib %PREFIX%\Library\lib\LLVMInstCombine.lib %PREFIX%\Library\lib\LLVMTransformUtils.lib %PREFIX%\Library\lib\LLVMAnalysis.lib %PREFIX%\Library\lib\LLVMProfileData.lib %PREFIX%\Library\lib\LLVMSymbolize.lib %PREFIX%\Library\lib\LLVMDebugInfoPDB.lib C:\Program Files\Microsoft Visual Studio\2022\Enterprise\\DIA SDK\lib\amd64\diaguids.lib %PREFIX%\Library\lib\LLVMDebugInfoMSF.lib %PREFIX%\Library\lib\LLVMDebugInfoBTF.lib %PREFIX%\Library\lib\LLVMDebugInfoDWARF.lib %PREFIX%\Library\lib\LLVMObject.lib %PREFIX%\Library\lib\LLVMIRReader.lib %PREFIX%\Library\lib\LLVMAsmParser.lib %PREFIX%\Library\lib\LLVMBitReader.lib %PREFIX%\Library\lib\LLVMCore.lib %PREFIX%\Library\lib\LLVMRemarks.lib %PREFIX%\Library\lib\LLVMBitstreamReader.lib %PREFIX%\Library\lib\LLVMTextAPI.lib %PREFIX%\Library\lib\LLVMX86AsmParser.lib %PREFIX%\Library\lib\LLVMX86Desc.lib %PREFIX%\Library\lib\LLVMCodeGenTypes.lib %PREFIX%\Library\lib\LLVMMCParser.lib %PREFIX%\Library\lib\LLVMX86Disassembler.lib %PREFIX%\Library\lib\LLVMX86Info.lib %PREFIX%\Library\lib\LLVMMCDisassembler.lib %PREFIX%\Library\lib\LLVMMC.lib %PREFIX%\Library\lib\LLVMBinaryFormat.lib %PREFIX%\Library\lib\LLVMTargetParser.lib %PREFIX%\Library\lib\LLVMDebugInfoCodeView.lib %PREFIX%\Library\lib\LLVMSupport.lib %PREFIX%\Library\lib\z.lib %PREFIX%\Library\lib\LLVMDemangle.lib psapi.lib shell32.lib ole32.lib uuid.lib advapi32.lib %PREFIX%\Library\lib\zstd.lib delayimp.lib -delayload:shell32.dll -delayload:ole32.dll kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:lfortran.exe.manifest" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'atls.lib'
NMAKE : fatal error U1077: 'D:\bld\lfortran_1728932295681\_build_env\Library\bin\cmake.exe' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
certik commented 1 month ago

Still the same error on Windows. I am testing the old configuration here: https://github.com/conda-forge/lfortran-feedstock/pull/99 to see if the issue is with newer lfortran, or with conda-forge packages.

certik commented 1 month ago

Ok, last lfortran version and last package builds correctly on all platforms.

Now testing new lfortran, but old package here: https://github.com/conda-forge/lfortran-feedstock/pull/100.

Ok, it is caused by LFortran itself. We need to see what changed might have caused it.

github-actions[bot] commented 1 month ago

Hi! This is the friendly conda-forge automerge bot!

I considered the following status checks when analyzing this PR:

Thus the PR was passing and merged! Have a great day!