Comments (7)
Thanks for reporting this error @glassnotes! It looks to be related to the new compiler driver integration.
from catalyst.
Thanks for the quick reply, @erick-xanadu !
Some more info for you: upon further testing, in a script, if I import packages in the following order,
import catalyst
import jax.numpy as jnp
I do not get an error, however if I reverse the two lines, I get the error listed above. I've just updated both jax and jaxlib to be versions 0.4.14.
from catalyst.
Hi @glassnotes, Thanks for reporting this issue.
This comes from the fact that you have multiple versions of libstdc++
on your machine. The compiler_driver
library of Catalyst was apparently built with a different version of this library. You can find it by running ldd /home/olivia/Code/catalyst/frontend/catalyst/../../mlir/build/python_packages/quantum/mlir_quantum/compiler_driver.so
. The path to libstdc++.so
should be something like /lib/x86_64-linux-gnu/libstdc++.so.6
.
The conda version of libstdc++
doesn't include GLIBCXX_3.4.30
while the gcc package (in /lib/libstdc++.so.6
) has it! The compiler_driver
is linked against the gcc package but it doesn't find the lib when it's called from a conda venv.
To fix this issue, you can replace the conda version of this library by this one,
cp /lib/x86_64-linux-gnu/libstdc++.so.6 /home/olivia/.conda/envs/catalyst/bin/../lib/libstdc++.so.6
Please let us know if this also fixes the issue or you face any other problems with installing Catalyst.
from catalyst.
The question is, how do we prevent this from happening more generally? 🤔
from catalyst.
Copying the library in does work, but feels a little sketchy 😅
I ended up with multiple versions of the library during the installation process. In particular, despite having clang
installed on my machine, I initially received the output
CMake Error at /home/olivia/.conda/envs/catalyst/lib/python3.11/site-packages/cmake/data/share/cmake-3.27/Modules/CMakeTestCXXCompiler.cmake:60 (message):
The C++ compiler
"/usr/bin/clang++"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: '/home/olivia/Code/catalyst/runtime/build/CMakeFiles/CMakeScratch/TryCompile-k56B71'
Run Build Command(s): /usr/bin/ninja -v cmTC_54cbb
[1/2] /usr/bin/clang++ -MD -MT CMakeFiles/cmTC_54cbb.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_54cbb.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_54cbb.dir/testCXXCompiler.cxx.o -c /home/olivia/Code/catalyst/runtime/build/CMakeFiles/CMakeScratch/TryCompile-k56B71/testCXXCompiler.cxx
[2/2] : && /usr/bin/clang++ CMakeFiles/cmTC_54cbb.dir/testCXXCompiler.cxx.o -o cmTC_54cbb && :
FAILED: cmTC_54cbb
: && /usr/bin/clang++ CMakeFiles/cmTC_54cbb.dir/testCXXCompiler.cxx.o -o cmTC_54cbb && :
/usr/bin/ld: cannot find -lstdc++: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
when trying to run make all
in the top-level Catalyst directory. This led me to installing libstdc++-12-dev
, which fixed the previous problem, but resulted in the new one in the issue description.
For what it's worth, the "not being able to compile a simple test program" happened on more than one of my machines, and I had installed previous versions by manually adjusting the Makefiles to use g++
instead of clang; but today I thought I'd try and fix things to work out-of-the-box...
from catalyst.
Thanks for checking! I can feel the pain 😢 we're discussing the issue and should be able to come up with a better solution.
Such feedback helps us gain a deeper understanding of edge cases, and we're committed to working on robust solutions that make the process of installing Catalyst from source even smoother.
from catalyst.
Still investigating this, but we might need to recommend users not use conda when building from source.
from catalyst.
Related Issues (20)
- Invoking PassPipelines multiple times with no clear explanation in CompilerDriver HOT 1
- [BUG] Compilation failure when indexing 32-bit int wire arrays HOT 1
- [BUG] Error when performing measurement on wire array with single wire HOT 1
- Support `qml.Projector` observable HOT 1
- [BUG] `jax.scipy.linalg.expm` does not work HOT 2
- Improve how the SciPy BLAS library is found HOT 1
- Raise an error if we attempt to call a QJIT'ed context inside a callback HOT 2
- Support for `IsingZZ` in Catalyst
- Document how to install ccache for macOS and virtualenv
- Autograph fails when used with Catalyst's JAX VJP integration
- Support building on conda
- [BUG] `jax.scipy.linalg.expm` doesn't work due to undefined symbols
- Compiling with return signature raises an exception.
- Find a better way to link blas routines from jaxlib HOT 2
- Add exponential fitting functionality to ZNE HOT 3
- Add local folding to ZNE error mitigation HOT 4
- Automatic conversion of operator-based array updates
- [BUG] catalyst.for_loop default argument `i` cannot be used as a concrete value HOT 10
- Can we use `--buffer-results-to-out-params`?
- It would be nice to have an interface (or documentation) for accessing the original function of a QJIT object HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from catalyst.