Skip to content

Commit

Permalink
Merge branch 'devel' into olz_volume_consensus
Browse files Browse the repository at this point in the history
  • Loading branch information
oierlauzi authored Oct 22, 2024
2 parents 742d7a8 + 3fa0b84 commit ce29873
Show file tree
Hide file tree
Showing 10 changed files with 366 additions and 202 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: ${{ matrix.os }}

env:
SEND_INSTALLATION_STATISTICS: "False"
SEND_INSTALLATION_STATISTICS: OFF
steps:
- name: Install dependencies
run: |
Expand Down
27 changes: 10 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,39 @@ This is the main repository, which contains the majority of the source code for
To have a complete overview about Xmipp please visit the [documentation web](https://i2pc.github.io/docs/). The recommended way for users (not developers) to install and use Xmipp is via the [Scipion](http://scipion.i2pc.es/) framework, where you can use Xmipp with other Cryo-EM-related software.

### As a Scipion plugin (Recommended)
The Scipion installer should take care of all dependencies for you by default, except for CUDA. To correctly interoperate with CUDA, please visit the official [installation guide](https://scipion-em.github.io/docs/release-3.0.0/docs/scipion-modes/how-to-install.html#installation) of Scipion.

Mind that for this command to succeed, all dependencies need to be pre-installed and findable by Xmipp. When using non-standard install directories, this needs to be indicated to Xmipp though the Scipion configuration file. See [Software dependency section](https://github.com/I2PC/xmipp?tab=readme-ov-file#software-dependencies) for further details.
To correctly interoperate with CUDA, please visit the official [installation guide](https://scipion-em.github.io/docs/release-3.0.0/docs/scipion-modes/how-to-install.html#installation) of Scipion.

Once Scipion is in working order, launch the Xmipp Plugin installer with

`scipion3 installp -p scipion-em-xmipp`

By default this will employ all CPU cores available in the system for compilation. If this is not the desired behavior, please consider using `-j <N>` flag to limit the amount of CPU cores.

### As a Scipion plugin with pre-installed dependencies
The former method also installs dependencies (including the compiler) though conda. If you prefer to use externally installed dependencies and avoid downloading them from conda use

`scipion3 installp -p scipion-em-xmipp --noBin`

`scipion3 installb xmippSrc`

Mind that for this command to succeed, all dependencies need to be pre-installed and findable by Xmipp. When using non-standard install directories, this needs to be indicated to Xmipp though the Scipion configuration file. See [Software dependency section](https://github.com/I2PC/xmipp?tab=readme-ov-file#software-dependencies) for further details.

### Developer installation with Scipion
For developers, it becomes handy to install Xmipp in an external directory for easy integration with IDEs. By default Xmipp installer takes care of installing dependencies though conda and linking to Scipion.
For developers, it becomes handy to install Xmipp in an external directory for easy integration with IDEs. By default Xmipp installer takes care of linking to Scipion.

The first step is to download Xmipp sources:

`git clone https://github.com/I2PC/xmipp.git`

`cd xmipp`

Then all child repositories need to be fetched, with an optional git branch parameter. For repositories where the branch does not exist, devel is utilized.
If you want to checkout an scpecific branch use the following command. For repositories where the branch does not exist, devel is utilized.

`./xmipp getSources [-b branch]`

Install the Scipion plugin and dependencies

`scipion3 installp -p src/scipion-em-xmipp/ --devel`
`./xmipp getSources -b branch`

Compile Xmipp

`scipion3 run ./xmipp`

Refer to `./xmipp --help` for additional info on the compilation process and possible customizations.

Install the Scipion plugin.

`scipion3 installp -p src/scipion-em-xmipp/ --devel`

#### Integrating with Visual Studio Code
The CMake based installation script can be tightly integrated with any modern IDE. This section shows the procedure for Visual Studio Code (VSCode).

Expand Down
1 change: 1 addition & 0 deletions cmake/xmipp.bashrc.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export PATH=@XMIPP_HOME@/@CMAKE_INSTALL_BINDIR@:$PATH
export LD_LIBRARY_PATH=@XMIPP_HOME@/@CMAKE_INSTALL_LIBDIR@:@XMIPP_HOME@/bindings/python:@PREFIX_LIB_PATH@:$LD_LIBRARY_PATH
export PYTHONPATH=@XMIPP_HOME@/bindings/python:@XMIPP_HOME@/pylib:$PYTHONPATH
export MATLABPATH=@XMIPP_HOME@/bindings/matlab:$MATLABPATH
export XMIPP_SRC=@PROJECT_SOURCE_DIR@/src

alias x='xmipp'
alias xsj='xmipp_showj'
Expand Down
23 changes: 22 additions & 1 deletion installer/constants/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
# This is not used in cmake
__CONDA_PREFIX = 'CONDA_PREFIX'
__XMIPP_CUDA_BIN = 'XMIPP_CUDA_BIN'
__DEFAULT_CUDA_BIN = '/usr/local/cuda/bin'
__NVCC_EXE = 'nvcc'
__TUNE_FLAG='-mtune=native'

# Config file variable structure
Expand Down Expand Up @@ -81,6 +83,25 @@ def __getPrefixPath() -> Optional[str]:
"""
return os.environ.get(__CONDA_PREFIX)

def __getCudaCompiler() -> Optional[str]:
"""
### This function returns the path for the CUDA compiller
#### Returns:
- (str | None): Path for the NVCC executable
"""
nvcc = os.environ.get(__XMIPP_CUDA_BIN)

if nvcc is None and os.path.exists(__DEFAULT_CUDA_BIN):
nvcc = __DEFAULT_CUDA_BIN

if nvcc is not None:
nvcc = os.path.join(nvcc, __NVCC_EXE)

return nvcc



ON = 'ON'
OFF = 'OFF'
CONFIG_DEFAULT_VALUES = {
Expand All @@ -93,7 +114,7 @@ def __getPrefixPath() -> Optional[str]:
CMAKE_INSTALL_PREFIX: INSTALL_PATH,
__CC_FLAGS: __TUNE_FLAG,
__CXX_FLAGS: __TUNE_FLAG,
CUDA_COMPILER: None,
CUDA_COMPILER: __getCudaCompiler(),
__PREFIX_PATH: __getPrefixPath(),
__MPI_HOME: None,
__PYTHON_HOME: None,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/***************************************************************************
*
* Authors: J.L. Vilas
*
* Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* All comments concerning this program package may be sent to the
* e-mail address 'xmipp@cnb.csic.es'
***************************************************************************/

#include <tomo/tomo_average_subtomos.h>

RUN_XMIPP_PROGRAM(ProgAverageSubtomos)
4 changes: 2 additions & 2 deletions src/xmipp/applications/scripts/denoising_tv/denoising_tv.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def tigreDenoisingTV(self):

tomo = mrcfile.read(self.fnTomo)

denoisedTomo = im_3d_denoise.im3ddenoise(tomo, iter=self.iterations, lmbda=self.lmbda, gpuids=None)
denoisedTomo = im_3d_denoise.im3ddenoise(np.array(tomo, dtype=np.float32), iter=self.iterations, lmbda=self.lmbda, gpuids=None)

with mrcfile.new(self.fnOut, overwrite=True) as mrc:
mrc.set_data(denoisedTomo)
Expand Down Expand Up @@ -133,4 +133,4 @@ def readVolTomo(self):
scipion xmipp_denoising_tv -g 0
'''
exitCode=DenoisingTV().tryRun()
sys.exit(exitCode)
sys.exit(exitCode)
Loading

0 comments on commit ce29873

Please sign in to comment.