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 fails with USE_SYSTEM_CSL=1 #47987

Closed
antonio-rojas opened this issue Dec 24, 2022 · 19 comments · Fixed by #48342
Closed

Build fails with USE_SYSTEM_CSL=1 #47987

antonio-rojas opened this issue Dec 24, 2022 · 19 comments · Fixed by #48342
Labels
building Build system, or building Julia or its dependencies

Comments

@antonio-rojas
Copy link
Contributor

Since commit 96592e2 julia build fails with USE_SYSTEM_CSL=1 with error

ERROR: Unable to load dependent library /build/julia/src/julia-1.8.4/usr/bin/../lib/libstdc++.so.6
Message:/build/julia/src/julia-1.8.4/usr/bin/../lib/libstdc++.so.6: cannot open shared object file: No such file or directory

The libstdc++.so.6 symlink is in usr/lib/julia, but the build system expects to find it in usr/lib

@t-bltg
Copy link
Contributor

t-bltg commented Dec 24, 2022

I've hit this too, following #46976.

This occurs at the julia-sysimg-ji step when we use the freshly built $JULIA_EXECUTABLE to generate the sysimage and before the stringreplace fix is applied in the install step.

cc @apaz-cli

@brenhinkeller brenhinkeller added the building Build system, or building Julia or its dependencies label Dec 24, 2022
@xgqt
Copy link
Contributor

xgqt commented Jan 8, 2023

I've hit this too while packaging Julia version 1.8.4 for Gentoo,
I was thinking about applying the following workaround:

# Julia's build system still fails to copy/link GCC's libs.
mkdir -p "${S}"/usr/lib || die
local gcc_prefix
if use amd64 ; then
    gcc_prefix=x86_64-pc-linux-gnu
elif use x86 ; then
    gcc_prefix=x86-pc-linux-gnu
else
    die "Unsupported architecture"
fi
ln -s "${EROOT}"/usr/lib/gcc/${gcc_prefix}/*/libstdc++.so.6   \
    "${S}"/usr/lib/ || die	

But that is way too hacky and error prone.

@xgqt
Copy link
Contributor

xgqt commented Jan 8, 2023

I've hit this too while packaging Julia version 1.8.4 for Gentoo, I was thinking about applying the following workaround:

# Julia's build system still fails to copy/link GCC's libs.
mkdir -p "${S}"/usr/lib || die
local gcc_prefix
if use amd64 ; then
    gcc_prefix=x86_64-pc-linux-gnu
elif use x86 ; then
    gcc_prefix=x86-pc-linux-gnu
else
    die "Unsupported architecture"
fi
ln -s "${EROOT}"/usr/lib/gcc/${gcc_prefix}/*/libstdc++.so.6   \
    "${S}"/usr/lib/ || die	

But that is way to hacky and error prone.

Here is the full log: build.log

@xgqt
Copy link
Contributor

xgqt commented Jan 8, 2023

I've hit this too while packaging Julia version 1.8.4 for Gentoo, I was thinking about applying the following workaround:

# Julia's build system still fails to copy/link GCC's libs.
mkdir -p "${S}"/usr/lib || die
local gcc_prefix
if use amd64 ; then
    gcc_prefix=x86_64-pc-linux-gnu
elif use x86 ; then
    gcc_prefix=x86-pc-linux-gnu
else
    die "Unsupported architecture"
fi
ln -s "${EROOT}"/usr/lib/gcc/${gcc_prefix}/*/libstdc++.so.6   \
    "${S}"/usr/lib/ || die	

But that is way to hacky and error prone.

HMMM...
https://github.com/archlinux/svntogit-community/blob/packages/julia/trunk/PKGBUILD#L97

@fxcoudert
Copy link
Contributor

We are hitting this bug in Homebrew as well: Homebrew/homebrew-core#120170
This is currently preventing us from updating beyond 1.8.3

@staticfloat
Copy link
Member

Can everyone affected by this issue please try out #48342 and see if that fixes anything for them?

@antonio-rojas
Copy link
Contributor Author

Can everyone affected by this issue please try out #48342 and see if that fixes anything for them?

Works for me

@t-bltg
Copy link
Contributor

t-bltg commented Jan 19, 2023

Can everyone affected by this issue please try out #48342 and see if that fixes anything for them?

Thanks for fixing. Re-building julia from scratch with this PR applied fixes the issue.

@fxcoudert
Copy link
Contributor

This fixes the build on Linux for Homebrew.

@xgqt
Copy link
Contributor

xgqt commented Jan 19, 2023

For me v1.8.5 patched with #48342
passes compile step but fails to install.

[ ... SNIP ... ]
cp: cannot stat '/var/tmp/portage/dev-lang/julia-1.8.5/work/julia-1.8.5/usr/lib/julia/libbtf.so*': No such file or directory
chmod: cannot access '/var/tmp/portage/dev-lang/julia-1.8.5/image/usr/lib64/julia/libbtf.so*': No such file or directory
[ ... SNIP ... ]
MSYS2_ARG_CONV_EXCL='*' /var/tmp/portage/dev-lang/julia-1.8.5/work/julia-1.8.5/usr/tools/stringreplace $(strings -t x - '/var/tmp/portage/dev-lang/julia-1.8.5/image""/usr"/lib64"/libjulia.so.1.8' | grep "julia/libgcc_s.so.1:julia/libopenlibm.so:@julia/libstdc++.so.6:@libjulia-internal.so.1:@libjulia-codegen.so.1:$" | awk '{print $1;}') "julia/libgcc_s.so.1:julia/libopenlibm.so:@julia/libstdc++.so.6:@julia/libjulia-internal.so.1:@julia/libjulia-codegen.so.1:" 255 "/var/tmp/portage/dev-lang/julia-1.8.5/image""/usr"/lib64"/libjulia.so.1.8"
strings: '/var/tmp/portage/dev-lang/julia-1.8.5/image""/usr"/lib64"/libjulia.so.1.8': No such file
Usage:
  /var/tmp/portage/dev-lang/julia-1.8.5/work/julia-1.8.5/usr/tools/stringreplace <hex offset> <string to write> <maxlen> <file>
make: *** [Makefile:279: install] Error 255

Build log:
build.log.txt

@staticfloat
Copy link
Member

It looks to me like the critical failure in your log is:

strings: '/var/tmp/portage/dev-lang/julia-1.8.5/image""/usr"/lib64"/libjulia.so.1.8': No such file

It looks to me like you've got some strange quoting issues going on, but that's probably not the issue. The issue is probably that it's using lib64 instead of lib. Can you share how you're overriding the lib directory name?

@xgqt
Copy link
Contributor

xgqt commented Jan 19, 2023

It looks to me like the critical failure in your log is:

strings: '/var/tmp/portage/dev-lang/julia-1.8.5/image""/usr"/lib64"/libjulia.so.1.8': No such file

It looks to me like you've got some strange quoting issues going on, but that's probably not the issue. The issue is probably that it's using lib64 instead of lib. Can you share how you're overriding the lib directory name?

Via libdir:

override libdir:="\$(prefix)/$(get_libdir)"

Full config: https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-lang/julia/julia-1.8.3-r2.ebuild#n115

@vtjnash
Copy link
Member

vtjnash commented Jan 19, 2023

it is unlikely you want a relative path starting with the " directory

@xgqt
Copy link
Contributor

xgqt commented Jan 19, 2023

it is unlikely you want a relative path starting with the " directory

True, I do not want a path starting with ".
Makefile probably uses the variables in a wrong way.

@staticfloat
Copy link
Member

Yeah, you should drop the quotes from your makefile overrides; Make is going to insert those, and you'll get those strange quoting issues everywhere. This isn't a problem with our makefile, it's just how Make itself works:

$ cat Makefile 
FOO := "foo"

run:
        echo "$(FOO)/bar"
$ make
echo ""foo"/bar"
foo/bar

Note how $(FOO) gets expanded to "foo", not foo as you might expect. The shell then parses that as an empty string "", concatenated with foo, concatenated with the string "/bar", which it prints out just fine, but with more complex commands you can imagine this might result in unintended quoting issues.

@xgqt
Copy link
Contributor

xgqt commented Jan 19, 2023

After fixing custom Make config the install process passes.

@xgqt
Copy link
Contributor

xgqt commented Jan 20, 2023

Another issue related to setting libdir it seems:

ERROR: could not load library "/usr/bin/../lib/julia/sys.so"
/usr/bin/../lib/julia/sys.so: cannot open shared object file: No such file or directory

@xgqt
Copy link
Contributor

xgqt commented Jan 20, 2023

Another issue related to setting libdir it seems:

ERROR: could not load library "/usr/bin/../lib/julia/sys.so"
/usr/bin/../lib/julia/sys.so: cannot open shared object file: No such file or directory

and when /usr/lib/julia is linked to /usr/lib64/julia, then Julia will fails to precompile many packages (because it fails to find libraries).

michaelkuhn added a commit to michaelkuhn/spack that referenced this issue May 29, 2023
[email protected]:1.8.5 fails to build because it does not find libstdc++ (see
JuliaLang/julia#47987).
michaelkuhn added a commit to michaelkuhn/spack that referenced this issue May 29, 2023
[email protected]:1.8.5 fails to build because it does not find libstdc++ (see
JuliaLang/julia#47987).
@giordano
Copy link
Contributor

Fixed by #48342.

tldahlgren pushed a commit to spack/spack that referenced this issue May 30, 2023
[email protected]:1.8.5 fails to build because it does not find libstdc++ (see JuliaLang/julia#47987).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants