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

Add Mothur 1.48.2 for foss-2023b #21857

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
25 changes: 25 additions & 0 deletions easybuild/easyconfigs/m/Mothur/Mothur-1.48.2-foss-2023b.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name = 'Mothur'
version = '1.48.2'

homepage = 'https://www.mothur.org/'
description = """Mothur is a single piece of open-source, expandable software
to fill the bioinformatics needs of the microbial ecology community."""

toolchain = {'name': 'foss', 'version': '2023b'}
toolchainopts = {'usempi': True, 'cstd': 'c++11'}

source_urls = ['https://github.com/mothur/mothur/archive/']
sources = ['v%(version)s.tar.gz']
patches = ['Mothur-%(version)s_fix-hardcoding.patch']
checksums = ['bd37b22b5d2629c5f44bd7f104c5e5a2c3a117d724cd113ec7526c4aa62e1793']

dependencies = [
('Python', '3.11.5'),
('Boost.Python', '1.83.0'),
('HDF5', '1.14.3'),
('libreadline', '8.2'),
('ncurses', '6.4'),
('zlib', '1.2.13'),
]

moduleclass = 'bio'
118 changes: 118 additions & 0 deletions easybuild/easyconfigs/m/Mothur/Mothur-1.48.2_fix-hardcoding.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
diff -ruN mothur-1.48.2.orig/Makefile /tmp/eb/Mothur/1.48.2/foss-2023b/mothur-1.48.2/Makefile
Copy link
Contributor

Choose a reason for hiding this comment

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

We ask that patches include a short description what it solves and their author for reference.

Once you include this, please also include the checksum for the patch in the easyconfig.

You can use EB to inject the checksums automatically using

eb Mothur-1.48.2-foss-2023b.eb --inject-checksums 

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the review. I added these in 6f09ef8 and 90fa0d9.

--- mothur-1.48.2.orig/Makefile 2024-11-04 20:53:24.000000000 +0100
+++ /tmp/eb/Mothur/1.48.2/foss-2023b/mothur-1.48.2/Makefile 2024-11-15 10:25:46.139186951 +0100
@@ -20,7 +20,7 @@
# GSL_INCLUDE_DIR - location of GSL include files
# MOTHUR_FILES - The MOTHUR_FILES parameter is optional, but allows you to set a default location for mothur to look for input files it can't find. This is often used for reference files you want to store in one location separate from your data.

-INSTALL_DIR ?= "\"Enter_your_mothur_install_path_here\""
+INSTALL_DIR ?= "%(installdir)s"
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, is this tested to work? I don't see how it could, the %(installdir)s templates are not applied to patches.

Looking at the custom easyblock that this thing unfortunately needs to use, it's just manually making the installation via copying files, so I this probably doesn't even have any impact.

Copy link
Author

Choose a reason for hiding this comment

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

I was having problems getting the install to work without this change. Before changing this I was getting "undefined reference to main" and others as errors.
So if I understand what you are saying it would mean that I am just setting this to empty and thus could try like in the "MOTHUR_FILES" variable?


OPTIMIZE ?= yes
USEREADLINE ?= yes
@@ -29,13 +29,13 @@
USEGSL ?= no
LOGFILE_NAME ?= no

-BOOST_LIBRARY_DIR ?= "\"Enter_your_boost_library_path_here\""
-BOOST_INCLUDE_DIR ?= "\"Enter_your_boost_include_path_here\""
-HDF5_LIBRARY_DIR ?= "\"Enter_your_HDF5_library_path_here\""
-HDF5_INCLUDE_DIR ?= "\"Enter_your_HDF5_include_path_here\""
+BOOST_LIBRARY_DIR=${EBROOTBOOST}/lib
+BOOST_INCLUDE_DIR=${EBROOTBOOST}/include
+HDF5_LIBRARY_DIR=${EBROOTHDF5}/lib
+HDF5_INCLUDE_DIR=${EBROOTHDF5}/include
GSL_LIBRARY_DIR ?= "\"Enter_your_GSL_library_path_here\""
GSL_INCLUDE_DIR ?= "\"Enter_your_GSL_include_path_here\""
-MOTHUR_FILES="\"Enter_your_default_path_here\""
+MOTHUR_FILES=''
MOTHUR_TOOLS="\"Enter_your_mothur_tools_path_here\""
VERSION = "\"1.48.2\""
RELEASE_DATE = "\"11/4/24\""
@@ -47,13 +47,13 @@
endif

ifeq ($(strip $(OPTIMIZE)),yes)
- CXXFLAGS += -O3
+ #CXXFLAGS += -O3
endif

CXXFLAGS += -std=c++11 -pthread -DVERSION=${VERSION} -DRELEASE_DATE=${RELEASE_DATE}
LDFLAGS += -std=c++11 -pthread

-ifeq ($(strip $(MOTHUR_FILES)),"\"Enter_your_default_path_here\"")
+ifeq ($(strip $(MOTHUR_FILES)),'')
else
CXXFLAGS += -DMOTHUR_FILES=${MOTHUR_FILES}
endif
@@ -109,7 +109,7 @@
subdirs := $(sort $(dir $(filter-out $(skipUchime), $(wildcard source/*/))))
subDirIncludes = $(patsubst %, -I %, $(subdirs))
subDirLinking = $(patsubst %, -L%, $(subdirs))
- CXXFLAGS += -I. $(subDirIncludes)
+ CXXFLAGS += -I. $(subDirIncludes) -Isource
LDFLAGS += $(subDirLinking)


@@ -118,6 +118,9 @@
#
OBJECTS=$(patsubst %.cpp,%.o,$(wildcard $(addsuffix *.cpp,$(subdirs))))
OBJECTS+=$(patsubst %.c,%.o,$(wildcard $(addsuffix *.c,$(subdirs))))
+# Include additional objects in source/
+ OBJECTS+=$(patsubst %.cpp,%.o,$(wildcard source/*.cpp))
+ OBJECTS+=$(patsubst %.c,%.o,$(wildcard source/*.c))
OBJECTS+=$(patsubst %.cpp,%.o,$(wildcard *.cpp))
OBJECTS+=$(patsubst %.c,%.o,$(wildcard *.c))

diff -ruN mothur-1.48.2.orig/makefile-internal /tmp/eb/Mothur/1.48.2/foss-2023b/mothur-1.48.2/makefile-internal
--- mothur-1.48.2.orig/makefile-internal 2024-11-04 20:53:24.000000000 +0100
+++ /tmp/eb/Mothur/1.48.2/foss-2023b/mothur-1.48.2/makefile-internal 2024-11-15 10:28:51.863460631 +0100
@@ -43,8 +43,8 @@
#The boost libraries allow you to read gz files.
ifeq ($(strip $(USEBOOST)),yes)
#statically link so the boost install is not required on users machine
- BOOST_INCLUDE_DIR="/usr/local/include"
- BOOST_LIBRARY_DIR="/usr/local/lib"
+ BOOST_INCLUDE_DIR="${EBROOTBOOST}/include"
+ BOOST_LIBRARY_DIR="${EBROOTBOOST}/lib"

#windows paths
#BOOST_INCLUDE_DIR="/usr/x86_64-w64-mingw32/sys-root/mingw/include"
@@ -62,8 +62,8 @@
#User specified HDF5 library
ifeq ($(strip $(USEHDF5)),yes)

- HDF5_INCLUDE_DIR="/usr/local/include"
- HDF5_LIBRARY_DIR="/usr/local/lib"
+ HDF5_INCLUDE_DIR="${EBROOTHDF5}/include"
+ HDF5_LIBRARY_DIR="${EBROOTHDF5}/lib"

LDFLAGS += -L ${HDF5_LIBRARY_DIR}
LIBS += ${HDF5_LIBRARY_DIR}/libhdf5_hl_cpp.a
@@ -110,6 +110,9 @@
#
OBJECTS=$(patsubst %.cpp,%.o,$(wildcard $(addsuffix *.cpp,$(subdirs))))
OBJECTS+=$(patsubst %.c,%.o,$(wildcard $(addsuffix *.c,$(subdirs))))
+ # Include additional objects in source/
+ OBJECTS+=$(patsubst %.cpp,%.o,$(wildcard source/*.cpp))
+ OBJECTS+=$(patsubst %.c,%.o,$(wildcard source/*.c))
OBJECTS+=$(patsubst %.cpp,%.o,$(wildcard *.cpp))
OBJECTS+=$(patsubst %.c,%.o,$(wildcard *.c))

Binary files mothur-1.48.2.orig/source/calculators/prng.o and /tmp/eb/Mothur/1.48.2/foss-2023b/mothur-1.48.2/source/calculators/prng.o differ
Copy link
Contributor

Choose a reason for hiding this comment

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

this looks like something that shouldn't be included in the patch

Copy link
Author

Choose a reason for hiding this comment

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

Ok thanks, updated here: 6104290

diff -ruN mothur-1.48.2.orig/source/uchime_src/makefile /tmp/eb/Mothur/1.48.2/foss-2023b/mothur-1.48.2/source/uchime_src/makefile
--- mothur-1.48.2.orig/source/uchime_src/makefile 2024-11-04 20:53:24.000000000 +0100
+++ /tmp/eb/Mothur/1.48.2/foss-2023b/mothur-1.48.2/source/uchime_src/makefile 2024-11-15 10:29:38.800547895 +0100
@@ -1,4 +1,4 @@
-CXXFLAGS = -O3 -D_FILE_OFFSET_BITS=64 -DNDEBUG=1 -DUCHIMES=1
+CXXFLAGS = -O3 -D_FILE_OFFSET_BITS=64 -DNDEBUG=1 -DUCHIMES=1 -std=c++11
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, i wonder if we can just make this add the -D flags instead of overwriting CXXFLAGS completely, so that it catches the EB environment variables which set compiler flags (though I'm not going to insist of it in any way gets tricky).

Copy link
Author

Choose a reason for hiding this comment

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

Very sorry, but I'm not sure how to do this. This would be in the .eb file? thanks

LDFLAGS = -g

#
@@ -26,4 +26,4 @@

clean :
@rm -f $(OBJECTS)
-
\ No newline at end of file
+