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

Statically link ncurses... #3545

Merged
merged 8 commits into from
Sep 8, 2016
Merged

Statically link ncurses... #3545

merged 8 commits into from
Sep 8, 2016

Conversation

ocaisa
Copy link
Member

@ocaisa ocaisa commented Sep 7, 2016

so it's not needed at runtime

so it's not needed at runtime
@ocaisa
Copy link
Member Author

ocaisa commented Sep 7, 2016

Fixes an issue for easybuilders/easybuild-framework#1882

@boegel boegel added this to the v2.9.0 milestone Sep 7, 2016
@boegel
Copy link
Member

boegel commented Sep 7, 2016

Test report by @boegel
FAILED
Build succeeded for 0 out of 1 (1 easyconfigs in this PR)
node2011.delcatty.os - Linux SL 6.8, Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz, Python 2.6.6
See https://gist.github.com/1463f1402793e43b7738ef6f68220134 for a full test report.

@boegel
Copy link
Member

boegel commented Sep 7, 2016

This breaks the build, requires another build dep?

@ocaisa
Copy link
Member Author

ocaisa commented Sep 7, 2016

Yeah, libreadline...I'm on it

@boegel
Copy link
Member

boegel commented Sep 7, 2016

Test report by @boegel
FAILED
Build succeeded for 1 out of 2 (2 easyconfigs in this PR)
node2601.swalot.os - Linux centos linux 7.2.1511, Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60GHz, Python 2.7.5
See https://gist.github.com/5c3303ac90ceea87960a213cf33fc024 for a full test report.

@ocaisa
Copy link
Member Author

ocaisa commented Sep 7, 2016

Hmm, not sure what to do here, the libtinfo functionality is inside libncurses, not sure why Lua is requesting it, I'll take a look at the configure script

@ocaisa
Copy link
Member Author

ocaisa commented Sep 7, 2016

I think using pkg-config for ncurses and Lua might solve this problem...but I can't reproduce the problem to check. I'll blindly throw it in and see if that fixes it for you

@boegel
Copy link
Member

boegel commented Sep 7, 2016

Test report by @boegel
FAILED
Build succeeded for 3 out of 4 (4 easyconfigs in this PR)
node2141.delcatty.os - Linux SL 6.8, Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz, Python 2.6.6
See https://gist.github.com/b476ee6d397b2a2d6679871ada221315 for a full test report.

@boegel
Copy link
Member

boegel commented Sep 7, 2016

Test report by @boegel
FAILED
Build succeeded for 3 out of 4 (4 easyconfigs in this PR)
node2603.swalot.os - Linux centos linux 7.2.1511, Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60GHz, Python 2.7.5
See https://gist.github.com/4c6ffa026d43689246ed3b6ac6d8129b for a full test report.

@@ -16,9 +16,10 @@ sources = [SOURCE_TAR_GZ]

configopts = [
# default build
'--with-shared --enable-overwrite',
'--with-shared --enable-overwrite --with-termlib',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ocaisa this should be reflected in the sanity_check_paths too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ocaisa Why exactly was this required here? It makes this ncurses easyconfig that uses dummy different from the other ncurses easyconfigs, which causes problems (see also easybuilders/easybuild-easyblocks#1088).

I'm not saying we should blindly revert this change, since the split is already taken into account elsewhere (for example in https://github.com/easybuilders/easybuild-easyconfigs/pull/4977/files#diff-03dfb6d80d1923383727d96e696cc53fR20), just wondering what the exact reason was for this.

cc @pforai

Copy link
Member Author

@ocaisa ocaisa Aug 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only had to do this to be able to build lua at the dummy level, it was never an issue for me, it was an issue for the tests. (from what I remember)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks for clarifying.

Looking back at the test report at https://gist.github.com/boegel/5c3303ac90ceea87960a213cf33fc024, building Lua-5.1.4-8.eb was indeed failing without the split:

gcc -o lua  lua.o liblua.a -lm -Wl,-E -ldl -Wl,-Bstatic -lhistory -lreadline -ltinfo -lncurses  -Wl,-Bdynamic
gcc -o luac  luac.o print.o liblua.a -lm -Wl,-E -ldl -Wl,-Bstatic -lhistory -lreadline -ltinfo -lncurses  -Wl,-Bdynamic
/usr/bin/ld: cannot find -ltinfo
/usr/bin/ld: cannot find -ltinfo

Maybe the proper fix would have been to not let Lua link with -ltinfo though...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vanzod
Ok, I think I have a fix for this but some may consider it hackish.

Some systems do expect a separate tinfo by default (Ubuntu 16.04) and in that case if we don't provide libtinfo from ncurses, some configures (such as the Lua one in the original PR) will pick it up from the OS. To get around this we can just do a soft link of libtinfo.so -> libncurses.so after installing ncurses which is what debian has done in the past.

I also found (what I think is) a problem with our libreadline easyconfigs. I'm not sure of the purpose of the linking to ncurses there, but if we are expecting ncurses to be force-linked in the final .so then we are not doing it right, the correct option ( for v6.3) is

buildopts = "SHLIB_LIBS='-lncurses'"

(from http://www.linuxfromscratch.org/lfs/view/7.4/chapter06/readline.html)

With those two options I can revert the ncurses build to be more like the rest. I'll open a PR and we can discuss further there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #5067

@boegel
Copy link
Member

boegel commented Sep 8, 2016

Test report by @boegel
SUCCESS
Build succeeded for 3 out of 3 (3 easyconfigs in this PR)
node2415.golett.os - Linux centos linux 7.2.1511, Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz, Python 2.7.5
See https://gist.github.com/41081035cc919dc785a9ff766a850d00 for a full test report.

@boegel
Copy link
Member

boegel commented Sep 8, 2016

Test report by @boegel
SUCCESS
Build succeeded for 3 out of 3 (3 easyconfigs in this PR)
node2415.golett.os - Linux centos linux 7.2.1511, Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz, Python 2.7.5
See https://gist.github.com/8be0cada6ab2e46779eba9cce4374a53 for a full test report.

@boegel
Copy link
Member

boegel commented Sep 8, 2016

Test report by @boegel
SUCCESS
Build succeeded for 3 out of 3 (3 easyconfigs in this PR)
node2017.delcatty.os - Linux SL 6.8, Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz, Python 2.6.6
See https://gist.github.com/871962c0b0d5432761d11b89fb14f0d0 for a full test report.

@boegel
Copy link
Member

boegel commented Sep 8, 2016

lgtm

@boegel
Copy link
Member

boegel commented Sep 8, 2016

Going in, thanks @ocaisa!

@boegel boegel merged commit 3ad68d2 into easybuilders:develop Sep 8, 2016
@ocaisa
Copy link
Member Author

ocaisa commented Sep 8, 2016

It works but gives me a strange end result, I'm not sure it does what I think it does. For my case if I don't include the libreadline dep and I say to link statically, I get a lua executable that doesn't depend on anything other than basic system libs

@ocaisa
Copy link
Member Author

ocaisa commented Sep 8, 2016

Maybe not, just repeated and things are different, I must have made a mistake

@boegel
Copy link
Member

boegel commented Sep 8, 2016

Looks OK on my end:

$ ml Lua/5.1.4-8
$ ldd $(which lua)
        linux-vdso.so.1 =>  (0x00002aaaaaaab000)
        libm.so.6 => /lib64/libm.so.6 (0x00002aaaaaac0000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002aaaaadc3000)
        libc.so.6 => /lib64/libc.so.6 (0x00002aaaaafc7000)
        /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
$ which lua
/user/scratch/gent/vsc400/vsc40023/easybuild_REGTEST/CO7/haswell-ib/software/Lua/5.1.4-8/bin/lua

@ocaisa
Copy link
Member Author

ocaisa commented Sep 8, 2016

Yeah, you are right, I messed it up somehow

@ocaisa ocaisa deleted the patch-4 branch September 8, 2016 11:00
MaximeMoge pushed a commit to sara-nl/easybuild-easyconfigs that referenced this pull request Oct 21, 2021
…(see easybuilders#3545) creating a soft link 'libtinfo.so -> libncurses.so' and extending it to create soft links 'libtinfo.so.5.9 -> libncurses.so.5.9' and 'libtinfo.so.5 -> libncurses.so.5' as well.
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

Successfully merging this pull request may close these issues.

2 participants