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

Third party libraries for Casper #3606

Merged
merged 8 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
39 changes: 27 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ anchors:
- &macx86libAWS "2023-Jun-macOSx86.tar.xz"
- &macArm64libAWS "2023-Sept-M1.tar.xz"
- &u20libAWS "2023-Sept-Ubuntu20.tar.xz"
- &srcLibAWS "2023-Sept-src.tar.xz"

version: 2.1

Expand All @@ -35,22 +36,25 @@ commands:
sudo:
type: string
default: ""
dir:
type: string
default: "/usr/local/VAPOR-Deps"
steps:
- run:
name: get third party libraries
command: |
# if /usr/local/VAPOR-Deps is empty, acquire libraries
if [ ! -d /usr/local/VAPOR-Deps ]; then
<<parameters.sudo>> mkdir -p /usr/local/VAPOR-Deps
<<parameters.sudo>> chmod -R 777 /usr/local/VAPOR-Deps
<<parameters.sudo>> chown -R `whoami` /usr/local/VAPOR-Deps
if [ ! -d <<parameters.dir>> ]; then
<<parameters.sudo>> mkdir -p <<parameters.dir>>
<<parameters.sudo>> chmod -R 777 <<parameters.dir>>
<<parameters.sudo>> chown -R `whoami` <<parameters.dir>>
if <<parameters.useAWS>> ; then
wget https://vaporawsbucket.s3.us-west-2.amazonaws.com/<<parameters.fileName>>
else
id=<<parameters.driveID>>
gdown https://drive.google.com/uc?id=${id}
fi
tar -xf <<parameters.fileName>> -C /usr/local/VAPOR-Deps
tar -xf <<parameters.fileName>> -C <<parameters.dir>>
fi

build_vapor:
Expand All @@ -66,12 +70,17 @@ commands:
default: ""
moveToCommand:
type: string
libDir:
type: string
default: "/usr/local/VAPOR-Deps"
libName:
type: string
default: 2023-Sept
steps:
- run:
name: build vapor
command: |
libraryDir=`ls /usr/local/VAPOR-Deps`
ln -s $libraryDir /usr/local/VAPOR-Deps/current
ln -s <<parameters.libDir>>/<<parameters.libName>> <<parameters.libDir>>/current
cp site_files/site.NCAR site.local
mkdir -p build
cd build
Expand All @@ -81,7 +90,8 @@ commands:
-DCMAKE_BUILD_TYPE:String=Release \
-DDIST_INSTALLER:string=ON \
-DUSE_OMP=ON \
<<parameters.compileArgs>> ..
<<parameters.compileArgs>> \
-DTHIRD_PARTY_DIR=<<parameters.libDir>>/current ..
make -j4
make installer
for f in VAPOR3-* ; do mv "$f" "<<parameters.moveToCommand>>" ; done
Expand Down Expand Up @@ -263,6 +273,7 @@ jobs:
-DCMAKE_C_COMPILER=clang \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DBUILD_OSP=OFF \
libName: 2023-Jun
moveToCommand: ${f/Darwin/DarwinM1}

#- run:
Expand Down Expand Up @@ -728,20 +739,24 @@ jobs:
bzip2 \
make \
which \
git
git \
wget

- get_libraries:
fileName: 2023-Sept-src.tar.xz
driveID: *srcLibID
driveID: *srcLibAWS
dir: /glade/campaign/cisl/vast/vapor/third-party

- run:
name: build libraries
command: |
chmod 777 /root/project/scripts/build3rdParty.sh
/root/project/scripts/build3rdParty.sh -o suse
/root/project/scripts/build3rdParty.sh -o suse -b /glade/campaign/cisl/vast/vapor/third-party/

- build_vapor:
moveToCommand: ${f/Linux/Ubuntu20}
moveToCommand: ${f/Linux/SUSE}
libDir: /glade/campaign/cisl/vast/vapor/third-party
libName: 2024-Apr

- store_artifacts:
path: |
Expand Down
29 changes: 20 additions & 9 deletions scripts/build3rdParty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,31 @@

set -e

while getopts o:b:i flag
do
while getopts "o:b:" flag; do
case "${flag}" in
b) srcDir=${OPTARG};;
i) installDir=${OPTARG};;
o) OS=${OPTARG};;
b) baseDir=${OPTARG};;
esac
done

#OS="CentOS"
baseDir='/usr/local/VAPOR-Deps'
if [ -z "$OS" ]; then
echo "Error: -o flag is required to specify the target operating system [suse, maxOSx86, M1, CentOS, Ubuntu]"
exit 1
fi

if [ -z "$baseDir" ]; then
echo "No -b (base directory) option given. Defaulting to /usr/local/VAPOR-Deps"
baseDir='/usr/local/VAPOR-Deps'
fi
#baseDir='/glade/campaign/cisl/vast/vapor/third-party'

if [ "$OS" != "suse" ]; then
srcDir="$baseDir/2023-Jun-src"
archiveName="2023-Jun"
else
srcDir="$baseDir/2023-Sept-src"
archiveName="2023-Sept"
archiveName="2024-Apr"
fi
echo srcDir $srcDir
echo OS ${OS}

installDir="$baseDir/current"
getMacOSMinVersion() {
Expand All @@ -39,6 +44,12 @@ getMacOSMinVersion() {
echo "12.0.0"
fi
}

echo OS ${OS}
echo baseDir $baseDir
echo srcDir $srcDir
echo installDir $installDir

macOSMinVersion=$(getMacOSMinVersion)

shopt -s expand_aliases
Expand Down