diff --git a/modules/nf-core/sentieon/bwamem/main.nf b/modules/nf-core/sentieon/bwamem/main.nf index d4ec8878e55f..b0fd5c278052 100644 --- a/modules/nf-core/sentieon/bwamem/main.nf +++ b/modules/nf-core/sentieon/bwamem/main.nf @@ -22,6 +22,15 @@ process SENTIEON_BWAMEM { task.ext.when == null || task.ext.when script: + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' + } + def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" @@ -35,6 +44,8 @@ process SENTIEON_BWAMEM { echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d > \$SENTIEON_LICENSE fi + $fix_ld_library_path + INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'` sentieon bwa mem \\ @@ -52,8 +63,19 @@ process SENTIEON_BWAMEM { """ stub: + // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. + // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. + // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. + if (workflow.containerEngine in ['singularity','apptainer']) { + fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH' + } else { + fix_ld_library_path = '' + } + def prefix = task.ext.prefix ?: "${meta.id}" """ + $fix_ld_library_path + touch ${prefix}.bam touch ${prefix}.bam.bai diff --git a/modules/nf-core/sentieon/bwamem/tests/nextflow.config b/modules/nf-core/sentieon/bwamem/tests/nextflow.config index 678454138a27..b78b177de97e 100644 --- a/modules/nf-core/sentieon/bwamem/tests/nextflow.config +++ b/modules/nf-core/sentieon/bwamem/tests/nextflow.config @@ -6,13 +6,6 @@ env { SENTIEON_AUTH_DATA = secrets.SENTIEON_AUTH_DATA // NOTE This is how nf-core/sarek users will test out Sentieon in Sarek with a license file // SENTIEON_LICENSE_BASE64 = secrets.SENTIEON_LICENSE_BASE64 - - // The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity. - // That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers. - // The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error. - if (workflow.containerEngine in ['singularity','apptainer']) { - LD_LIBRARY_PATH ="/usr/local/lib/:\$LD_LIBRARY_PATH;" - } } process {