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

set up a minimal build environment when using system compiler #3399

Merged
merged 9 commits into from
Aug 18, 2020

Conversation

boegel
Copy link
Member

@boegel boegel commented Aug 5, 2020

It should be safe to define $CC & co to the standard GCC compiler commands when using the system toolchain.

Not only will this fix the problem discussed in #3398, it also ensures that values for $CC & co that were defined outside of EasyBuild don't mess things up...

(fixes #3398)

check system compilers to set minimal buildenv
@easybuilders easybuilders deleted a comment from boegelbot Aug 8, 2020
@boegel boegel force-pushed the system_toolchain_buildenv branch from 2567d0f to d464241 Compare August 8, 2020 08:41
lexming
lexming previously approved these changes Aug 8, 2020
Copy link
Contributor

@lexming lexming left a comment

Choose a reason for hiding this comment

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

LGTM

@lexming
Copy link
Contributor

lexming commented Aug 8, 2020

Positive test with M4-1.4.18.eb in a sane environment: https://gist.github.com/lexming/9d1de285e054fc3d11605af6ef374422

== 2020-08-08 12:04:38,209 filetools.py:456 INFO Command gcc found at /usr/bin/gcc
== 2020-08-08 12:04:38,210 toolchain.py:257 INFO Found compiler command gcc at /usr/bin/gcc, so setting $CC in minimal build environment
== 2020-08-08 12:04:38,210 filetools.py:456 INFO Command g++ found at /usr/bin/g++
== 2020-08-08 12:04:38,210 toolchain.py:257 INFO Found compiler command g++ at /usr/bin/g++, so setting $CXX in minimal build environment
== 2020-08-08 12:04:38,211 environment.py:97 INFO Environment variable CC set to gcc (previously undefined)
== 2020-08-08 12:04:38,211 environment.py:97 INFO Environment variable CXX set to g++ (previously undefined)

@lexming
Copy link
Contributor

lexming commented Aug 8, 2020

Positive test with M4-1.4.18.eb in a environment without system compilers: https://gist.github.com/lexming/8202fedd8feab77ae50a7d7b18a0e9f8

== 2020-08-08 12:13:41,040 filetools.py:469 WARNING Could not find command 'gcc' (with permissions to read/execute it) in $PATH (['/user/brussel/101/vsc10122/src/easybuild-framework', '/user/brussel/101/vsc10122/bin', '/usr/sbin', '/usr/local/bin', '/usr/local/sbin', '/opt/ibutils/bin'])
== 2020-08-08 12:13:41,040 build_log.py:367 WARNING gcc command not found, not setting $CC in minimal build environment
== 2020-08-08 12:13:41,041 filetools.py:469 WARNING Could not find command 'g++' (with permissions to read/execute it) in $PATH (['/user/brussel/101/vsc10122/src/easybuild-framework', '/user/brussel/101/vsc10122/bin', '/usr/sbin', '/usr/local/bin', '/usr/local/sbin', '/opt/ibutils/bin'])
== 2020-08-08 12:13:41,041 build_log.py:367 WARNING g++ command not found, not setting $CXX in minimal build environment
[...]
configure: error: no acceptable C compiler found in $PATH
[...]

@lexming
Copy link
Contributor

lexming commented Aug 8, 2020

Positive test with foss-2019b.eb where it picks the compilers loaded by EB: https://gist.github.com/lexming/7273065257377601c25905b6bfd14b9e

== 2020-08-08 12:00:00,928 filetools.py:456 INFO Command gcc found at /apps/brussel/CO7/skylake/software/GCCcore/8.3.0/bin/ gcc
== 2020-08-08 12:00:00,928 toolchain.py:257 INFO Found compiler command gcc at /apps/brussel/CO7/skylake/software/GCCcore/8.3.0/bin/gcc, so setting $CC in minimal build environment
== 2020-08-08 12:00:00,930 filetools.py:456 INFO Command g++ found at /apps/brussel/CO7/skylake/software/GCCcore/8.3.0/bin/g++
== 2020-08-08 12:00:00,930 toolchain.py:257 INFO Found compiler command g++ at /apps/brussel/CO7/skylake/software/GCCcore/8.3.0/bin/g++, so setting $CXX in minimal build environment
== 2020-08-08 12:00:00,930 environment.py:97 INFO Environment variable CC set to gcc (previously undefined)
== 2020-08-08 12:00:00,931 environment.py:97 INFO Environment variable CXX set to g++ (previously undefined)

easybuild/tools/toolchain/toolchain.py Outdated Show resolved Hide resolved
easybuild/tools/toolchain/toolchain.py Outdated Show resolved Hide resolved
easybuild/tools/toolchain/toolchain.py Outdated Show resolved Hide resolved
@boegel
Copy link
Member Author

boegel commented Aug 18, 2020

(just for the record: also tested with easybuilders/easybuild-easyconfigs#11122, which is a bit of a special case)

Copy link
Contributor

@casparvl casparvl left a comment

Choose a reason for hiding this comment

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

I'm happy now :)

@casparvl casparvl merged commit 9bc54d9 into easybuilders:develop Aug 18, 2020
@boegel boegel deleted the system_toolchain_buildenv branch August 19, 2020 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

installing M4-1.4.18.eb with --rpath fails if x86_64-pc-linux-gnu-gcc command is available
5 participants