-
Notifications
You must be signed in to change notification settings - Fork 195
try/except for site.getsitepackages() #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
In the never ending python install path whack-a-mole, site.getsitepackages() sometimes does not exist
Error is fixed, but install prefix is wrong (/usr/local). It should be set to $VIRTUAL_ENV (/home/gaspar/git/rantelon/detector/venv) if exist. Cmake log: (venv) gaspar@RA-108 ~/git/rantelon/detector/environment/SoapySDR/build (master)> cmake ..
-- The C compiler identification is GNU 9.1.0
-- The CXX compiler identification is GNU 9.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Build type not specified: defaulting to release.
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.16") found components: doxygen dot
--
-- #############################################
-- ## Begin configuration for Python support...
-- #############################################
-- Enabling optional Python bindings if possible...
-- Found SWIG: /usr/bin/swig (found version "4.0.1")
-- SWIG_FOUND: TRUE - 4.0.1
-- Found PythonInterp: /home/gaspar/git/rantelon/detector/venv/bin/python (found version "3.7.4")
-- PYTHONINTERP_FOUND: TRUE - 3.7.4
-- PYTHON_EXECUTABLE: /home/gaspar/git/rantelon/detector/venv/bin/python
-- PYTHON_INSTALL_DIR: ${prefix}/lib/python3.7/site-packages
-- PYTHONLIBS_FOUND: TRUE - 3.7.4
-- PYTHON_INCLUDE_DIRS: /home/gaspar/git/rantelon/detector/venv/include/python3.7m;/home/gaspar/git/rantelon/detector/venv/include/python3.7m
-- PYTHON_LIBRARIES: -lpython3.7m -lcrypt -lpthread -ldl -lutil -lm -Xlinker -export-dynamic
-- Performing Test SIZE_T_IS_UNSIGNED_INT
-- Performing Test SIZE_T_IS_UNSIGNED_INT - Failed
-- CMAKE_SWIG_FLAGS=-c++;-threads;-I/home/gaspar/git/rantelon/detector/environment/SoapySDR/include
CMake Warning (dev) at /usr/share/cmake-3.15/Modules/UseSWIG.cmake:607 (message):
Policy CMP0078 is not set: UseSWIG generates standard target names. Run
"cmake --help-policy CMP0078" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
python/CMakeLists.txt:155 (SWIG_ADD_LIBRARY)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/share/cmake-3.15/Modules/UseSWIG.cmake:460 (message):
Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module
flag. Run "cmake --help-policy CMP0086" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/share/cmake-3.15/Modules/UseSWIG.cmake:702 (SWIG_ADD_SOURCE_TO_MODULE)
python/CMakeLists.txt:155 (SWIG_ADD_LIBRARY)
This warning is for project developers. Use -Wno-dev to suppress it.
--
-- #############################################
-- ## Begin configuration for Python3 support...
-- #############################################
-- Enabling optional Python3 bindings if possible...
--
-- ######################################################
-- ## SoapySDR enabled features
-- ######################################################
--
* Library, runtime library v0.8.0-gcafa4ba5
* Apps, command line applications
* Tests, library unit tests
* Docs, doxygen documentation
* Python, python bindings v3.7.4
-- ######################################################
-- ## SoapySDR disabled features
-- ######################################################
--
-- SoapySDR version: v0.8.0-gcafa4ba5
-- ABI/so version: v0.8
-- Install prefix: /usr/local
-- Configuring done
-- Generating done
-- Build files have been written to: /home/gaspar/git/rantelon/detector/environment/SoapySDR/build |
Thanks
You are going to want to pass this to cmake: |
IMO #239 is not yet solved. My argument is that Is there any downside of setting it automatically (i mean only if $VIRTUAL_ENV is set, and of course it can be overwritten with -DCMAKE_INSTALL_PREFIX)? |
Double checking: Should the libsoapysdr.so, support modules, and includes go into /usr/local, and the python modules should go into $VIRTUAL_ENV. Or all of the install, every lib and include should also be in the same $VIRTUAL_ENV prefix? |
My vision is that everything goes into $VIRTUAL_ENV, main system will stay untouched. |
There could be upwards of 100 projects in this ecosystem from drivers to applications that would need to understand a new default for the install prefix (both cmake and autotools stuff --prefix). Typically the build projects try to stay generic but support configuration variables. And then depending upon the system, these variables are scripted in a way to match the target system. debian has a rules file, homebrew has recipes and standard cmake args, im sure setup.py could be scripted to do something too. |
My idea was that $VIRTUAL_ENV is used only if set - this happens when user has activated the virtual environment. Builds out of virtual environment will stay the same. However, i understand that this use case is not that common, lets see if there are more people interested. Thanks for help! |
In the never ending python install path whack-a-mole, site.getsitepackages() sometimes does not exist
resolves Installing in virtualenv not trivial #239
@gasparka are you able to test this change on your setup?