prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Running autotuning fails with `Primary config directory not found.`
  ## 🐛 Bug
  
  When I tried running the auto tuning script, I get an error saying `Primary config directory not found`. See details below.
  
  ## To Reproduce
  
  Steps to reproduce the behavior:
  
  1. Run `make install` from base directory to install from source
  2. Run `python setup.py install` from `examples/` to install scripts.
  3. Run the following command to run the script
  
  ```
  HYDRA_FULL_ERROR=1 python -m llvm_autotuning.tune -m \
    experiment=my-exp \
    outputs=/tmp/logs \
    executor.cpus=32 \
    num_replicas=1 \
    autotuner=nevergrad \
    autotuner.optimization_target=runtime \      
    autotuner.search_time_seconds=600
  ```
  
  The full error message is:
  
  ```
  Traceback (most recent call last):
    File "/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/runpy.py", line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/runpy.py", line 87, in _run_code
      exec(code, run_globals)
    File "/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym_examples-0.2.4-py3.8.egg/llvm_autotuning/tune.py", line 37, in <module>
      main()
    File "/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/main.py", line 49, in decorated_main
      _run_hydra(
    File "/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/utils.py", line 375, in _run_hydra
      run_and_report(
    File "/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/utils.py", line 214, in run_and_report
      raise ex
    File "/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/utils.py", line 211, in run_and_report
      return func()
    File "/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/utils.py", line 376, in <lambda>
      lambda: hydra.multirun(
    File "/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/hydra.py", line 121, in multirun
      cfg = self.compose_config(
    File "/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/hydra.py", line 564, in compose_config
      cfg = self.config_loader.load_configuration(
    File "/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/config_loader_impl.py", line 146, in load_configuration
      return self._load_configuration_impl(
    File "/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/config_loader_impl.py", line 227, in _load_configuration_impl
      self.ensure_main_config_source_available()
    File "/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/config_loader_impl.py", line 134, in ensure_main_config_source_available
      self._missing_config_error(
    File "/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/config_loader_impl.py", line 108, in _missing_config_error
      raise MissingConfigException(
  hydra.errors.MissingConfigException: Primary config directory not found.
  Check that the config directory '/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym_examples-0.2.4-py3.8.egg/llvm_autotuning/config' exists and readable
  ```
  
  ## Expected behavior
  
  The script shouldn't fail.
  
  ## Environment
  
  Please fill in this checklist:
  
  - CompilerGym: latest development branch
  - How you installed CompilerGym (pip, source): source
  - OS: MacOS
  - Python version: 3.7
  - Build command you used (if compiling from source): make install
  - GCC/clang version (if compiling from source):
  - Versions of any other relevant libraries:
  
  You may use the
  [environment collection script](https://raw.githubusercontent.com/facebookresearch/CompilerGym/stable/build_tools/collect_env.py)
  to generate most of this information. You can get the script and run it with:
  
  ```sh
  wget https://raw.githubusercontent.com/facebookresearch/CompilerGym/stable/build_tools/collect_env.py
  # For security purposes, please check the contents of collect_env.py before running it.
  python collect_env.py
  ```
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `examples/setup.py`
  Content:
  ```
  1 #!/usr/bin/env python3
  2 #
  3 # Copyright (c) Facebook, Inc. and its affiliates.
  4 #
  5 # This source code is licensed under the MIT license found in the
  6 # LICENSE file in the root directory of this source tree.
  7 
  8 import distutils.util
  9 
  10 import setuptools
  11 
  12 with open("../VERSION") as f:
  13     version = f.read().strip()
  14 with open("requirements.txt") as f:
  15     requirements = [ln.split("#")[0].rstrip() for ln in f.readlines()]
  16 with open("../tests/requirements.txt") as f:
  17     requirements += [ln.split("#")[0].rstrip() for ln in f.readlines()]
  18 
  19 setuptools.setup(
  20     name="compiler_gym_examples",
  21     version=version,
  22     description="Example code for CompilerGym",
  23     author="Facebook AI Research",
  24     url="https://github.com/facebookresearch/CompilerGym",
  25     license="MIT",
  26     install_requires=requirements,
  27     packages=[
  28         "llvm_autotuning",
  29         "llvm_autotuning.autotuners",
  30         "llvm_rl",
  31         "llvm_rl.model",
  32     ],
  33     package_data={
  34         "llvm_rl": [
  35             "config/*.yaml",
  36             "config/**/*.yaml",
  37         ]
  38     },
  39     python_requires=">=3.8",
  40     platforms=[distutils.util.get_platform()],
  41     zip_safe=False,
  42 )
  43
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/examples/setup.py b/examples/setup.py
  --- a/examples/setup.py
  +++ b/examples/setup.py
  @@ -31,10 +31,14 @@
           "llvm_rl.model",
       ],
       package_data={
  +        "llvm_autotuning": [
  +            "config/*.yaml",
  +            "config/**/*.yaml",
  +        ],
           "llvm_rl": [
               "config/*.yaml",
               "config/**/*.yaml",
  -        ]
  +        ],
       },
       python_requires=">=3.8",
       platforms=[distutils.util.get_platform()],
  
verification_info: {"golden_diff": "diff --git a/examples/setup.py b/examples/setup.py\n--- a/examples/setup.py\n+++ b/examples/setup.py\n@@ -31,10 +31,14 @@\n         \"llvm_rl.model\",\n     ],\n     package_data={\n+        \"llvm_autotuning\": [\n+            \"config/*.yaml\",\n+            \"config/**/*.yaml\",\n+        ],\n         \"llvm_rl\": [\n             \"config/*.yaml\",\n             \"config/**/*.yaml\",\n-        ]\n+        ],\n     },\n     python_requires=\">=3.8\",\n     platforms=[distutils.util.get_platform()],\n", "issue": "Running autotuning fails with `Primary config directory not found.`\n## \ud83d\udc1b Bug\r\n\r\nWhen I tried running the auto tuning script, I get an error saying `Primary config directory not found`. See details below.\r\n\r\n## To Reproduce\r\n\r\nSteps to reproduce the behavior:\r\n\r\n1. Run `make install` from base directory to install from source\r\n2. Run `python setup.py install` from `examples/` to install scripts.\r\n3. Run the following command to run the script\r\n\r\n```\r\nHYDRA_FULL_ERROR=1 python -m llvm_autotuning.tune -m \\\r\n  experiment=my-exp \\\r\n  outputs=/tmp/logs \\\r\n  executor.cpus=32 \\\r\n  num_replicas=1 \\\r\n  autotuner=nevergrad \\\r\n  autotuner.optimization_target=runtime \\      \r\n  autotuner.search_time_seconds=600\r\n```\r\n\r\nThe full error message is:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/runpy.py\", line 194, in _run_module_as_main\r\n    return _run_code(code, main_globals, None,\r\n  File \"/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/runpy.py\", line 87, in _run_code\r\n    exec(code, run_globals)\r\n  File \"/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym_examples-0.2.4-py3.8.egg/llvm_autotuning/tune.py\", line 37, in <module>\r\n    main()\r\n  File \"/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/main.py\", line 49, in decorated_main\r\n    _run_hydra(\r\n  File \"/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/utils.py\", line 375, in _run_hydra\r\n    run_and_report(\r\n  File \"/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/utils.py\", line 214, in run_and_report\r\n    raise ex\r\n  File \"/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/utils.py\", line 211, in run_and_report\r\n    return func()\r\n  File \"/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/utils.py\", line 376, in <lambda>\r\n    lambda: hydra.multirun(\r\n  File \"/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/hydra.py\", line 121, in multirun\r\n    cfg = self.compose_config(\r\n  File \"/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/hydra.py\", line 564, in compose_config\r\n    cfg = self.config_loader.load_configuration(\r\n  File \"/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/config_loader_impl.py\", line 146, in load_configuration\r\n    return self._load_configuration_impl(\r\n  File \"/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/config_loader_impl.py\", line 227, in _load_configuration_impl\r\n    self.ensure_main_config_source_available()\r\n  File \"/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/config_loader_impl.py\", line 134, in ensure_main_config_source_available\r\n    self._missing_config_error(\r\n  File \"/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/hydra/_internal/config_loader_impl.py\", line 108, in _missing_config_error\r\n    raise MissingConfigException(\r\nhydra.errors.MissingConfigException: Primary config directory not found.\r\nCheck that the config directory '/Users/qingweilan/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym_examples-0.2.4-py3.8.egg/llvm_autotuning/config' exists and readable\r\n```\r\n\r\n## Expected behavior\r\n\r\nThe script shouldn't fail.\r\n\r\n## Environment\r\n\r\nPlease fill in this checklist:\r\n\r\n- CompilerGym: latest development branch\r\n- How you installed CompilerGym (pip, source): source\r\n- OS: MacOS\r\n- Python version: 3.7\r\n- Build command you used (if compiling from source): make install\r\n- GCC/clang version (if compiling from source):\r\n- Versions of any other relevant libraries:\r\n\r\nYou may use the\r\n[environment collection script](https://raw.githubusercontent.com/facebookresearch/CompilerGym/stable/build_tools/collect_env.py)\r\nto generate most of this information. You can get the script and run it with:\r\n\r\n```sh\r\nwget https://raw.githubusercontent.com/facebookresearch/CompilerGym/stable/build_tools/collect_env.py\r\n# For security purposes, please check the contents of collect_env.py before running it.\r\npython collect_env.py\r\n```\r\n\n", "before_files": [{"content": "#!/usr/bin/env python3\n#\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport distutils.util\n\nimport setuptools\n\nwith open(\"../VERSION\") as f:\n    version = f.read().strip()\nwith open(\"requirements.txt\") as f:\n    requirements = [ln.split(\"#\")[0].rstrip() for ln in f.readlines()]\nwith open(\"../tests/requirements.txt\") as f:\n    requirements += [ln.split(\"#\")[0].rstrip() for ln in f.readlines()]\n\nsetuptools.setup(\n    name=\"compiler_gym_examples\",\n    version=version,\n    description=\"Example code for CompilerGym\",\n    author=\"Facebook AI Research\",\n    url=\"https://github.com/facebookresearch/CompilerGym\",\n    license=\"MIT\",\n    install_requires=requirements,\n    packages=[\n        \"llvm_autotuning\",\n        \"llvm_autotuning.autotuners\",\n        \"llvm_rl\",\n        \"llvm_rl.model\",\n    ],\n    package_data={\n        \"llvm_rl\": [\n            \"config/*.yaml\",\n            \"config/**/*.yaml\",\n        ]\n    },\n    python_requires=\">=3.8\",\n    platforms=[distutils.util.get_platform()],\n    zip_safe=False,\n)\n", "path": "examples/setup.py"}], "after_files": [{"content": "#!/usr/bin/env python3\n#\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport distutils.util\n\nimport setuptools\n\nwith open(\"../VERSION\") as f:\n    version = f.read().strip()\nwith open(\"requirements.txt\") as f:\n    requirements = [ln.split(\"#\")[0].rstrip() for ln in f.readlines()]\nwith open(\"../tests/requirements.txt\") as f:\n    requirements += [ln.split(\"#\")[0].rstrip() for ln in f.readlines()]\n\nsetuptools.setup(\n    name=\"compiler_gym_examples\",\n    version=version,\n    description=\"Example code for CompilerGym\",\n    author=\"Facebook AI Research\",\n    url=\"https://github.com/facebookresearch/CompilerGym\",\n    license=\"MIT\",\n    install_requires=requirements,\n    packages=[\n        \"llvm_autotuning\",\n        \"llvm_autotuning.autotuners\",\n        \"llvm_rl\",\n        \"llvm_rl.model\",\n    ],\n    package_data={\n        \"llvm_autotuning\": [\n            \"config/*.yaml\",\n            \"config/**/*.yaml\",\n        ],\n        \"llvm_rl\": [\n            \"config/*.yaml\",\n            \"config/**/*.yaml\",\n        ],\n    },\n    python_requires=\">=3.8\",\n    platforms=[distutils.util.get_platform()],\n    zip_safe=False,\n)\n", "path": "examples/setup.py"}]}