Skip to content

Commit

Permalink
Merge pull request #163 from AcademySoftwareFoundation/build-script-t…
Browse files Browse the repository at this point in the history
…weaks

Build script tweaks
  • Loading branch information
garyo authored Jul 12, 2024
2 parents b772313 + 2c1f77c commit 12df505
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ jobs:
if: matrix.ostype == 'mac'
with:
python-version: '3.11'
cache: 'pip'

- name: Install Conan
id: conan
Expand Down Expand Up @@ -216,16 +215,14 @@ jobs:
linux-local-args: '["--toolkit"]'

- name: Install CUDA Toolkit
uses: Jimver/[email protected].14
uses: Jimver/[email protected].16
id: cuda-toolkit-win
if: matrix.ostype == 'windows' && matrix.cuda == true
with:
cuda: '12.1.0'
# Need CUDA >= 12.4 to support recent VS2022 (17.10 and later, MSVC 19.40)
cuda: '12.4.1'
method: 'network'
sub-packages: '["nvcc", "cudart"]'
# workaround for cuda-toolkit action bug https://github.com/Jimver/cuda-toolkit/issues/315
use-github-cache: false
use-local-cache: false

# - name: Install system dependencies (CentOS)
# run: |
Expand Down
35 changes: 34 additions & 1 deletion scripts/build-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,39 @@ else
exit 1
fi

if [[ ! -f ./conanfile.py ]]; then
echo "***"
echo "*** ERROR: please run this script from the top level dir, where conanfile.py and readme.md are."
echo "***"
exit 1
fi


# Ensure standard plugin install folder exists and is writable, unless user is
# building with a custom plugin install dir.
if [[ ! $ARGS =~ .*PLUGIN_INSTALLDIR.* ]] ; then
if [[ -n $COMMONPROGRAMFILES && -d $COMMONPROGRAMFILES ]]; then
INSTALLDIR="$COMMONPROGRAMFILES/OFX/Plugins"
elif [[ $(uname) = Darwin ]]; then
INSTALLDIR="/Library/OFX/Plugins"
else
INSTALLDIR="/usr/OFX/Plugins"
fi
# Try to create the plugin dir; this may fail due to permissions.
# We need it to exist and to be writable.
mkdir -p "$INSTALLDIR"
if [[ $? -ne 0 || ! -w $INSTALLDIR ]]; then
echo "***"
echo "*** ERROR: This script will install the built example plugins in $INSTALLDIR,"
echo "*** but that dir does not exist or isn't writable."
echo "*** Please run: sudo mkdir -p $INSTALLDIR && sudo chmod ugo+w $INSTALLDIR"
echo "*** or run this script with -DPLUGIN_INSTALL_DIR=<some dir> to install elsewhere."
echo "***"
exit 1
fi
fi


# Install dependencies, set up build dir, and generate build files.
echo === Running conan to install dependencies
[[ $USE_OPENCL ]] && conan_opts="$conan_opts -o use_opencl=True"
Expand All @@ -99,4 +132,4 @@ echo " Plugin support lib and examples are in ${CMAKE_BUILD_DIR}/Support/{Libra
echo " Host lib is in ${CMAKE_BUILD_DIR}/HostSupport/${BUILDTYPE}"
echo "=== To (re)install the sample plugins to your OFX plugins folder, become root if necessary, and then do:"
echo " cmake --install ${CMAKE_BUILD_DIR}"
echo " (pass -DINSTALLDIR=<path> to this script or cmake to install elsewhere than the standard OFX folder)"
echo " (pass -DPLUGIN_INSTALLDIR=<path> to this script or cmake to install elsewhere than the standard OFX folder)"

0 comments on commit 12df505

Please sign in to comment.