Open lchia opened 3 years ago
Websit: libjpeg
cd ~/tools/
cd jpeg-9d/
mkdir ~/local/libjpeg
./configure --prefix ~/local/libjpeg
make -j32
make install
ls ~/local/libjpeg/
test -j32
#######libjpeg
export PATH="~/local/libjpeg/bin:$PATH"
export LD_LIBRARY_PATH="~/local/libjpeg/lib64:$PATH"
cd $CONDA_PREFIX
mkdir -p ./etc/conda/activate.d
mkdir -p ./etc/conda/deactivate.d
touch ./etc/conda/activate.d/env_vars.sh
touch ./etc/conda/deactivate.d/env_vars.sh
### Edit ./etc/conda/activate.d/env_vars.sh as follows:
#!/bin/sh
export MY_KEY='secret-key-value'
export MY_FILE=/path/to/my/file/
### Edit ./etc/conda/deactivate.d/env_vars.sh as follows:
#!/bin/sh
unset MY_KEY
unset MY_FILE
git clone https://github.com/uber-research/jpeg2dct.git
cd jpeg2dct
python setup.py install
Need to modify
setup.py
to provide thelibjpeg
include & library path
def get_common_options(build_ext):
cpp_flags = get_cpp_flags(build_ext)
MACROS = []
INCLUDES = ['~/local/libjpeg/include'] + get_conda_include_dir()
SOURCES = []
COMPILE_FLAGS = cpp_flags
LINK_FLAGS = []
LIBRARY_DIRS = ['~/local/libjpeg/lib']
LIBRARIES = []
return dict(MACROS=MACROS,
INCLUDES=INCLUDES,
SOURCES=SOURCES,
COMPILE_FLAGS=COMPILE_FLAGS,
LINK_FLAGS=LINK_FLAGS,
LIBRARY_DIRS=LIBRARY_DIRS,
LIBRARIES=LIBRARIES)
**_$ python main.py_**
Traceback (most recent call last):
File "main.py", line 32, in <module>
tudct = TransformUpscaledDCT()
File "main.py", line 19, in __init__
self.jpeg_encoder = TurboJPEG('/usr/lib/libturbojpeg.so')
File "/mnt/data/isp001/anaconda3/envs/vsr/lib/python3.7/site-packages/turbojpeg.py", line 288, in __init__
self.__find_turbojpeg() if lib_path is None else lib_path)
File "~/anaconda3/envs/vsr/lib/python3.7/ctypes/__init__.py", line 442, in LoadLibrary
return self._dlltype(name)
File "~/anaconda3/envs/vsr/lib/python3.7/ctypes/__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/libturbojpeg.so: cannot open shared object file: No such file or directory
How to solve gcc failure ? Thanks!