Repository: spack/spack

Issue:
Installation issue: conduit+python installs modules to <prefix>/python-modules instead of <prefix>/lib/pythonx.x/site-packages
@cyrush 

<!-- Thanks for taking the time to report this build failure. To proceed with the report please:

1. Title the issue "Installation issue: <name-of-the-package>".
2. Provide the information required below.

We encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively! -->

### Steps to reproduce the issue

<!-- Fill in the exact spec you are trying to build and the relevant part of the error message -->
```console
$ spack install conduit+python
...
$ spack load python conduit
$ python -c "import conduit; print(conduit.__file__)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'conduit'
$ export PYTHONPATH=`spack location -i conduit`/python-modules:${PYTHONPATH}
$ python -c "import conduit; print(conduit.__file__)"
/scratch/users/stam/my-spack-environments-installs/linux-centos7-broadwell/gcc-8.3.0/conduit-develop-ykzlxnjl2mahtjtcgtfypuajk33v36hr/python-modules/conduit/__init__.py
```

### Information on your system

<!-- Please include the output of `spack debug report` -->
```console
$ spack debug report
* **Spack:** 0.16.1-2232-1a32f4a08c
* **Python:** 3.6.8
* **Platform:** linux-centos7-broadwell
* **Concretizer:** original
```

<!-- If you have any relevant configuration detail (custom `packages.yaml` or `modules.yaml`, etc.) you can add that here as well. -->

### Additional information

<!-- Please upload the following files. They should be present in the stage directory of the failing build. Also upload any config.log or similar file if one exists. 
* [spack-build-out.txt]()
* [spack-build-env.txt]() -->

<!-- Some packages have maintainers who have volunteered to debug build failures. Run `spack maintainers <name-of-the-package>` and @mention them here if they exist. -->

### General information

<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
- [x] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [x] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
- [ ] I have uploaded the build log and environment files
- [x] I have searched the issues of this repo and believe this is not a duplicate



Discussion:
We should either convince `conduit` to install the libraries to the correct location, or add this directory to `PYTHONPATH` via `setup_run_environment`.
conduit's build system supports this via `PYTHON_MODULE_INSTALL_PREFIX`, it was wired up in the spack package but maybe it was broken in recent updates. I'll take a look


yes, looks like it vanished recently.  Here is an old version where it there (https://github.com/spack/spack/blob/ee30ec6a3555862cfda6af4fa1eff1c008643898/var/spack/repos/builtin/packages/conduit/package.py#L446)

I'll get this fixed. 


Resolving patch:
diff --git a/var/spack/repos/builtin/packages/conduit/package.py b/var/spack/repos/builtin/packages/conduit/package.py
--- a/var/spack/repos/builtin/packages/conduit/package.py
+++ b/var/spack/repos/builtin/packages/conduit/package.py
@@ -422,6 +422,9 @@ def hostconfig(self, spec, prefix):
             cfg.write("# python from spack \n")
             cfg.write(cmake_cache_entry("PYTHON_EXECUTABLE",
                       spec['python'].command.path))
+            cfg.write("# python module install dir\n")
+            cfg.write(cmake_cache_entry("PYTHON_MODULE_INSTALL_PREFIX",
+                      site_packages_dir))
         else:
             cfg.write(cmake_cache_entry("ENABLE_PYTHON", "OFF"))
 


Test patch: