ClandininLab / brainsss2

refactor of the brainsss repo for 2-photon imaging analysis
MIT License
0 stars 0 forks source link

ANTs installation error #33

Closed bellabrez closed 2 years ago

bellabrez commented 2 years ago

When running pip install -U . there is an error installing antspyx. First it complains about not having cmake, which I loaded with ml cmake/3.23.1, but then it complains about

Could not find a package configuration file provided by "ITK" with any of the following names:
ITKConfig.cmake
itk-config.cmake

Add the installation prefix of "ITK" to CMAKE_PREFIX_PATH or set "ITK_DIR"
to a directory containing one of the above files.  If "ITK" provides a
separate development package or SDK, be sure it has been installed.

Thoughts? Perhaps @rueberger has had experience with this.

I did find a github issue about this https://github.com/ANTsX/ANTsPy/issues/274. and it seems their suggestion was to install with

git clone https://github.com/ANTsX/ANTsPy 
cd ANTsPy 
python3 setup.py install
rueberger commented 2 years ago

i don't understand exactly how wheels work, but pip is trying to build from source because the wheels they published for 0.3.3 don't work (on ubuntu and centos 7). the wheels for 0.3.2 work fine.

workaround for now is to drop the -U or pin the version in setup.py. without the -U pip still installs 0.3.2, which is a behavior I do not understand.

I have been overhauling our lab's scheme for custom modules on sherlock, and am actively working to resolve this exact compilation issue, so stay tuned for that.

poldrack commented 2 years ago

It works for me within a conda virtual env

-- Russell A. Poldrack Albert Ray Lang Professor of Psychology Associate Director, Stanford Data Science Director, SDS Center for Open and Reproducible Science Building 420 Stanford University Stanford, CA 94305

@. @.> http://www.poldracklab.org/

rueberger commented 2 years ago

without the -U pip still installs 0.3.2, which is a behavior I do not understand.

ok this is false, this was happening because I installed antspyx in the image the container i was testing that in was built from...

bellabrez commented 2 years ago

Just tried with conda and got the same errors. I installed coda following https://github.com/kundajelab/chip-nexus-pipeline/blob/master/docs/tutorial_sherlock.md

$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
$ bash Miniconda3-latest-Linux-x86_64.sh

these lines didn't work so I skipped them

$ bash conda/uninstall_dependencies.sh  # to remove any existing pipeline env
$ bash conda/install_dependencies.sh

then

conda create -n brainsss python=3
conda activate brainsss
ml python/3.9.0
pip install -U .
bellabrez commented 2 years ago

looks like pinning antpyx version to 0.3.2 did indeed solve the problem. Should we update setup.py?

rueberger commented 2 years ago

I added a 0.3.2 module. with /home/groups/trc/software/modules on your MODULEPATH you can load it with ml py-ants/0.3.2_py39

although i'm not sure there's much reason to prefer modules to venvs for packages that provide that wheels other than that space in $HOME is limited and of course aesthetics. i'm curious what @poldrack thinks about this - russ?

poldrack commented 2 years ago

I would generally prefer venvs, just because I think they are easier to work with and control.