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

stdatomic.h: No such file or directory #637

Closed
visr opened this issue Nov 19, 2021 · 5 comments
Closed

stdatomic.h: No such file or directory #637

visr opened this issue Nov 19, 2021 · 5 comments

Comments

@visr
Copy link
Contributor

visr commented Nov 19, 2021

I noticed a build that works on julia 1.7.0-rc2 but fails on 1.7.0-rc3. This happens on Linux, Windows works for both. After looking at JuliaLang/julia@v1.7.0-rc2...v1.7.0-rc3 I suspect it is because of JuliaLang/julia#42828.

PackageCompiler: compiling incremental system image
In file included from /opt/teamcityagent/work/44830c4db5199711/julia-1.7.0-rc3/include/julia/julia.h:100:0,
 from /u/svc-teamcity-ansible/.julia/packages/PackageCompiler/R3n2H/src/embedding_wrapper.c:7:
/opt/teamcityagent/work/44830c4db5199711/julia-1.7.0-rc3/include/julia/julia_atomics.h:38:23: fatal error: stdatomic.h: No such file or directory
 #include <stdatomic.h>
 ^
compilation terminated.
ERROR: LoadError: failed process: Process(`gcc '-DJULIA_MAIN="wflow_cli.julia_main"' -DNEW_DEFINE_FAST_TLS_SYNTAX -m64 -march=x86-64 -o wflow_bundle/bin/wflow_cli /u/svc-teamcity-ansible/.julia/packages/PackageCompiler/R3n2H/src/embedding_wrapper.c -O2 '-Wl,-rpath,$ORIGIN/../lib:$ORIGIN/../lib/julia' -std=gnu99 -I/opt/teamcityagent/work/44830c4db5199711/julia-1.7.0-rc3/include/julia -fPIC -L/opt/teamcityagent/work/44830c4db5199711/julia-1.7.0-rc3/lib -L/opt/teamcityagent/work/44830c4db5199711/julia-1.7.0-rc3/lib/julia -Wl,--export-dynamic -Wl,-rpath-link,/opt/teamcityagent/work/44830c4db5199711/julia-1.7.0-rc3/lib -Wl,-rpath-link,/opt/teamcityagent/work/44830c4db5199711/julia-1.7.0-rc3/lib/julia -ljulia -ljulia-internal`, ProcessExited(1)) [1]

Stacktrace:
 [1] pipeline_error
 @ ./process.jl:531 [inlined]
 [2] run(::Cmd; wait::Bool)
 @ Base ./process.jl:446
 [3] run
 @ ./process.jl:444 [inlined]
 [4] run_compiler(cmd::Cmd; cplusplus::Bool)
 @ PackageCompiler ~/.julia/packages/PackageCompiler/R3n2H/src/PackageCompiler.jl:163
 [5] run_compiler
 @ ~/.julia/packages/PackageCompiler/R3n2H/src/PackageCompiler.jl:120 [inlined]
 [6] create_executable_from_sysimg(exe_path::String, c_driver_program::String, julia_main::String)
 @ PackageCompiler ~/.julia/packages/PackageCompiler/R3n2H/src/PackageCompiler.jl:726
 [7] create_app(package_dir::String, app_dir::String; executables::Vector{Pair{String, String}}, precompile_execution_file::String, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, force::Bool, c_driver_program::String, cpu_target::String, include_lazy_artifacts::Bool, sysimage_build_args::Cmd, include_transitive_dependencies::Bool)
 @ PackageCompiler ~/.julia/packages/PackageCompiler/R3n2H/src/PackageCompiler.jl:713
 [8] top-level scope
 @ /opt/teamcityagent/work/44830c4db5199711/create_app/create_app.jl:8
 [9] include(fname::String)
 @ Base.MainInclude ./client.jl:451
 [10] top-level scope
 @ /opt/teamcityagent/work/44830c4db5199711/contrib/build_steps.jl:32
in expression starting at /opt/teamcityagent/work/44830c4db5199711/create_app/create_app.jl:8
in expression starting at /opt/teamcityagent/work/44830c4db5199711/contrib/build_steps.jl:32
Process exited with code 1

The code to the app that is being built here, if relevant, is https://gitlab.com/deltares/wflow/wflow_cli.

@KristofferC
Copy link
Member

Can you try with #638?

@visr
Copy link
Contributor Author

visr commented Nov 20, 2021

Thanks for looking into it. Unfortunately I still get the same error:

/opt/teamcityagent/work/44830c4db5199711/julia-1.7.0-rc3/include/julia/julia_atomics.h:38:23: fatal error: stdatomic.h: No such file or directory
 #include <stdatomic.h>
                       ^
compilation terminated.
ERROR: LoadError: failed process: Process(`gcc '-DJULIA_MAIN="wflow_cli.julia_main"' -DNEW_DEFINE_FAST_TLS_SYNTAX -m64 -march=x86-64 -o wflow_bundle/bin/wflow_cli /u/svc-teamcity-ansible/.julia/packages/PackageCompiler/voMQc/src/embedding_wrapper.c -O2 '-Wl,-rpath,$ORIGIN/../lib:$ORIGIN/../lib/julia' -std=gnu11 -I/opt/teamcityagent/work/44830c4db5199711/julia-1.7.0-rc3/include/julia -fPIC -L/opt/teamcityagent/work/44830c4db5199711/julia-1.7.0-rc3/lib -L/opt/teamcityagent/work/44830c4db5199711/julia-1.7.0-rc3/lib/julia -Wl,--export-dynamic -Wl,-rpath-link,/opt/teamcityagent/work/44830c4db5199711/julia-1.7.0-rc3/lib -Wl,-rpath-link,/opt/teamcityagent/work/44830c4db5199711/julia-1.7.0-rc3/lib/julia -ljulia -ljulia-internal`, ProcessExited(1)) [1]

I now see -std=gnu11 in the gcc call, so it did use the right branch.

@KristofferC
Copy link
Member

What version of gcc do you have?

@visr
Copy link
Contributor Author

visr commented Nov 20, 2021

Aha. This is on a CentOS 7 machine with gcc 4.8.5. It seems from gcc 4.9 this should work, according to the gcc changelog:

ISO C11 atomics (the _Atomic type specifier and qualifier and the <stdatomic.h> header) are now supported.

I'll see if I can use a newer gcc on those build servers.

@visr
Copy link
Contributor Author

visr commented Nov 20, 2021

Ok I tried gcc 7.3.0, and that works with and without #638. Though that makes sense since for that version -std=gnu11 is the default according to https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Standards.html.

So I think it'd be good to merge #638 anyway. Regarding the documentation, I guess:

Having a decently modern gcc or clang available should be enough to use PackageCompiler on Linux or macOS.

would not include gcc 4.8 😅

@visr visr closed this as completed Nov 22, 2021
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

2 participants