Skip to content
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

Updates to 0.21 #8

Merged
merged 2 commits into from
Jan 11, 2023
Merged

Updates to 0.21 #8

merged 2 commits into from
Jan 11, 2023

Conversation

cako
Copy link
Collaborator

@cako cako commented Jan 7, 2023

Update versions to avoid segfaults, and updates to v0.21. In addition, it drops support for Python 3.6 and introduces a [dev] extras.

Previous to this version, incompatibilities between pybind11, scipy and possibly other libraries were causing segfaults to the CurveLab code at times. While this is not yet 100% understood, this PR appears to avoid segfaults on tested versions.

This version has been checked on Ubuntu 22.04 with the conda for versions 3.7, 3.8, 3.9, 3.10, 3.11 as follows:

export FFTW=...
export FDCT=...
conda create -n py3.X python=3.X  # `-c conda-forge` if Python 3.11
conda activate py3.X
conda install -c conda-forge pylops  # `pip install pylops` if Python 3.11
git clone --branch patch-versions https://github.com/PyLops/curvelops.git
cd curvelops
python3 -m pip install -e ./[dev]
pytests

In addition, it has been tested in the same machine and for the same versions using venv as follows:

export FFTW=...
export FDCT=...
sudo apt install python3.X python3.X-dev python3.X-distutils  # Older versions may not be available in the default repos
virtualenv venv3X --python=python3.X
source venv3X/bin/activate
git clone --branch patch-versions https://github.com/PyLops/curvelops.git
cd curvelops
python3 -m pip install -e ./[dev]
pytests

CurveLab and FFTW were compiled on gcc and g++ versions g++ 11.3.0, GLIBC version 2.35.

If segfaults are still happening (I did not experience any), one may try the following procedure:

  1. Comment out all lines with fftwnd_destroy_plan in
    • CurveLab-2.1.3/fdct_wrapping_cpp/src/fdct_wrapping.cpp
    • CurveLab-2.1.3/fdct_wrapping_cpp/src/ifdct_wrapping.cpp
    • CurveLab-2.1.3/fdct3d/src/fdct3d.cpp
    • CurveLab-2.1.3/fdct3d/src/fdct3d_forward.cpp
    • CurveLab-2.1.3/fdct3d/src/fdct3d_inverse.cpp
  2. Recompile CurveLab, e.g., cd CurveLab-2.1.3/ && make clean && make
  3. Rebuild/install curvelops e.g., pip install -e .
  4. Be aware that this creates possible memory leaks.

@cako cako added the enhancement New feature or request label Jan 7, 2023
@cako cako requested a review from mrava87 January 7, 2023 07:45
README.md Show resolved Hide resolved
curvelops/curvelops.py Show resolved Hide resolved
docs/source/conf.py Show resolved Hide resolved
@mrava87
Copy link
Contributor

mrava87 commented Jan 7, 2023

Thanks a lot, this looks great!

I just gave a few minor comments, also I will try using the commands you provide on my linux machine and report back in coming days :)

@mrava87
Copy link
Contributor

mrava87 commented Jan 8, 2023

I confirm, the new installation process works for me as well with Ubuntu 18.04.6. Feel free to merge :)

@cako cako merged commit d1aeee6 into main Jan 11, 2023
@cako cako deleted the patch-versions branch January 11, 2023 07:11
cako added a commit that referenced this pull request Jan 22, 2023
* update versions to avoid segfaults

* add dev extras
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants