sparcians / map

Modeling Architectural Platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error building conda dev environment for Sparta

arupc opened this issue · comments

commented

Followed the instructions from:here

Completed step 3 without any error. Then, at step 4, when the following command is executed, it runs for a while and then returns the following error:

SHA used: dbce13e5

% ./scripts/create_conda_env.sh sparta_test_dev dev 

<snip>
--------------
Hash contents:
--------------
{'boost': '1.74.0',
 'boost_cpp': '1.74.0',
 'c_compiler': 'gcc',
 'c_compiler_version': '10',
 'channel_targets': 'conda-forge main',
 'cxx_compiler': 'gxx',
 'cxx_compiler_version': '10',
 'hdf5': '1.10.6',
 'linux_clang_version': '13',
 'numpy': '1.19',
 'python': '3.8.* *_cpython',
 'sqlite': '3',
 'target_platform': 'linux-64'}
----------
meta.yaml:
----------
Wrote yaml to rendered_recipe.DeGkqT
::SUCCESS:: Rendered recipe written to 'rendered_recipe.DeGkqT'
+ ./scripts/rendered2env_yaml.sh rendered_recipe.DeGkqT dev
+ rm rendered_recipe.DeGkqT
+ set -x
+ conda env create -f=environment.DeGkqT.yml -n sparta_test_dev
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/users/achakraborty/miniforge3/lib/python3.10/site-packages/conda/exceptions.py", line 1118, in __call__
        return func(*args, **kwargs)
      File "/users/achakraborty/miniforge3/lib/python3.10/site-packages/conda_env/cli/main.py", line 78, in do_call
        exit_code = getattr(module, func_name)(args, parser)
      File "/users/achakraborty/miniforge3/lib/python3.10/site-packages/conda/notices/core.py", line 109, in wrapper
        return func(*args, **kwargs)
      File "/users/achakraborty/miniforge3/lib/python3.10/site-packages/conda_env/cli/main_create.py", line 154, in execute
        result[installer_type] = installer.install(prefix, pkg_specs, args, env)
      File "/users/achakraborty/miniforge3/lib/python3.10/site-packages/conda_env/installers/conda.py", line 46, in install
        solver = _solve(prefix, specs, args, env, *_, **kwargs)
      File "/users/achakraborty/miniforge3/lib/python3.10/site-packages/conda_env/installers/conda.py", line 30, in _solve
        solver = solver_backend(prefix, channels, subdirs, specs_to_add=specs)
      File "/users/achakraborty/miniforge3/lib/python3.10/site-packages/conda/core/solve.py", line 93, in __init__
        self.specs_to_add = frozenset(MatchSpec.merge(s for s in specs_to_add))
      File "/users/achakraborty/miniforge3/lib/python3.10/site-packages/conda/models/match_spec.py", line 481, in merge
        reduce(lambda x, y: x._merge(y, union), group) if len(group) > 1 else group[0]
      File "/users/achakraborty/miniforge3/lib/python3.10/site-packages/conda/models/match_spec.py", line 481, in <lambda>
        reduce(lambda x, y: x._merge(y, union), group) if len(group) > 1 else group[0]
      File "/users/achakraborty/miniforge3/lib/python3.10/site-packages/conda/models/match_spec.py", line 512, in _merge
        final = this_component.merge(that_component)
      File "/users/achakraborty/miniforge3/lib/python3.10/site-packages/conda/models/match_spec.py", line 787, in merge
        raise ValueError("Incompatible component merge:\n  - %r\n  - %r"
    ValueError: Incompatible component merge:
      - 'h81ceb04_0'
      - 'hf9c8cef_0'
<snip>
An unexpected error has occurred. Conda has prepared the above report.

If submitted, this report will be used by core maintainers to improve
future releases of conda.

What version of Conda are you using? Sometimes you can fix this problem by upgrading to the latest version.

commented

This is the conda version I am using.

% conda -V
conda 22.11.1

This is the latest conda version installed using https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh

commented

To the extent I can see, the immediate cause for this problem is the environment.yml file specifies same dependency with same version number but different build (?) hashes:

  • krb5=1.20.1=h81ceb04_0
  • krb5=1.20.1=hf9c8cef_0

This, in turn, is being caused by output of scripts/render_recipe_for_platform.sh, which produces:

requirements:
build:
....
- krb5 1.20.1 h81ceb04_0
....
host:
....
- krb5 1.20.1 hf9c8cef_0
....

One of those specifications is coming from the "build" part of recipe, while the other from "host" part of the recipe.

There are multiple cases of dependencies like this.

This is probably similar to #145. I'll see if I can reproduce, but if you are blocked on this, you can try to remove duplicates and run the steps manually instead.

commented

I removed the duplicate dependency specifications with different hashes from the generated environment..yml, but that resulted in multiple conflicts as mentioned #145 . Only when I removed version numbers and build hashes for all dependencies, I was able to generate a conda environment without further error.

However, using that conda environment results in the following compilation error while building Sparta

/users/achakraborty/external/map/sparta/./sparta/utils/LexicalCast.hpp: In function 'T sparta::lexicalCast(const std::string&, uint32_
t)':
/users/achakraborty/external/map/sparta/./sparta/utils/LexicalCast.hpp:85:25: error: the address of 'ss' will never be NULL [-Werror=a
ddress]
   85 |         if(((void*)&ss) != nullptr){
      |            ~~~~~~~~~~~~~^~~~~~~~~~
/users/achakraborty/external/map/sparta/./sparta/utils/LexicalCast.hpp:82:27: note: 'ss' declared here
   82 |         std::stringstream ss;
      |                           ^~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/sparta.dir/build.make:90: CMakeFiles/sparta.dir/src/AsyncTimeseriesReport.cpp.o] Error 1

Note that this error didn't happen in the previously working conda environment.

commented

As a workaround, I was able to create a working conda environment and build Sparta successfully using following steps:

  • Manually edit the script-generated environment..yml to remove all version numbers and build hashes and use that to create a conda environment. This will create a conda environment without further error. However using this will cause Sparta build error, as noted above
  • Then I downgraded gcc from 12.2 to 10.4.0 using conda install -c conda-forge gcc_linux-64=10.4.0

Resulting conda environment can be used to build Sparta successfully.

I think this was fixed...