Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Fix ray import error #241

Closed
wants to merge 6 commits into from

Conversation

wdirons
Copy link
Member

@wdirons wdirons commented Apr 23, 2020

To fix the ray error with rpath, I moved the compilers from the build section of
requirements to the host section of requirements. The conda documentation says
that any shared libraries that you need to link against in your build should be
in the host section. This solved the rpath issue.

I reordered the build section to be the above the host section for to be
consistent across recipes.

This PR uses the common build_scripts now for ray-feedstock

To fix the ray error with rpath, I moved the compilers from the build section of
requirements to the host section of requirements. The conda documentation says
that any shared libraries that you need to link against in your build should be
in the host section. This solved the rpath issue.

I reordered the build section to be the above the host section for to be
consistent across recipes.

This PR uses the common build_scripts now for ray-feedstock
@wdirons
Copy link
Member Author

wdirons commented Apr 23, 2020

Please read the commit message above to understand the change I made. (Because I reordered the two sections, the difference is hard to see)

Before and after test with the old/new packages

$ python -c "import ray"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/mnt/pai/home/wdirons/anaconda3/envs/testray/lib/python3.7/site-packages/ray/__init__.py", line 25, in <module>
    CDLL(so_path, ctypes.RTLD_GLOBAL)
  File "/mnt/pai/home/wdirons/anaconda3/envs/testray/lib/python3.7/ctypes/__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /mnt/pai/home/wdirons/anaconda3/envs/testray/lib/python3.7/site-packages/ray/_raylet.so)


$ conda install conda-recipes/ray-feedstock/build_artifacts/linux-ppc64le/ray-0.8.1-py37h1d8a796_2.tar.bz2
Preparing transaction: done
Verifying transaction: done
Executing transaction: done


$ python -c "import ray"
WARNING: Not monitoring node memory since `psutil` is not installed. Install this with `pip install psutil` (or ray[debug]) to enable debugging of memory-related crashes.

Comparison of a extract of the conda .tar.bz2 files:

ray-0.8.1-py37h1d8a796_1.tar.bz2:

$ grep binary info/has_prefix
<nothing>

ray-0.8.1-py37h1d8a796_2.tar.bz2:

$ grep binary info/has_prefix
/home/conda/feedstock_root/build_artifacts/ray_1587667295899/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho binary lib/python3.7/site-packages/ray/_raylet.so
/home/conda/feedstock_root/build_artifacts/ray_1587667295899/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho binary lib/python3.7/site-packages/ray/core/src/plasma/plasma_store_server
/home/conda/feedstock_root/build_artifacts/ray_1587667295899/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho binary lib/python3.7/site-packages/ray/core/src/ray/gcs/redis_module/libray_redis_module.so
/home/conda/feedstock_root/build_artifacts/ray_1587667295899/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho binary lib/python3.7/site-packages/ray/core/src/ray/raylet/raylet
/home/conda/feedstock_root/build_artifacts/ray_1587667295899/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho binary lib/python3.7/site-packages/ray/core/src/ray/raylet/raylet_monitor
/home/conda/feedstock_root/build_artifacts/ray_1587667295899/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho binary lib/python3.7/site-packages/ray/core/src/ray/thirdparty/redis/src/redis-server
/home/conda/feedstock_root/build_artifacts/ray_1587667295899/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho binary lib/python3.7/site-packages/ray/streaming/_streaming.so

@wdirons
Copy link
Member Author

wdirons commented Apr 23, 2020

And of course I forgot to update .travis.yaml :(

wdirons added 3 commits April 23, 2020 15:34
To fix the ray error with rpath, I moved the compilers from the build section of
requirements to the host section of requirements. The conda documentation says
that any shared libraries that you need to link against in your build should be
in the host section. This solved the rpath issue.

I reordered the build section to be the above the host section for to be
consistent across recipes.

This PR uses the common build_scripts now for ray-feedstock
@jayfurmanek
Copy link
Contributor

in .travis.yaml, the new way is:

os: linux
arch: ppc64le

.travis.yml Outdated
os: linux
- env: CONFIG=linux_ppc64le_python3.6 UPLOAD_PACKAGES=True DOCKER_IMAGE=condaforge/linux-anvil-ppc64le
language: generic
os: linux-ppc64le
Copy link
Contributor

Choose a reason for hiding this comment

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

just linux here

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I had cut and pasted the .travis.yml for the last ray PR. Should be fixed now.

@npanpaliya
Copy link
Contributor

Thanks Billy for fixing this.

@hartb
Copy link
Member

hartb commented Apr 24, 2020

Huh. I wonder why we don't see this all over the place. Surely any compiled C++ code must need libstdc++.so.6 and the normal conda build machinery should get an RPATH to the conda version of that into objects produced by the recipe. Maybe there's something peculiar about the ray recipe that interferes with the normal mechanism.

A bit weird, but if it works, then I'm OK with it.

@wdirons
Copy link
Member Author

wdirons commented Apr 27, 2020

Using

+  run_exports:
+    - {{ compiler('c') }}
+    - {{ compiler('cxx') }}

I got same /lib64/libstdc++.so.6: version GLIBCXX_3.4.21 not found` error.

Trying whitelist now.

@wdirons
Copy link
Member Author

wdirons commented Apr 28, 2020

I'll submit a new PR with a better fix.

@wdirons wdirons closed this Apr 28, 2020
@wdirons wdirons deleted the ray_incorrect_libstdc_linkage branch April 28, 2020 23:01
@den-run-ai
Copy link

@wdirons @jayfurmanek @hartb looks like related issue?

#272

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants