Using the LEAP precompiled dynamic libraries - LLNL/LEAP GitHub Wiki
We recommend using the LEAP pip install method outlined above, but if you are still having issues installing LEAP, you can use the precompiled dynamic libraries.
Before we get into this, we'd like to quickly describe what happens in the pip install process. First the LEAP C++/CUDA source code is compiled into a dynamic library (libleapct.so or libleapct.dll). Then this dynamic library file and some of the other leap python files (e.g., leapctype.py, leaptorch.py, leap_filter_sequence.py, and leap_preprocessing_algorithms.py) are copied to your python "site-packages" folder. When one tries to import leap in python, python knows to look in this site-packages folder to look for your packages.
Thus, if one uses the precompiled LEAP dynamic library, all one really needs to do is provide a way for python do be able to find the LEAP packages with an import statement. There are two ways to do this.
Method 1
- Download/ clone the LEAP repository
- Go to the releases page and download the LEAP dynamic library (libleapct.dll if on Windows or libleapct.so if on Linux).
- Copy the LEAP dynamic library to the main LEAP folder.
- Run the following command to copy the necessary files to your python site-packages folder.
python manual_install.py
Method 2
- Download/ clone the LEAP repository
- Go to the releases page and download the LEAP dynamic library (libleapct.dll if on Windows or libleapct.so if on Linux).
- Copy the LEAP dynamic library to the main LEAP src folder.
- Do one of the following: a) Add the LEAP src folder to your PYTHONPATH environment variable b) Each time you wish to use LEAP add the following two lines to the top of your Python script
import sys
sys.path.append(full path to the location of the LEAP src folder)
There is nothing else you need to do here. Note that in this option you are not really installing LEAP, you are just copying the necessary files to some location (any location) on your computer and then letting python know where to find the files it needs to run LEAP.