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

Appending the same environment variable in different places yields incorrect export results #4736

Open
dqwu opened this issue Jan 15, 2025 · 1 comment
Assignees

Comments

@dqwu
Copy link
Contributor

dqwu commented Jan 15, 2025

In my E3SM feature branch, config_machines.xml appends PKG_CONFIG_PATH in two places on the machine frontier:

<environment_variables>
  <env name="PKG_CONFIG_PATH">$ENV{CRAY_LIBSCI_PREFIX_DIR}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}</env>
  ...
</environment_variables>
...
<environment_variables compiler="gnu.*" mpilib="mpich">
  ...
  <env name="PKG_CONFIG_PATH">/lustre/orion/cli115/world-shared/frontier/3rdparty/protobuf/21.6/gcc-12.2.0/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}</env>
</environment_variables>

After running case.setup, .env_mach_specific.sh shows:

export PKG_CONFIG_PATH=/opt/cray/pe/libsci/23.09.1.1/GNU/10.3/x86_64/lib/pkgconfig:/lustre/orion/cli115/world-shared/frontier/3rdparty/protobuf/21.6/gcc-12.2.0/lib/pkgconfig:/opt/cray/pe/parallel-netcdf/1.12.3.1/gnu/9.1/lib/pkgconfig:/opt/cray/pe/netcdf-hdf5parallel/4.9.0.1/gnu/9.1/lib/pkgconfig:/opt/cray/pe/hdf5-parallel/1.12.2.1/gnu/9.1/lib/pkgconfig:/opt/cray/libfabric/1.15.2.0/lib64/pkgconfig:/sw/frontier/spack-envs/base/opt/linux-sles15-x86_64/gcc-7.5.0/zlib-1.2.11-zuyclcfig4tizmb2bm2h4roqsp3rwn2y/lib/pkgconfig:/sw/frontier/spack-envs/base/opt/linux-sles15-x86_64/gcc-7.5.0/subversion-1.14.1-rcptsltz4q4clvbt5e2aua25nvwdf4ss/share/pkgconfig:/opt/cray/pe/gcc/12.2.0/snos/lib/pkgconfig:/opt/cray/pe/dsmml/0.2.2/dsmml/lib/pkgconfig:/opt/cray/pe/craype/2.7.31.11/pkg-config:/opt/cray/pe/pmi/6.1.13/lib/pkgconfig
...
export PKG_CONFIG_PATH=/lustre/orion/cli115/world-shared/frontier/3rdparty/protobuf/21.6/gcc-12.2.0/lib/pkgconfig:/lustre/orion/cli115/world-shared/frontier/3rdparty/protobuf/21.6/gcc-12.2.0/lib/pkgconfig:/opt/cray/pe/parallel-netcdf/1.12.3.1/gnu/9.1/lib/pkgconfig:/opt/cray/pe/netcdf-hdf5parallel/4.9.0.1/gnu/9.1/lib/pkgconfig:/opt/cray/pe/hdf5-parallel/1.12.2.1/gnu/9.1/lib/pkgconfig:/opt/cray/libfabric/1.15.2.0/lib64/pkgconfig:/sw/frontier/spack-envs/base/opt/linux-sles15-x86_64/gcc-7.5.0/zlib-1.2.11-zuyclcfig4tizmb2bm2h4roqsp3rwn2y/lib/pkgconfig:/sw/frontier/spack-envs/base/opt/linux-sles15-x86_64/gcc-7.5.0/subversion-1.14.1-rcptsltz4q4clvbt5e2aua25nvwdf4ss/share/pkgconfig:/opt/cray/pe/gcc/12.2.0/snos/lib/pkgconfig:/opt/cray/pe/dsmml/0.2.2/dsmml/lib/pkgconfig:/opt/cray/pe/craype/2.7.31.11/pkg-config:/opt/cray/pe/pmi/6.1.13/lib/pkgconfig

For the second "export PKG_CONFIG_PATH=XXXX" call in .env_mach_specific.sh, /opt/cray/pe/libsci/23.09.1.1/GNU/10.3/x86_64/lib/pkgconfig (in the first call) is lost.

Steps to reproduce:

[Clone the E3SM repository]

git clone https://github.com/E3SM-Project/E3SM.git
cd E3SM

git merge --no-edit origin/dqwu/machinefiles/adios-upgrade
git submodule update --init

[Create and set up a simple X case]

cd cime/scripts

./create_newcase --machine=frontier --compiler=gnu --case X_f19_g16 --compset X --res f19_g16

cd X_f19_g16

./case.setup

[Check .env_mach_specific.sh]
cat .env_mach_specific.sh

@jedwards4b
Copy link
Contributor

@dqwu I think that supporting the feature you are requesting would be quite complicated. You could simply repeat the first change to PKG_CONFIG_PATH in the second as:
<env name="PKG_CONFIG_PATH">/lustre/orion/cli115/world-shared/frontier/3rdparty/protobuf/21.6/gcc-12.2.0/lib/pkgconfig:$ENV{CRAY_LIBSCI_PREFIX_DIR}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}</env>

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

4 participants