Skip to content

Commit

Permalink
Fix issue where fparse-llvm can't find plugin so lib
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeekman committed Dec 16, 2024
1 parent 9ee13c8 commit eea9850
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/fparse-llvm.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,23 @@ set -o pipefail
#set -o verbose
#set -o xtrace

readonly _SALTFM_PLUGIN_SO=libsalt-flang-plugin.so
readonly _VERSION=@SALT_VERSION_MAJOR@.@SALT_VERSION_MINOR@
readonly _FORTRAN_CONFIG_FILE_BUILD=@CMAKE_SOURCE_DIR@/config_files/tau_config.yaml
readonly _FORTRAN_CONFIG_FILE_INSTALL=@SALT_CONFIGFILES_INSTALL_DIR@/tau_config.yaml
readonly _INSTALL_DEST=@CMAKE_INSTALL_PREFIX@
readonly _SALT_PLUGIN_SO_BUILD=@CMAKE_BINARY_DIR@/${_SALTFM_PLUGIN_SO}
readonly _SALT_PLUGIN_SO_INSTALL=@SALT_PLUGIN_INSTALL_DIR@/${_SALTFM_PLUGIN_SO}

# get the absolute path of this script
readonly _SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Check if the script is being run from the install directory
if [[ -f "${_SCRIPT_DIR}/$0" && "${_SCRIPT_DIR}" == ${_INSTALL_DEST}* ]]; then
FORTRAN_CONFIG_FILE="${_FORTRAN_CONFIG_FILE_INSTALL}"
SALT_PLUGIN_SO="${_SALT_PLUGIN_SO_INSTALL}"
else
FORTRAN_CONFIG_FILE="${_FORTRAN_CONFIG_FILE_BUILD}"
SALT_PLUGIN_SO="${_SALT_PLUGIN_SO_BUILD}"
fi

# Add a help/usage message function
Expand Down Expand Up @@ -146,7 +151,7 @@ echo "Remaining Arguments: ${args[*]}"
# This script invokes an LLVM flang frontend plugin to parse and instrument Fortran code
cmd=(flang-new
-fc1
-load ./libsalt-flang-plugin.so
-load "${SALT_PLUGIN_SO}"
-plugin salt-instrument
"${input_file}"
-o "${output_file}"
Expand Down

0 comments on commit eea9850

Please sign in to comment.