Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build errors with LLVM 19.1.4 (clang/clang++/flang-new) #263

Open
climbfuji opened this issue Dec 10, 2024 · 0 comments
Open

Build errors with LLVM 19.1.4 (clang/clang++/flang-new) #263

climbfuji opened this issue Dec 10, 2024 · 0 comments

Comments

@climbfuji
Copy link
Contributor

Efforts are underway to build spack-stack and the models that use spack-stack with LLVM, latest version 19.1.4. The latest LLVM flang compiler (flang-new in the installation) supposedly is the most robust Fortran compiler in terms of Fortran 2018 and 2023 standard implementations. For [email protected], I get a number of build errors.

First, related to OpenMP (this may not be an ip problem, but a problem with the LLVM setup in spack / the spack-stack compiler config, but I want to mention it here). See below for the more important issue.

-- The C compiler identification is Clang 19.1.4
-- The Fortran compiler identification is LLVMFlang 19.1.4
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/dom/prod/spack-stack-20241208/spack/lib/spack/env/clang/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /home/dom/prod/spack-stack-20241208/spack/lib/spack/env/clang/flang - skipped
-- Library kinds that will be build: 4;d;8
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find OpenMP_Fortran (missing: OpenMP_Fortran_FLAGS
  OpenMP_Fortran_LIB_NAMES)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindOpenMP.cmake:577 (find_package_handle_standard_args)
  CMakeLists.txt:49 (find_package)


-- Configuring incomplete, errors occurred!
==> Error: ProcessError: Command exited with status 1:
    '/usr/bin/cmake' '-G' 'Unix Makefiles' '-DCMAKE_INSTALL_PREFIX:STRING=/home/dom/prod/spack-stack-20241208/envs/ne-clang-19.1.4/install/clang/19.1.4/ip-5.1.0-tjxba2z' '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON' '-DCMAKE_INSTALL_RPATH:STRING=/home/dom/prod/spack-stack-20241208/envs/ne-clang-19.1.4/install/clang/19.1.4/ip-5.1.0-tjxba2z/lib;/home/dom/prod/spack-stack-20241208/envs/ne-clang-19.1.4/install/clang/19.1.4/ip-5.1.0-tjxba2z/lib64' '-DCMAKE_PREFIX_PATH:STRING=/home/dom/prod/spack-stack-20241208/envs/ne-clang-19.1.4/install/clang/19.1.4/openblas-0.3.28-xyxhfho;/home/dom/prod/spack-stack-20241208/envs/ne-clang-19.1.4/install/clang/19.1.4/gmake-4.2.1-biq3xx4' '-DCMAKE_BUILD_TYPE:STRING=Release' '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON' '-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF' '-DCMAKE_POLICY_DEFAULT_CMP0090:STRING=NEW' '-DCMAKE_FIND_USE_PACKAGE_REGISTRY:BOOL=OFF' '-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON' '-DOPENMP:BOOL=ON' '-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON' '-DBUILD_TESTING:BOOL=OFF' '-DBUILD_SHARED_LIBS:BOOL=OFF' '-DBUILD_4:BOOL=ON' '-DBUILD_D:BOOL=ON' '-DBUILD_8:BOOL=ON' '-DBUILD_DEPRECATED:BOOL=OFF' '-DBLA_VENDOR:STRING=OpenBLAS' '/home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-tjxba2zroualxeksqgradgrqneogfpju/spack-src'
  1. After turning off the openmp variant for ip, I get this error during the build phase.
[ 83%] Linking Fortran static library libip_4.a
cd /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet/src && /usr/bin/cmake -P CMakeFiles/ip_4.dir/cmake_clean_target.cmake
cd /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/ip_4.dir/link.txt --verbose=1
/home/dom/prod/llvm-19.1.4/bin/llvm-ar qc libip_4.a CMakeFiles/ip_4.dir/gdswzd_c.F90.o CMakeFiles/ip_4.dir/gdswzd_mod.F90.o CMakeFiles/ip_4.dir/ipolates.F90.o CMakeFiles/ip_4.dir/ipolatev.F90.o CMakeFiles/ip_4.dir/ipxwafs.F90.o CMakeFiles/ip_4.dir/ipxwafs2.F90.o CMakeFiles/ip_4.dir/ipxwafs3.F90.o CMakeFiles/ip_4.dir/movect.F90.o CMakeFiles/ip_4.dir/bilinear_interp_mod.F90.o CMakeFiles/ip_4.dir/bicubic_interp_mod.F90.o CMakeFiles/ip_4.dir/neighbor_interp_mod.F90.o CMakeFiles/ip_4.dir/budget_interp_mod.F90.o CMakeFiles/ip_4.dir/spectral_interp_mod.F90.o CMakeFiles/ip_4.dir/neighbor_budget_interp_mod.F90.o CMakeFiles/ip_4.dir/ip_mod.F90.o CMakeFiles/ip_4.dir/ip_grid_descriptor_mod.F90.o CMakeFiles/ip_4.dir/ip_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_station_points_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_gaussian_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_equid_cylind_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_lambert_conf_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_mercator_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_polar_stereo_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_rot_equid_cylind_egrid_mod.F90.o CMakeFiles/ip_4.dir/ip_rot_equid_cylind_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_constants_mod.F90.o CMakeFiles/ip_4.dir/ip_grids_mod.F90.o CMakeFiles/ip_4.dir/ip_grid_factory_mod.F90.o CMakeFiles/ip_4.dir/ip_interpolators_mod.F90.o CMakeFiles/ip_4.dir/earth_radius_mod.F90.o CMakeFiles/ip_4.dir/polfix_mod.F90.o CMakeFiles/ip_4.dir/sp_mod.F.o
/home/dom/prod/llvm-19.1.4/bin/llvm-ranlib libip_4.a
make[2]: Leaving directory '/home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet'
[ 83%] Built target ip_4
make[1]: Leaving directory '/home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet'
make: *** [Makefile:139: all] Error 2
==> Error: ProcessError: Command exited with status 2:
    '/home/dom/prod/spack-stack-20241208/envs/ne-clang-19.1.4/install/clang/19.1.4/gmake-4.2.1-biq3xx4/bin/make' '-j4'

12 errors found in build log:
     664    cd /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet/src && /home/dom/prod/spack-stack-20241208/spack/lib/spack/env/clang/flang -DLSIZE=8 -I/home/dom/p
            rod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet/src/include_8 -module-dirinclude_8 -fPIC -c /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip
            -5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-src/src/gdswzd_c.F90 -o CMakeFiles/ip_8.dir/gdswzd_c.F90.o
     665    [ 77%] Building Fortran object src/CMakeFiles/ip_4.dir/neighbor_interp_mod.F90.o
     666    cd /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet/src && /home/dom/prod/spack-stack-20241208/spack/lib/spack/env/clang/flang -DLSIZE=4 -I/home/dom/p
            rod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet/src/include_4 -module-dirinclude_4 -fPIC -c /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip
            -5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-src/src/neighbor_interp_mod.F90 -o CMakeFiles/ip_4.dir/neighbor_interp_mod.F90.o
     667    /usr/bin/cmake -E touch src/CMakeFiles/ip_8.dir/gdswzd_mod.F90.o.provides.build
     668    [ 78%] Building Fortran object src/CMakeFiles/ip_4.dir/spectral_interp_mod.F90.o
     669    cd /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet/src && /home/dom/prod/spack-stack-20241208/spack/lib/spack/env/clang/flang -DLSIZE=4 -I/home/dom/p
            rod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet/src/include_4 -module-dirinclude_4 -fPIC -c /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip
            -5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-src/src/spectral_interp_mod.F90 -o CMakeFiles/ip_4.dir/spectral_interp_mod.F90.o
  >> 670    error: Semantic errors in /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-src/src/gdswzd_c.F90
  >> 671    /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-src/src/gdswzd_c.F90:206:5: error: No specific subroutine of generic 'gdswzd' matches the actual arguments
     672          CALL GDSWZD(IGDTNUM,IGDTMPL,IGDTLEN,IOPT,NPTS,FILL, &
     673          ^
  >> 674    /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-src/src/gdswzd_c.F90:291:5: error: No specific subroutine of generic 'gdswzd' matches the actual arguments
     675          CALL GDSWZD(KGDS,IOPT,NPTS,FILL,XPTS,YPTS,RLON,RLAT,NRET, &
     676          ^
  >> 677    error: Semantic errors in /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-src/src/gdswzd_c.F90
  >> 678    /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-src/src/gdswzd_c.F90:184:58: error: The type of 'igdtlen' has already been implicitly declared
     679          INTEGER(KIND=C_LONG), VALUE, INTENT(IN)  :: IGDTNUM, IGDTLEN
     680                                                               ^^^^^^^
  >> 681    /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-src/src/gdswzd_c.F90:173:39: Implicit declaration of 'igdtlen'
     682        SUBROUTINE GDSWZD_C(IGDTNUM,IGDTMPL,IGDTLEN,IOPT,NPTS,FILL, &
     683                                            ^^^^^^^
  >> 684    /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-src/src/gdswzd_c.F90:291:5: error: No specific subroutine of generic 'gdswzd' matches the actual arguments
     685          CALL GDSWZD(KGDS,IOPT,NPTS,FILL,XPTS,YPTS,RLON,RLAT,NRET, &
     686          ^
  >> 687    make[2]: *** [src/CMakeFiles/ip_8.dir/build.make:78: src/CMakeFiles/ip_8.dir/gdswzd_c.F90.o] Error 1
     688    make[2]: Leaving directory '/home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet'
  >> 689    make[1]: *** [CMakeFiles/Makefile2:157: src/CMakeFiles/ip_8.dir/all] Error 2
     690    make[1]: *** Waiting for unfinished jobs....
     691    /usr/bin/cmake -E touch src/CMakeFiles/ip_d.dir/gdswzd_mod.F90.o.provides.build
  >> 692    make[2]: *** [src/CMakeFiles/ip_d.dir/build.make:78: src/CMakeFiles/ip_d.dir/gdswzd_c.F90.o] Error 1
     693    make[2]: *** Waiting for unfinished jobs....
     694    make[2]: Leaving directory '/home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet'
  >> 695    make[1]: *** [CMakeFiles/Makefile2:131: src/CMakeFiles/ip_d.dir/all] Error 2
     696    /usr/bin/cmake -E cmake_copy_f90_mod src/include_4/bicubic_interp_mod.mod src/CMakeFiles/ip_4.dir/bicubic_interp_mod.mod.stamp LLVMFlang
     697    /usr/bin/cmake -E cmake_copy_f90_mod src/include_4/bilinear_interp_mod.mod src/CMakeFiles/ip_4.dir/bilinear_interp_mod.mod.stamp LLVMFlang
     698    /usr/bin/cmake -E cmake_copy_f90_mod src/include_4/budget_interp_mod.mod src/CMakeFiles/ip_4.dir/budget_interp_mod.mod.stamp LLVMFlang
     699    /usr/bin/cmake -E cmake_copy_f90_mod src/include_4/gdswzd_c_mod.mod src/CMakeFiles/ip_4.dir/gdswzd_c_mod.mod.stamp LLVMFlang
     700    /usr/bin/cmake -E cmake_copy_f90_mod src/include_4/neighbor_budget_interp_mod.mod src/CMakeFiles/ip_4.dir/neighbor_budget_interp_mod.mod.stamp LLVMFlang
     701    /usr/bin/cmake -E cmake_copy_f90_mod src/include_4/neighbor_interp_mod.mod src/CMakeFiles/ip_4.dir/neighbor_interp_mod.mod.stamp LLVMFlang

     ...

     728    cd /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/ip_4.dir/link.txt --verbose=1
     729    /home/dom/prod/llvm-19.1.4/bin/llvm-ar qc libip_4.a CMakeFiles/ip_4.dir/gdswzd_c.F90.o CMakeFiles/ip_4.dir/gdswzd_mod.F90.o CMakeFiles/ip_4.dir/ipolates.F90.o CMakeFiles/ip_4.dir/ipolatev.F90.o CMakeFiles/ip_4.dir/ipxwafs.F90.o C
            MakeFiles/ip_4.dir/ipxwafs2.F90.o CMakeFiles/ip_4.dir/ipxwafs3.F90.o CMakeFiles/ip_4.dir/movect.F90.o CMakeFiles/ip_4.dir/bilinear_interp_mod.F90.o CMakeFiles/ip_4.dir/bicubic_interp_mod.F90.o CMakeFiles/ip_4.dir/neighbor_interp_
            mod.F90.o CMakeFiles/ip_4.dir/budget_interp_mod.F90.o CMakeFiles/ip_4.dir/spectral_interp_mod.F90.o CMakeFiles/ip_4.dir/neighbor_budget_interp_mod.F90.o CMakeFiles/ip_4.dir/ip_mod.F90.o CMakeFiles/ip_4.dir/ip_grid_descriptor_mod.
            F90.o CMakeFiles/ip_4.dir/ip_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_station_points_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_gaussian_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_equid_cylind_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_lambert_con
            f_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_mercator_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_polar_stereo_grid_mod.F90.o CMakeFiles/ip_4.dir/ip_rot_equid_cylind_egrid_mod.F90.o CMakeFiles/ip_4.dir/ip_rot_equid_cylind_grid_mod.F90.o CMa
            keFiles/ip_4.dir/ip_constants_mod.F90.o CMakeFiles/ip_4.dir/ip_grids_mod.F90.o CMakeFiles/ip_4.dir/ip_grid_factory_mod.F90.o CMakeFiles/ip_4.dir/ip_interpolators_mod.F90.o CMakeFiles/ip_4.dir/earth_radius_mod.F90.o CMakeFiles/ip_
            4.dir/polfix_mod.F90.o CMakeFiles/ip_4.dir/sp_mod.F.o
     730    /home/dom/prod/llvm-19.1.4/bin/llvm-ranlib libip_4.a
     731    make[2]: Leaving directory '/home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet'
     732    [ 83%] Built target ip_4
     733    make[1]: Leaving directory '/home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-xu6qmet'
  >> 734    make: *** [Makefile:139: all] Error 2

See build log for details:
  /home/dom/prod/spack-stack-20241208/cache/build_stage/spack-stage-ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm/spack-build-out.txt

==> Warning: Skipping build of neptune-env-1.5.0-brzkxflfd47igcfri5irwb354fsfzdkf since ip-5.1.0-xu6qmettya3gcg3pbojfefjrmw7tplfm failed

Worth noting: good old [email protected] builds fine with [email protected].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant