Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Thomas Hoffmann, EMBL Heidelberg, structures-it@embl.de, 2024/1
easyblock = 'MakeCp'

name = 'AreTomo2'
version = '1.1.2'
versionsuffix = '-CUDA-%(cudaver)s'

homepage = 'https://github.com/czimaginginstitute/AreTomo2'

description = """AreTomo2, a multi-GPU accelerated software package that fully automates motion-
corrected marker-free tomographic alignment and reconstruction, now includes
robust GPU-accelerated CTF (Contrast Transfer Function) estimation in a single
package. AreTomo2 is part of our endeavor to build a fully-automated high-
throughput processing pipeline that enables real-time reconstruction of
tomograms in parallel with tomographic data collection. It strives to be fast
and accurate, as well as provides for easy integration into subtomogram
processing workflows by generating IMod compatible files containing alignment
and CTF parameters needed to bootstrap subtomogram averaging. AreTomo2 can also
be used for on-the-fly reconstruction of tomograms and CTF estimation in
parallel with tilt series collection, enabling real-time assessment of sample
quality and adjustment of collection parameters"""

toolchain = {'name': 'GCCcore', 'version': '12.3.0'}
toolchainopts = {'cstd': 'c++11'}

source_urls = [GITHUB_SOURCE]
sources = ['v%(version)s.tar.gz']
patches = ['%(name)s-%(version)s_makefile_lib.patch']
checksums = [
{'v1.1.2.tar.gz': '4cbb4d25d28778041d80ef2c598519b17b9a40aa84e1e99daf48ad5a90d946b4'},
{'AreTomo2-1.1.2_makefile_lib.patch': '53b3694104c4149d2714e503fb2a7cb9be7cbb0e500ee6991a606faa1c10a314'},
]

github_account = 'czimaginginstitute'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should come before source_urls, please fix


prebuildopts = 'rm -rf LibSrc/Lib/*.a && '
build_cmd = 'make clean -f makefile11 && make exe -f makefile11 CUDAHOME=$CUDA_HOME CUDACC="%(cuda_cc_cmake)s"'

builddependencies = [
('binutils', '2.40')
]

dependencies = [
('CUDA', '12.1.1', '', SYSTEM),
]

files_to_copy = [(['%(name)s'], 'bin')]

sanity_check_paths = {
'files': ['bin/%(name)s'],
'dirs': ['bin'],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dirs can be just "[]" since bin is already checked due to files

}

sanity_check_commands = ['%(name)s -h']

moduleclass = 'bio'
96 changes: 96 additions & 0 deletions easybuild/easyconfigs/a/AreTomo2/AreTomo2-1.1.2_makefile_lib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Thomas Hoffmann, EBML Heidelberg, structures-it@embl.de, 2024/10
# Allow to inject cuda compute capabilities and cfalgs.
# Add targets for libmrcfile.a, libutil.a, and libclean
diff -ru AreTomo2-1.1.2/LibSrc/Mrcfile/makefile AreTomo2-1.1.2_makefile/LibSrc/Mrcfile/makefile
--- AreTomo2-1.1.2/LibSrc/Mrcfile/makefile 2024-02-21 05:57:47.000000000 +0100
+++ AreTomo2-1.1.2_makefile/LibSrc/Mrcfile/makefile 2024-10-31 12:55:25.131194106 +0100
@@ -19,8 +19,8 @@
OBJS = $(patsubst %.cpp, %.o, $(SRCS))
OUT = libmrcfile.a

-CC = g++ -std=c++11
-CFLAGS = -m64 -c -g -pthread -IInclude -I$(INCDIR)
+#CC = g++ -std=c++11
+CFLAGS_ = -m64 -c -g -pthread -IInclude -I$(INCDIR) $(CFLAGS)

all: $(OBJS)
@ar rcs $(OUT) $(OBJS)
@@ -33,7 +33,9 @@

%.o: %.cpp
@echo Compile $<
- @$(CC) $(CFLAGS) $< -o $@
+ @echo $(CC) $(CFLAGS_) $< -o $@
+ @$(CC) $(CFLAGS_) $< -o $@
Comment on lines +23 to +24
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just remove the "@" in front of the compile line if you want it to print what it does.


clean:
+ @echo rm -f $(OUT) $(OBJS) *.*~ makefile~
@rm -f $(OUT) $(OBJS) *.*~ makefile~
Comment on lines +27 to +28
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here but for the rm line

diff -ru AreTomo2-1.1.2/LibSrc/Util/makefile AreTomo2-1.1.2_makefile/LibSrc/Util/makefile
--- AreTomo2-1.1.2/LibSrc/Util/makefile 2024-02-21 05:57:47.000000000 +0100
+++ AreTomo2-1.1.2_makefile/LibSrc/Util/makefile 2024-10-31 12:55:10.603854025 +0100
@@ -5,8 +5,8 @@
#-------------------
OUT = libutil.a

-CC = g++ -std=c++11
-CFLAG = -c -g -pthread -m64
+#CC = g++ -std=c++11
+CFLAG = -c -g -pthread -m64 $(CFLAGS)

all: $(OBJS)
@echo create library $(OUT) and move to $(PROJ_DIR)/Lib
@@ -16,6 +16,7 @@
@cp $(HDRS) $(PROJ_DIR)/Include/Util

%.o: %.cpp
+ echo $(CC) $(CFLAG) $< -o $@
$(CC) $(CFLAG) $< -o $@
Comment on lines +47 to +48
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The $(CC) is printed by make anyway


list:
diff -ru AreTomo2-1.1.2/makefile11 AreTomo2-1.1.2_makefile/makefile11
--- AreTomo2-1.1.2/makefile11 2024-02-21 05:57:47.000000000 +0100
+++ AreTomo2-1.1.2_makefile/makefile11 2024-10-31 12:52:55.796679029 +0100
@@ -179,7 +179,24 @@

compile: $(OBJS)

-exe: $(OBJS)
+libclean:
+ $(MAKE) -C LibSrc/Util clean
+ $(MAKE) -C LibSrc/Mrcfile clean
+
+LibSrc/Lib/libutil.a:
+ $(MAKE) -C LibSrc/Util
+
+LibSrc/Lib/libmrcfile.a:
+ $(MAKE) -C LibSrc/Mrcfile
+
+exe: $(OBJS) LibSrc/Lib/libmrcfile.a LibSrc/Lib/libutil.a
+ @echo g++ -g -pthread -m64 $(OBJS) \
+ $(PRJLIB)/libmrcfile.a \
+ $(PRJLIB)/libutil.a \
+ -L$(CUDALIB) -L/usr/lib64 \
+ -lcufft -lcudart -lcuda -lc -lm -lpthread \
+ -o AreTomo2
+
@g++ -g -pthread -m64 $(OBJS) \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use $(CXX) not g++

$(PRJLIB)/libmrcfile.a \
$(PRJLIB)/libutil.a \
@@ -193,10 +210,12 @@
@echo $< has been compiled.

%.o: %.cpp
+ @echo $(CC) $(CFLAG) -I$(PRJINC) -I$(CUDAINC) \
+ $< -o $@
@$(CC) $(CFLAG) -I$(PRJINC) -I$(CUDAINC) \
Comment on lines +84 to +86
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here to, just drop the @

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @akesandgren, i was not aware of the meaning of @.
I'll have on your suggestions next week.

$< -o $@
@echo $< has been compiled.

-clean:
- @rm -f $(OBJS) $(CUCPPS) *.h~ makefile~ AreTomo2
-
+clean: libclean
+ @echo rm -f $(OBJS) $(CUCPPS) *.h~ makefile~ AreTomo2 LibSrc/Lib/*.a
+ @rm -f $(OBJS) $(CUCPPS) *.h~ makefile~ AreTomo2 LibSrc/Lib/*.a
Only in AreTomo2-1.1.2_makefile: .makefile11.swp
Loading