Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
222 commits
Select commit Hold shift + click to select a range
c8315f6
added new functionality for autopicking amyloids, not optimal yet...
scheres Nov 21, 2024
cc245d7
updated find_amyloid
scheres Nov 22, 2024
e839f50
cleanup up amyloid_finder code
scheres Nov 26, 2024
863cef8
output normalised scores of (max-adjusted_mean)/adjusted_mean
scheres Nov 26, 2024
5a47229
added an option to write out kurtosis and skewness of micrographs, to…
scheres Nov 26, 2024
aa1ff59
repaired some minor issues
scheres Nov 27, 2024
85c81f6
histograms of skewness and kurtosis
scheres Nov 27, 2024
dc262f6
add option to pick filaments as lines
scheres Nov 27, 2024
c7ba4c3
added option to extract helices from drawn lines
scheres Nov 27, 2024
8659834
display lines as lines
scheres Nov 27, 2024
44297f4
continue with filament_type in lines mode and have red-coloured fom c…
scheres Nov 27, 2024
03124a2
added colouring of manualpicker according to a FOM image
scheres Nov 28, 2024
bd8a326
fix coulour scheme with fom images
scheres Nov 28, 2024
ef62564
for David Barford: write out subtomos
scheres Nov 28, 2024
8219dd0
repiared bug in subtomo when first tomogram is empty
scheres Nov 28, 2024
539d8a5
Merge branch 'amypick' into subtomo-relion3
scheres Dec 2, 2024
00f21ac
protect symfile reading from threads; necessary somehow...
scheres Dec 3, 2024
043956e
repaired bug if 3D subtomos without multiplicity
scheres Dec 3, 2024
e1bc05f
repaired bug if 3D subtomos without multiplicity
scheres Dec 3, 2024
bbc1c74
allow refine3d and class3d without --tomograms, for relion-3-style av…
scheres Dec 3, 2024
a850d8c
better comment on why ysize for Fstmulti check
scheres Dec 6, 2024
497cb32
allow setting individual pixel values in images
scheres Dec 6, 2024
1d3da22
added option to output FFT power image
scheres Dec 6, 2024
9d29660
also order tables on pre-exposure before generating the single MD
scheres Dec 6, 2024
aa9e745
make sure the tomogram size gets sets correctly...
scheres Dec 6, 2024
27d1602
option to skip wiener filter in fourier method for reconstruct tomograms
scheres Dec 6, 2024
487658e
option to write out real subtomograms
scheres Dec 6, 2024
05aba22
removed unnecessary check
scheres Dec 6, 2024
39388ab
added option to reproject subtomos back on the GUI, also option to sk…
scheres Dec 10, 2024
429964a
added option back to reproject real subtomos
scheres Dec 10, 2024
93f8a65
two small bugs
scheres Dec 10, 2024
9a71c66
rearrange subtomo
scheres Dec 11, 2024
46ac332
tidied up code a bit
scheres Dec 11, 2024
e93f5ad
repaired bug reproject subtomos
scheres Dec 11, 2024
cd38280
Merge branch 'master' into subtomo-relion3
scheres Dec 11, 2024
aa2cf64
removed a big from fourier inversion tomogram reconstruction
scheres Dec 11, 2024
c263166
replaced CTF-corrected SNR algorithm with much faster vector version
scheres Dec 11, 2024
9b4fca2
repaired bug reported by Tina Drobnic in particle_reposition
scheres Dec 12, 2024
e085769
set angpix in fom image header
scheres Dec 18, 2024
56849b1
changed logic of tomogram reconstruction and subtomo extraction on th…
scheres Dec 18, 2024
5602833
allow empty isVisible and look for ytilt, not nominal tilt
scheres Dec 19, 2024
8c73e47
keep debugging for real_subtomos
scheres Dec 19, 2024
0361793
dont allow ignoring CTF until first peak for tomography
scheres Dec 19, 2024
7b39885
dont always add --ctf to tomogram reconstruction
scheres Dec 19, 2024
a96e1c9
repiared bug in normalisation proj2d.mrcs
scheres Dec 19, 2024
42d9e66
added option to reconstruct tomograms with aretomo to aligntiltseries…
scheres Dec 20, 2024
54a01ee
set name of table in subset selection
scheres Dec 20, 2024
8a76f6a
add option to reconstruct only in aretomo2, generating .aln file from…
scheres Dec 20, 2024
b101bd6
removed suprious debugging statement
scheres Jan 14, 2025
c169b1e
allow toggling of FOM-coluring and greyscale image
scheres Jan 14, 2025
039b984
sleep one second to prevent nervous toggling on a mac for fom-colouring
scheres Jan 14, 2025
e3baaba
put error message back for particles outside micrograph, and check th…
scheres Jan 14, 2025
cdaba10
resolve silly merge conflicts when merging in master
scheres Jan 14, 2025
598cd62
fixed another merge error
scheres Jan 14, 2025
ffdef91
moved version to devel
scheres Jan 14, 2025
b44896e
Merge branch 'master' into ver5.1
scheres Jan 14, 2025
8fb2fda
deactive tilt angle offset for continue jobs, as changing this half-w…
scheres Jan 14, 2025
ad0533a
Merge branch 'master' into ver5.1
scheres Jan 14, 2025
cc3e941
made Jans extraction work again
scheres Jan 14, 2025
c35c1e2
repaired bug in removal of decentered particles outside micrograph
scheres Jan 15, 2025
a9d2aa5
Merge branch 'master' into ver5.1
scheres Jan 20, 2025
43c4348
added non-signal for getting rid of ice crystals
scheres Jan 22, 2025
2bed7fc
give more info about z_perc errors
scheres Jan 27, 2025
5ee8ea0
added same filament tracing code to find_amyloid as was present in mo…
scheres Feb 5, 2025
ad217b2
make sure schemegui uses python from relion-5.0 conda environment
scheres Feb 5, 2025
2e8888b
dont retrace already traced micrographs in amyloid_finder, and deal w…
scheres Feb 6, 2025
61854e0
repaired bug in logfile plot generation
scheres Feb 6, 2025
dcbae9c
added local symmetry expansion
scheres Feb 11, 2025
9fc6071
default psistep in find_amyloid to 5 degrees to prevent picking ice; …
scheres Feb 11, 2025
e5a8b7b
Jenny's new pi 🥳
jshi7 Feb 13, 2025
d9635f8
removed lightning dependency
jshi7 Feb 13, 2025
0380638
changes made with Jenny to run her model from relion_find_amyloid
scheres Feb 20, 2025
8a8ba8a
write out message when reading in blush arguments from environment va…
scheres Feb 20, 2025
3b5b1f3
raise error when input tomogram.star file does not contain correct la…
scheres Feb 20, 2025
09dd2cc
added forgotton option to set only_do_unfinished
scheres Feb 27, 2025
e20029e
added option to read in specific blush model
scheres Feb 27, 2025
4b825c7
Richards suggestion to calculate ice ring density relative to backgroun
scheres Mar 11, 2025
4e35c24
Merge branch 'master' into ver5.1
scheres Mar 11, 2025
ee511de
reverted back from Richard's to Rafa's way of calculating ice ring
scheres Mar 12, 2025
7e9344a
Merge branch 'ver5.1' into ver5.1-jenny-amyloid-picker
scheres Mar 12, 2025
06e1652
take tomo-subtomo priors into account
scheres Mar 19, 2025
9c3e5f9
add option --keep_priors_fixed to deal with priors in subtomogram ave…
scheres Mar 19, 2025
853a238
add Z-score for ice-ring calculation
scheres Mar 19, 2025
a9215de
take tomo-subtomo priors into account
scheres Mar 19, 2025
02cd848
add option --keep_priors_fixed to deal with priors in subtomogram ave…
scheres Mar 19, 2025
a552487
add Z-score for ice-ring calculation
scheres Mar 19, 2025
07740b1
use kurtosis for icering density, but only if MotionCorr had calculat…
scheres Mar 20, 2025
532bd43
implemented icepowerfraction and icekurtosis
scheres Mar 21, 2025
130f6a6
debugged and changed Jennys segmentation and made everything work fro…
scheres Mar 24, 2025
dd30881
further optimisation of Jennys code and interaction with mine
scheres Mar 24, 2025
eea0505
remove too-close start-end points of filaments
scheres Mar 25, 2025
3432f3e
resolved conflict when merging in jennys picker
scheres Mar 25, 2025
76bbb44
only run extra ice stats when asked for with --extra_ice_stats option
scheres Mar 25, 2025
73e2718
only run extra ice stats when asked for with --extra_ice_stats option…
scheres Mar 25, 2025
e7430d4
only run extra ice stats when asked for with --extra_ice_stats option…
scheres Mar 25, 2025
65db694
only run extra ice stats when asked for with --extra_ice_stats option…
scheres Mar 25, 2025
6611b56
Merge branch 'ver5.0'
scheres Mar 25, 2025
ce7fc0f
no deviceInitilaise if we dont have CUDA
scheres Mar 25, 2025
5c2fe97
no deviceInitilaise if we dont have CUDA
scheres Mar 25, 2025
2e622db
skip tracing is no GPUs
scheres Mar 25, 2025
a1db1b0
still more deviceInitialise in find_amyloid
scheres Mar 25, 2025
bbbf730
touch empty star files if no filaments are picked, so not always repi…
scheres Mar 27, 2025
fffa828
warn instead of die if filament with a single point; TODO: remove thi…
scheres Apr 1, 2025
be6c658
Merge branch 'ver5.0' into devel-master
biochem-fan Apr 8, 2025
683226a
Replaced CUB with that distributed by the CUDA toolkit.
dkimanius Apr 11, 2025
e99eccb
added weights in local symmetry averaging
scheres Apr 11, 2025
d791ff2
repiared bad return call for empty micrographs
scheres Apr 29, 2025
2cd5457
put default model_path to /public/EM for now
scheres Apr 29, 2025
e83ba72
added option to skip tracing in find_amyloids
scheres May 1, 2025
13d7f42
allow tracing of amyloids on cpu too
scheres May 1, 2025
4e0b738
remove spurious cerr message
scheres May 1, 2025
fb99d1c
explicitly define thread number in pytorch on cpu
scheres May 1, 2025
f04ef90
only do 90-degree rotations: 90-180 is calculated from -y,x swaps
scheres May 6, 2025
294eee5
perform amyloid autopick FOM and trace calculations separately, also …
scheres May 14, 2025
f183f03
updated with picking lines, startend and partcles defined in autopick…
scheres May 21, 2025
1ac0587
Compile model, bfloat16 for cuda
jamaliki May 22, 2025
662ea7c
Small optimisations
jamaliki May 22, 2025
4e9483f
by default do not know polarity of filaments
scheres May 22, 2025
6c45e9f
for amyprep and amyproc schemes
scheres May 22, 2025
b365bd5
repaired bug in setting picktype
scheres May 27, 2025
b04051b
repaired bug in setting picktype
scheres May 27, 2025
c520fcc
code suggestion Kent Thurber
scheres May 28, 2025
d1c245f
This implements pull request #1267 from 3dem/relion by Leandro Estrozi
scheres May 28, 2025
8e5128a
put nstart on gui for local averaging
scheres May 30, 2025
8267c25
forgot only_unfinished for tracing of amyloids#
scheres Jun 3, 2025
f18536b
check for availability of bfloat16 on older cards
scheres Jun 4, 2025
61de272
deal with N-start helices and local helical prior averaging: switch …
scheres Jun 4, 2025
b100d39
go back to wider rot searches for 2-start helices, and do update rot …
scheres Jun 4, 2025
77c39a3
dont do init blobs for helical 2D classification
scheres Jun 5, 2025
0c2010f
removed again option to switch off rot prior updates
scheres Jun 5, 2025
ede0761
dont die on broken micrographs
scheres Jun 6, 2025
9ff2c4f
also write class_averages.star when selecting from Davids filament se…
scheres Jun 6, 2025
8dd93fb
further tweaks to autopicker for amyloids
scheres Jun 9, 2025
c0db6e1
by default switch off GPU tracing of amyloids
scheres Jun 9, 2025
4414e86
more GUI tweaks to GPU tracing of amyloids
scheres Jun 9, 2025
ae0cd9c
output downscaled fom and psi images
scheres Jun 11, 2025
a6ed141
better error handling
scheres Jun 16, 2025
bce6853
try going back to wider sigma2rot as Sofia reported problems with new…
scheres Jun 16, 2025
5a49fc4
also gigms2rot in mpi version
scheres Jun 16, 2025
6e29463
patch from nvidia to allow compilation with cuda13
scheres Jun 19, 2025
514f171
make dependence on c++17 explicit
scheres Jun 20, 2025
88752b1
implemented option to paint masks in 2D images
scheres Jun 23, 2025
1e5e574
made amypicker2 work
scheres Jun 24, 2025
d2d1fc2
further tweaks to paint_mask in relion_display
scheres Jun 24, 2025
26f66ea
now add_paint works ok
scheres Jun 24, 2025
ade24f5
Merge branch 'ver5.0' into ver5.1
biochem-fan Jun 26, 2025
35adad1
added carbon detection to amyloid tracing
scheres Jul 2, 2025
dae2984
added amyprep and amyproc Schemes
scheres Jul 2, 2025
e128777
try copying standard Scheme from relion scripts directory if it doesn…
scheres Jul 2, 2025
9d001db
Bugfix in subtomo to SPA expansion
dkimanius Jul 8, 2025
de08e7d
relion_project overwrite flag
dkimanius Jul 8, 2025
b4a616f
clarified output better
scheres Jul 15, 2025
27178ab
introduce threshold on psi-jumps in tracing of amyloids
scheres Jul 16, 2025
6fda976
further changes to psi-angle tracing and defaults on gui for amyloid…
scheres Jul 16, 2025
5dee147
Merge branch 'devel-ver5.0' into devel-master
biochem-fan Sep 5, 2025
dc65e09
Merge branch 'devel-ver5.0' into devel-master
biochem-fan Sep 5, 2025
5ac49a2
Merge branch 'devel-master' into devel-ver5.1
biochem-fan Sep 5, 2025
829b720
Merge branch 'devel-ver5.0' into devel-master
biochem-fan Sep 5, 2025
b95ff9e
Merge branch 'devel-master' into devel-ver5.1
biochem-fan Sep 5, 2025
b918cf2
fix rounding of box size when Fourier cropping image stacks in Fourie…
bogdantoader Sep 17, 2025
fefe5b5
Merge branch 'ver5.0' into devel-ver5.1
biochem-fan Sep 19, 2025
a1d1a6c
pinned version for opencv-python which is necessary for imprt cv2 in …
scheres Sep 19, 2025
38d9a20
Merge branch 'ver5.1' of https://github.com/3dem/relion-devel into ve…
scheres Sep 19, 2025
b12c63e
dont save relion_it_options.py in schemegui
scheres Sep 19, 2025
2bba98f
fix visiblity determination for subtomo particle reconstruction
daniel-ji Oct 13, 2025
1e2c625
FindCUDA is removed in newer CMake versions (GitHub issue #1016, #1161,
biochem-fan Oct 17, 2025
19785d7
CMake: improved NVCC discovery and set C/C++ standards and CUDA_ARCH
biochem-fan Oct 20, 2025
2d9c9e9
CMake: properly set NVCC flags
biochem-fan Oct 21, 2025
c900cf4
Merge branch 'ver5.0' into cmake_no_findCUDA
biochem-fan Oct 21, 2025
7e11f4c
Merge branch 'cmake_no_findCUDA' into ver5.1
biochem-fan Oct 21, 2025
e820bc3
Merge branch '3dem:master' into master
daniel-ji Oct 31, 2025
d97c63b
implemented min/max for ice rings for Yue Zhang
scheres Nov 11, 2025
720dfb3
Merge branch 'ver5.1' of https://github.com/3dem/relion-devel into ve…
scheres Nov 11, 2025
41451e6
At the moment, build fails with CMake <= 3.20.
biochem-fan Nov 12, 2025
c820683
Merge branch 'ver5.0' into cmake_no_findCUDA
biochem-fan Nov 12, 2025
06357d9
Merge branch 'cmake_no_findCUDA' into ver5.1
biochem-fan Nov 12, 2025
52aa481
Merge branch 'ver5.1' of github.com:3dem/relion-devel into ver5.1
biochem-fan Nov 12, 2025
62d0900
Merge branch 'master' of https://github.com/3dem/relion-devel
scheres Dec 15, 2025
3f8c1eb
Merge branch 'master' into ver5.1
scheres Dec 15, 2025
aca3f2d
Merge branch 'ver5.1' of https://github.com/3dem/relion-devel into ve…
scheres Dec 15, 2025
80ffe18
add downloading of amyblush, amy-v1.0 weights
scheres Dec 15, 2025
603bc58
added amyblush on GUI, and format os subtomos as a dropdown menu
scheres Dec 15, 2025
4d79820
repaired small bug in blush versions
scheres Dec 15, 2025
f09dd59
deal with amyloid picker weights
scheres Dec 16, 2025
86b939f
debugging fetching weights for amypicker
scheres Dec 16, 2025
2fb54a4
import specific libraries later, so can re-use script for fetching we…
scheres Dec 16, 2025
2b65918
import specific libraries later, so can re-use script for fetching we…
scheres Dec 16, 2025
e8e0e4c
set version to 5.1.0
scheres Dec 16, 2025
e93d257
hmmm, getting trouble with local definitions of imports
scheres Dec 16, 2025
df8c560
repaired indentation
scheres Dec 16, 2025
d168c02
go back to imports at the beginning
scheres Dec 16, 2025
2bf85d1
only do carbon when asked for
scheres Dec 16, 2025
81aa7f6
write PNGs instead of plotting to screen for trace amyloids
scheres Dec 16, 2025
144b7d1
changed buttons to teal colour for relion-5.1
scheres Dec 17, 2025
3e1edb0
make sure trace_amyloids.py uses the correct torch home and relion ex…
scheres Jan 2, 2026
f0119b8
repaired error in name of trace_amyloids.py
scheres Jan 2, 2026
a61ad65
just comment what typical blush command looks like so we don't need t…
scheres Jan 2, 2026
695f3f0
added option to set tilt prior for helical extract jobs
scheres Jan 5, 2026
966c1d2
repaired bug tilt prior on gui
scheres Jan 5, 2026
1ea7378
use pytorh 2.9 in relion conda environment to use RTX50xx and Blackwe…
scheres Jan 7, 2026
4a95745
shorter name in titlebar of main gui
scheres Jan 7, 2026
30f3dac
new image of dynein-dynaction for the initial screen of 5.1
scheres Jan 8, 2026
8ed039f
revert back to torch==2.7.1+cu128, but make this the default environment
scheres Jan 8, 2026
ba3b86b
this is the old environment; also removed torchvision from topaz depe…
scheres Jan 8, 2026
6851215
new text for background dynein structure
scheres Feb 3, 2026
9d94289
repair bug fourfilter
scheres Feb 3, 2026
b07a33d
remove skip_direction2 from helical orientations
scheres Feb 3, 2026
0332f23
allow tilted images for helices to set tilt prior
scheres Feb 3, 2026
501c2be
default tilt angle should be zero
scheres Feb 6, 2026
9db40ec
add option to search tilt in CTFFINF4.1; not exposed on GUI as doesn'…
scheres Feb 12, 2026
a74afde
removed incorrect handling of tilted images for filaments
scheres Feb 18, 2026
cb26836
Merge branch 'master' of https://github.com/3dem/relion
scheres Feb 18, 2026
50c5c5b
Merge remote-tracking branch 'origin/master' into ver5.1
biochem-fan Mar 13, 2026
fcd6966
Merge branch 'ver5.1' of github.com:3dem/relion-devel into ver5.1
biochem-fan Mar 13, 2026
152c14a
Merge branch 'ver5.0' into ver5.1
biochem-fan Mar 18, 2026
9657685
Remove Jasenko's experimental programs.
biochem-fan Mar 18, 2026
13cc231
Pin napari-threedee and psygnal to working versions from relion-5.0 e…
bogdantoader Mar 25, 2026
ed374e8
Fix amyloid tracer model download during `cmake` (Issue #1338).
biochem-fan Apr 1, 2026
45f0a30
Merge branch 'ver5.1' of github.com:3dem/relion-devel into ver5.1
biochem-fan Apr 1, 2026
fe13611
Treat ".gain" gain references as TIFF on the generic image path (#1346)
amineuron May 31, 2026
3cd4ac5
Merge branch '3dem:master' into master
daniel-ji Jun 23, 2026
b1fe45f
Merge remote-tracking branch 'fork-origin/ver5.1'
daniel-ji Jun 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 77 additions & 74 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)

#if(POLICY CMP0048)
# cmake_policy(SET CMP0048 NEW)
#endif()
project(Relion)

# Use new policy for OS X @rpath
Expand Down Expand Up @@ -72,13 +69,12 @@ endif()

# ----------------------------------------------------------------SET CXX STANDARD--
set(CXX_STANDARD_REQUIRED ON)
if(SYCL)
set(CMAKE_CXX_STANDARD 17)
else()
set(CMAKE_CXX_STANDARD 14)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)

set(C_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 99)

# ------------------OPTIONS WHICH ARE NEEDED TO SET BUILD-TYPES (COMPILATION FLAGS)--
# -------------------------------------------------------------------FURTHER OPTIONS--

Expand Down Expand Up @@ -170,48 +166,47 @@ else(DoublePrec_ACC)
endif(DoublePrec_ACC)

if(MDT_TYPE_CHECK)
message("-- MetaDataTable type check is enabled.")
message(STATUS "MetaDataTable type check is enabled.")
add_definitions(-DMETADATA_TABLE_TYPE_CHECK)
endif()

if(CUDA)
# -----------------------------------------------------------------------------CUDA--
# DOC: http://www.cmake.org/cmake/help/v3.0/module/FindCUDA.html
FIND_PACKAGE(CUDA)

# "-arch=sm_XX" alone is equal to "-arch=compute_XX -code=compute_XX,sm_XX"
# compute_XX generates PTX; thus GPUs newer than XX can also use the binary.
# See https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/#gpu-architecture-arch.
set(CUDA_ARCH "" CACHE STRING "CUDA architecture to use")
if (CUDA_ARCH STREQUAL "")
if (${CUDA_VERSION} VERSION_LESS "13.0") # Pascal (e.g. 1080)
message(STATUS "Setting fallback CUDA_ARCH=50 (Pascal)")
set(CUDARCH "-arch=sm_50")
else() # CUDA >= 13.0 no longer supports Pascal. 75 = Turing (e.g. 2080)
message(STATUS "Setting fallback CUDA_ARCH=75 (Turing)")
set(CUDARCH "-arch=sm_75")
endif()
else ()
message(STATUS "Using provided CUDA_ARCH=${CUDA_ARCH}")
set(CUDARCH "-arch=sm_${CUDA_ARCH}")
endif ()

if(CUDA_FOUND)
message(STATUS "Using cuda wrapper to compile....")
if( (NOT ${CUDA_VERSION} VERSION_LESS "7.5") AND (NOT DoublePrec_ACC) )
message(STATUS "Cuda version is >= 7.5 and single-precision build, enable double usage warning.")
set(WARN_DBL "--ptxas-options=-warn-double-usage") # cuda>=7.5
elseif( ${CUDA_VERSION} VERSION_LESS "7.0")
message(WARNING "Cuda version is less than 7.0, so relion will be compiled without GPU support.")
message(STATUS "Using non-cuda compilation....")
set(CUDA OFF)
endif()
if(CUDA)
add_definitions(-D_CUDA_ENABLED)
endif()
else(CUDA_FOUND)
message(FATAL_ERROR "CUDA enabled but unlable to locate packages...")
endif(CUDA_FOUND)
FIND_PACKAGE(CUDAToolkit)

if((CUDAToolkit_FOUND) AND ("${CUDAToolkit_VERSION}" VERSION_GREATER_EQUAL "10.0"))
message(STATUS "CUDAToolkit discovered CUDA " ${CUDAToolkit_VERSION} " at " ${CUDAToolkit_BIN_DIR})
set(CMAKE_CUDA_STANDARD 17)

# Very puzzling but `CUDAToolkit` package and `enable_language(CUDA)` use
# different methods to find `nvcc`. The latter does NOT respect `PATH` (`which nvcc`) and
# can pick up /usr/bin/nvcc. We can override this by setting `CMAKE_CUDA_COMPILER`.
# Another useful variable is `CMAKE_CUDA_HOST_COMPILER`.
set(CMAKE_CUDA_COMPILER "${CUDAToolkit_BIN_DIR}/nvcc" CACHE FILEPATH "Path to the CUDA compiler (nvcc)")
enable_language(CUDA)

# "-arch=sm_XX" alone is equal to "-arch=compute_XX -code=compute_XX,sm_XX"
# compute_XX generates PTX; thus GPUs newer than XX can also use the binary.
# See https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/#gpu-architecture-arch.
set(CUDA_ARCH "" CACHE STRING "CUDA architecture to use")
if (CUDA_ARCH STREQUAL "")
if (${CUDAToolkit_VERSION} VERSION_LESS "13.0") # Pascal (e.g. 1080)
message(STATUS "Setting fallback CUDA_ARCH=50 (Pascal)")
set(CMAKE_CUDA_ARCHITECTURES 50)
else() # CUDA >= 13.0 no longer supports Pascal. 75 = Turing (e.g. 2080)
message(STATUS "Setting fallback CUDA_ARCH=75 (Turing)")
set(CMAKE_CUDA_ARCHITECTURES 75)
endif()
else ()
message(STATUS "Using provided CUDA_ARCH=${CUDA_ARCH}")
set(CMAKE_CUDA_ARCHITECTURES ${CUDA_ARCH})
endif ()

add_definitions(-D_CUDA_ENABLED)
else()
message("!! CUDA was enabled but CUDA >= 10.0 cannot be located. CUDA is set to OFF.")
set(CUDA OFF)
endif()
elseif(HIP)
# ------------------------------------------------------------------------------HIP--
if (DEFINED ENV{ROCM_PATH})
Expand Down Expand Up @@ -257,6 +252,24 @@ elseif(ALTCPU)
endif()
endif()

# ----------------------------------------------------------------- OpenMP ----------
# This must come before including BuildTypes.cmake to properly set OpenMP flags to NVCC.
# CUDA support by the OpenMP package came at CMake 3.31 (too new).

if(SYCL) # Intel DPC++ specific; I don't know when the OpenMP package supports SYCL
set(OpenMP_C_FLAGS "-fiopenmp")
set(OpenMP_CXX_FLAGS "-fiopenmp")
set(OpenMP_EXE_LINKER_FLAGS "-fiopenmp")
else()
FIND_PACKAGE(OpenMP REQUIRED)
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-fPIC ${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")

#message(STATUS "OpenMP_CXX_FLAGS: ${OpenMP_CXX_FLAGS}")

# ----------------------------------------------------------INCLUDE ALL BUILD TYPES---
# This has to be AFTER project() and find_package(HIP).
# Up to RELION 5.0.0, this must come BEFORE find_package(CUDA) as discussed in issue #1032.
Expand Down Expand Up @@ -372,29 +385,6 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# ----------------------------------------------------------------- OpenMP ----------
# This MUST be set before all cuda_add_executable/library calls.
# Otherwise the -Xcompiler argument to NVCC does not contain -fopenmp
# and #pragma omp critical is SILENTLY ignored, giving a wrong binary!!!
# https://github.com/3dem/relion/issues/1016

if(SYCL) # Intel DPC++ specific
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fiopenmp")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fiopenmp")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fiopenmp")

set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-fPIC -std=c++17 ${CMAKE_CXX_FLAGS}")
else()
FIND_PACKAGE(OpenMP REQUIRED)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")

set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-fPIC -std=c++17 ${CMAKE_CXX_FLAGS}")
endif()

# ----------------------------------------------------------Intel Compiler support --
# ---------------------------------- and build flags including MKL and IPP ---------

Expand Down Expand Up @@ -486,9 +476,9 @@ if(GUI)
endif(NOT FLTK_FOUND)

else(X11_FOUND)
message( STATUS "\n-- ------------------ YOU HAVE NO X11-LIBS ------------------")
message( STATUS "CCmake found no X11-libs on your system, which are required for the GUI.")
message( STATUS " You CAN add the flag -DGUI=OFF to avoid using X11" )
message(STATUS "\n-- ------------------ YOU HAVE NO X11-LIBS ------------------")
message(STATUS "CCmake found no X11-libs on your system, which are required for the GUI.")
message(STATUS " You CAN add the flag -DGUI=OFF to avoid using X11" )
message(FATAL_ERROR "X11 is required for GUI.")
endif(X11_FOUND)

Expand Down Expand Up @@ -551,7 +541,7 @@ endif(JPEG_FOUND)
# -----------------------------------------------------------------PYTHON DEPENDENCIES--


set(CONDA_ENV_NAME "relion-5.0" CACHE STRING "The Conda environment name")
set(CONDA_ENV_NAME "relion-5.1" CACHE STRING "The Conda environment name")
include(${CMAKE_SOURCE_DIR}/cmake/FindCondaPython.cmake)

list(APPEND RELION_PYTHON_WRAPPERS
Expand All @@ -569,6 +559,8 @@ list(APPEND RELION_PYTHON_WRAPPERS
python_tomo_get_particle_poses
python_tomo_denoise
filament_selection
python_trace_amyloids
schemegui
)

foreach (SCRIPT_FILE ${RELION_PYTHON_WRAPPERS})
Expand All @@ -587,6 +579,12 @@ if (FETCH_WEIGHTS)
"NOTE: You can skip this step by setting -DFETCH_WEIGHTS=OFF"
)

# `relion_trace_amyloids.py` is necessary for weight download during `cmake`.
# The `copy_scripts` target below is executed only during `make`.
configure_file("${CMAKE_SOURCE_DIR}/scripts/trace_amyloids.py"
"${CMAKE_BINARY_DIR}/bin/relion_trace_amyloids.py"
COPYONLY)

execute_process(
COMMAND bash ${CMAKE_BINARY_DIR}/bin/relion_python_fetch_weights
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
Expand Down Expand Up @@ -623,7 +621,7 @@ list(APPEND RELION_SCRIPT_FILES
star_datablock_ctfdat
qsub.csh
it.py
schemegui.py
trace_amyloids.py
)

add_custom_target(copy_scripts ALL)
Expand Down Expand Up @@ -675,6 +673,11 @@ message(STATUS "CMAKE_CXX_FLAGS : ${CMAKE_CXX_FLAGS}")
#message(STATUS "MPI_C_COMPILER : ${MPI_C_COMPILER}")
#message(STATUS "MPI_CXX_COMPILER : ${MPI_CXX_COMPILER}")
#message(STATUS "CMAKE_EXE_LINKER_FLAGS : ${CMAKE_EXE_LINKER_FLAGS}")
#message(STATUS "CUDAToolkit_FOUND: ${CUDAToolkit_FOUND}")
#get_target_property(CUDART_LIB CUDA::cudart IMPORTED_LOCATION)
#message(STATUS "CUDA::cudart location: ${CUDART_LIB}")
#get_target_property(CUDART_INC CUDA::cudart INTERFACE_INCLUDE_DIRECTORIES)
#message(STATUS "CUDA::cudart includes: ${CUDART_INC}")

# -----------------------------------------------------------------------------TESTS--
# Include testing flag(s) as precomiler
Expand Down
17 changes: 8 additions & 9 deletions cmake/BuildTypes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# Add -G to allow cuda-gdb to break inside kernels.

if(CUDA)
set(EXTRA_NVCC_FLAGS " --default-stream per-thread --std=c++17")
set(RELION_NVCC_FLAGS "${CUDARCH} ${WARN_DBL} ${EXTRA_NVCC_FLAGS}" CACHE STRING "" FORCE)
set(RELION_NVCC_FLAGS "--default-stream per-thread -Xcompiler ${OpenMP_CXX_FLAGS} " CACHE STRING "" FORCE)
elseif (HIP)
if (${HIP_VERSION} VERSION_LESS "5.3" )
set(EXTRA_HIPCC_FLAGS "-fgpu-default-stream=legacy -fno-gpu-rdc -munsafe-fp-atomics")
Expand Down Expand Up @@ -43,7 +42,7 @@ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${RELION_FLAGS_DEBUG}")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${RELION_LINKER_FLAGS_DEBUG}")

if(CUDA)
set(CUDA_NVCC_FLAGS_DEBUG "${RELION_NVCC_FLAGS_DEBUG}" CACHE STRING "" FORCE)
set(CMAKE_CUDA_FLAGS_DEBUG "${RELION_NVCC_FLAGS_DEBUG}" CACHE STRING "" FORCE)
elseif(HIP)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${RELION_HIPCC_FLAGS_DEBUG}")
endif()
Expand All @@ -59,7 +58,7 @@ endif()

# message(STATUS "Set the extra flags for Debug build type")
# message(STATUS "RELION_NVCC_FLAGS_DEBUG : ${RELION_NVCC_FLAGS_DEBUG}")
# message(STATUS "CUDA_NVCC_FLAGS_DEBUG : ${CUDA_NVCC_FLAGS_DEBUG}")
# message(STATUS "CMAKE_CUDA_FLAGS_DEBUG : ${CMAKE_CUDA_FLAGS_DEBUG}")
# message(STATUS "CMAKE_CXX_FLAGS_DEBUG : ${CMAKE_CXX_FLAGS_DEBUG}")
#--------------------------------------------------------------------

Expand All @@ -82,7 +81,7 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${R
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${RELION_FLAGS_RELWITHDEBINFO}")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} ${RELION_LINKER_FLAGS_RELWITHDEBINFO}")
if(CUDA)
set(CUDA_NVCC_FLAGS_RELWITHDEBINFO "${RELION_NVCC_FLAGS_RELWITHDEBINFO}" CACHE STRING "" FORCE)
set(CMAKE_CUDA_FLAGS_RELWITHDEBINFO "${RELION_NVCC_FLAGS_RELWITHDEBINFO}" CACHE STRING "" FORCE)
# -- Add preprocessor defintions ------------------------------------
set(RELION_DEFINITIONS_RELWITHDEBINFO "-DDEBUG_CUDA")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${RELION_DEFINITIONS_RELWITHDEBINFO}")
Expand All @@ -95,7 +94,7 @@ endif()

# message(STATUS "Set the extra flags for RELWITHDEBINFO build type")
# message(STATUS "RELION_NVCC_FLAGS_RELWITHDEBINFO : ${RELION_NVCC_FLAGS_RELWITHDEBINFO}")
# message(STATUS "CUDA_NVCC_FLAGS_RELWITHDEBINFO : ${CUDA_NVCC_FLAGS_RELWITHDEBINFO}")
# message(STATUS "CMAKE_CUDA_FLAGS_RELWITHDEBINFO : ${CMAKE_CUDA_FLAGS_RELWITHDEBINFO}")
# message(STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO : ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
#--------------------------------------------------------------------

Expand Down Expand Up @@ -130,7 +129,7 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELION_FLAGS_RE
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELION_FLAGS_RELEASE}")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${RELION_LINKER_FLAGS_RELEASE}")
if(CUDA)
set(CUDA_NVCC_FLAGS_RELEASE "${RELION_NVCC_FLAGS_RELEASE}" CACHE STRING "" FORCE)
set(CMAKE_CUDA_FLAGS_RELEASE "${RELION_NVCC_FLAGS_RELEASE}" CACHE STRING "" FORCE)
elseif(HIP)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELION_HIPCC_FLAGS_RELEASE}")
endif()
Expand Down Expand Up @@ -166,7 +165,7 @@ if(CUDA)
set(CMAKE_CXX_FLAGS_PROFILING "${CMAKE_CXX_FLAGS_RELEASE} ${RELION_FLAGS_PROFILING}" CACHE STRING "")
set(CMAKE_C_FLAGS_PROFILING "${CMAKE_C_FLAGS_RELEASE} ${RELION_FALAGS_PROFILING}" CACHE STRING "")
set(CMAKE_EXE_LINKER_FLAGS_PROFILING "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${RELION_LINKER_FLAGS_PROFILING}" CACHE STRING "")
set(CUDA_NVCC_FLAGS_PROFILING "${RELION_NVCC_FLAGS_PROFILING}" CACHE STRING "" FORCE)
set(CMAKE_CUDA_FLAGS_PROFILING "${RELION_NVCC_FLAGS_PROFILING}" CACHE STRING "" FORCE)

# -- Add preprocessor defintions ------------------------------------
set(RELION_DEFINITIONS_PROFILING "-DCUDA_PROFILING")
Expand Down Expand Up @@ -223,7 +222,7 @@ set(CMAKE_CXX_FLAGS_BENCHMARKING "${CMAKE_CXX_FLAGS_RELEASE} ${RELION_FLA
set(CMAKE_C_FLAGS_BENCHMARKING "${CMAKE_C_FLAGS_RELEASE} ${RELION_FLAGS_BENCHMARKING}" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_BENCHMARKING "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${RELION_LINKER_FLAGS_BENCHMARKING}" CACHE STRING "" FORCE)
if(CUDA)
set(CUDA_NVCC_FLAGS_BENCHMARKING "${RELION_NVCC_FLAGS_BENCHMARKING}" CACHE STRING "" FORCE)
set(CMAKE_CUDA_FLAGS_BENCHMARKING "${RELION_NVCC_FLAGS_BENCHMARKING}" CACHE STRING "" FORCE)
elseif(HIP)
set(CMAKE_CXX_FLAGS_BENCHMARKING "${CMAKE_CXX_FLAGS_RELEASE} ${RELION_HIPCC_FLAGS_BENCHMARKING}")
endif()
Expand Down
10 changes: 7 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: relion-5.0
name: relion-5.1
channels:
- conda-forge
dependencies:
- pip
- python=3.10
- setuptools=59.5.0
- pip:
- torch==2.0.1
- torchvision==0.15.2
- --extra-index-url https://download.pytorch.org/whl/cu128
- torch==2.7.1+cu128
- tqdm==4.65.0
- mrcfile==1.4.3
- starfile>=0.5.6
Expand All @@ -18,6 +18,8 @@ dependencies:
- morphosamplers==0.0.13
- pydantic==1.10.18
- napari[all]==0.4.18
- napari-threedee==0.0.28
- psygnal==0.11.1
- tsnecuda==3.0.1
- PyQt5==5.15.9
- typer==0.9.0
Expand All @@ -28,6 +30,8 @@ dependencies:
- dill==0.3.7
- numpy==1.26.1
- scipy==1.11.2
- skan==0.12.2
- opencv-python==4.10.0.84
- git+https://github.com/3dem/relion-classranker
- git+https://github.com/3dem/relion-blush
- git+https://github.com/3dem/DynaMight
Expand Down
8 changes: 4 additions & 4 deletions environment_blackwell.yml → environment_pascal.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: relion-5.0
name: relion-5.1
channels:
- conda-forge
dependencies:
- pip
- python=3.10
- setuptools=59.5.0
- pip:
- --extra-index-url https://download.pytorch.org/whl/cu128
- torch==2.7.1+cu128
- torchvision==0.22.1+cu128
- torch==2.0.1
- tqdm==4.65.0
- mrcfile==1.4.3
- starfile>=0.5.6
Expand All @@ -29,6 +27,8 @@ dependencies:
- dill==0.3.7
- numpy==1.26.1
- scipy==1.11.2
- skan==0.12.2
- opencv-python==4.10.0.84
- git+https://github.com/3dem/relion-classranker
- git+https://github.com/3dem/relion-blush
- git+https://github.com/3dem/DynaMight
Expand Down
Loading
Loading