Skip to content

Commit

Permalink
Revert "refactor: Move ld_library_path to env since we're using it an…
Browse files Browse the repository at this point in the history
…yways now"

This reverts commit 074a97a.
  • Loading branch information
edmundmiller committed Jul 15, 2024
1 parent c8038f7 commit 2d969a4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
22 changes: 22 additions & 0 deletions modules/nf-core/sentieon/bwamem/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand All @@ -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 \\
Expand All @@ -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
Expand Down
7 changes: 0 additions & 7 deletions modules/nf-core/sentieon/bwamem/tests/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2d969a4

Please sign in to comment.