Skip to content

Commit

Permalink
add comments to nightly build script for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Sep 17, 2023
1 parent d2a2ae3 commit 5b8a06f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 13 deletions.
55 changes: 43 additions & 12 deletions deploy/buildmcx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#
###############################################################################

## setting up environment

BUILD='nightly'
LAZMAC=

Expand All @@ -48,13 +50,17 @@ fi

TAG=${OS}-${MACHINE}-${BUILD}

SERVER=
REMOTEPATH=

if [ "$BUILD" == "nightly" ]; then
TAG=${OS}-${MACHINE}-${BUILD}build
fi

## setting up upload server (blank if no need to upload)

SERVER=
REMOTEPATH=

## checking out latest github code

export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/lib
export PATH=.:/opt/local/bin:/usr/local/cuda/bin/:$PATH

Expand All @@ -65,6 +71,8 @@ rm -rf mcx
mkdir -p mcx/mcx
git clone --recurse-submodules https://github.com/fangq/mcx.git mcx/mcx

## automatically update revision/version number

cat <<EOF >>mcx/mcx/.git/config
[filter "rcs-keywords"]
clean = .git_filters/rcs-keywords.clean
Expand All @@ -81,6 +89,8 @@ rm -rf *
git checkout .
git submodule update --init --remote

## zip and upload source code package

rm -rf .git
cd ..
zip -FSr $BUILDROOT/mcx-src-${BUILD}.zip mcx
Expand All @@ -90,6 +100,8 @@ fi
cd mcx
cd src

## build matlab mex file

rm -rf ../mcxlab/AUTO_BUILD_*
make clean
make mex &>../mcxlab/AUTO_BUILD_${DATE}.log
Expand All @@ -100,19 +112,19 @@ elif [ "$OS" == "macos" ]; then
make mex MEXLINKOPT='/usr/local/lib/libomp.a' >>../mcxlab/AUTO_BUILD_${DATE}.log 2>&1
elif [ "$OS" == "win" ]; then
cmd /c mex mcx_core.obj mcx_utils.obj mcx_shapes.obj mcx_tictoc.obj mcx_mie.obj mcx_bench.obj cjson/cJSON.obj -output ../mcxlab/mcx -L"E:\Applications\CUDA7.5\CUDA7.5/lib/x64" -lcudadevrt -lcudart_static CXXFLAGS='$CXXFLAGS -g -DSAVE_DETECTORS -DUSE_CACHEBOX -DMCX_CONTAINER /openmp ' LDFLAGS='-L$TMW_ROOT$MATLABROOT/sys/os/$ARCH $LDFLAGS /openmp ' mcxlab.cpp -outdir ../mcxlab -I/usr/local/cuda/include -I"E:\Applications\CUDA7.5\CUDA7.5/lib/include" -DUSE_XORSHIFT128P_RAND
echo "Windows mcx build"
cd ../mcxlab
upx -9 mcx.mexw64
cd ../src
fi

## build octave mex file

make clean
make oct >>../mcxlab/AUTO_BUILD_${DATE}.log 2>&1

if [ "$OS" == "linux" ]; then
make oct BACKEND=cudastatic >>../mcxlab/AUTO_BUILD_${DATE}.log 2>&1
fi

## test mex file dependencies

mexfile=(../mcxlab/mcx.mex*)

if [ -e "${mexfile[0]}" ]; then
Expand All @@ -128,22 +140,32 @@ else
echo "Build Failed" >>../mcxlab/AUTO_BUILD_${DATE}.log
fi

## compress mex files with upx

upx -9 ../mcxlab/mcx.mex* || true

## zip and upload mex package

if [ "$BUILD" != "nightly" ]; then
rm -rf ../mcxlab/AUTO_BUILD_${DATE}.log
fi

rm -rf ../mcxlab/mcxlab.o ../mcxlab/mcxlab.obj

## compile denoising filter mex for matlab

cd ../filter/src
make clean


if [ "$OS" == "osx" ]
then
make BACKEND=cudastatic GCC=cc
else
make BACKEND=cudastatic
fi

## zip and upload mex package

mexfile=(../bin/mcxfilter.mex*)

Expand All @@ -166,6 +188,8 @@ cd src

[ ! -z "$SERVER" ] && scp $BUILDROOT/mcxlab-${TAG}.zip $SERVER:$REMOTEPATH/${OS}64/

## compile standalone binary/executable

make clean

if [ "$OS" == "linux" ]; then
Expand All @@ -176,6 +200,8 @@ else
make static &>$BUILDROOT/mcx_buildlog_${DATE}.log
fi

## test binary dependencies

if [ -f "../bin/mcx" ]; then
if [ "$OS" == "macos" ]; then
otool -L ../bin/mcx >>$BUILDROOT/mcx_buildlog_${DATE}.log
Expand All @@ -190,6 +216,8 @@ else
exit 1
fi

## build mcxstudio GUI with lazarus-ide

cd ../mcxstudio
lazbuild --build-mode=release ${LAZMAC} mcxshow.lpi
lazbuild --build-mode=release ${LAZMAC} mcxviewer.lpi
Expand All @@ -199,6 +227,8 @@ cp mcxshow ../bin
cp mcxviewer ../bin
cp README.txt ../inno/MCXStudio_README.txt

## copy MacOS app files

if [ "$OS" == "macos" ]; then
cp -a debug/mcxstudio.app ../bin
cp -a mcxshow.app ../bin
Expand All @@ -215,13 +245,14 @@ cd ../bin

cp $BUILDROOT/bindlls/*.dll .

## compress binary with upx

upx -9 *.exe *.dll || true

## zip and upload binary package

if [ "$OS" == "win" ]; then
upx -9 *.exe
rm -rf mcx.exp mcx.lib
elif [ "$OS" == "linux" ]; then
upx -9 mcx*
else
echo "no compression on Mac"
fi

cd ../
Expand Down
2 changes: 1 addition & 1 deletion src/pybind11
Submodule pybind11 updated 79 files
+65 −61 .clang-tidy
+5 −3 .github/CONTRIBUTING.md
+0 −4 .github/dependabot.yml
+40 −23 .github/workflows/ci.yml
+1 −1 .github/workflows/configure.yml
+6 −4 .github/workflows/format.yml
+7 −5 .github/workflows/pip.yml
+3 −3 .github/workflows/upstream.yml
+14 −11 .pre-commit-config.yaml
+13 −0 CMakeLists.txt
+3 −0 docs/_static/css/custom.css
+0 −11 docs/_static/theme_overrides.css
+2 −2 docs/advanced/cast/custom.rst
+3 −3 docs/advanced/cast/stl.rst
+2 −2 docs/advanced/classes.rst
+2 −2 docs/advanced/pycpp/numpy.rst
+1 −1 docs/advanced/smart_ptrs.rst
+160 −12 docs/changelog.rst
+1 −1 docs/classes.rst
+6 −17 docs/conf.py
+ docs/pybind11-logo.png
+4 −3 docs/requirements.txt
+5 −3 include/pybind11/attr.h
+5 −5 include/pybind11/cast.h
+23 −30 include/pybind11/detail/class.h
+21 −2 include/pybind11/detail/common.h
+1 −1 include/pybind11/detail/init.h
+1 −0 include/pybind11/detail/internals.h
+0 −66 include/pybind11/detail/type_caster_base.h
+9 −3 include/pybind11/detail/typeid.h
+17 −6 include/pybind11/eigen.h
+56 −32 include/pybind11/embed.h
+2 −2 include/pybind11/functional.h
+1 −1 include/pybind11/iostream.h
+19 −8 include/pybind11/numpy.h
+44 −26 include/pybind11/pybind11.h
+338 −64 include/pybind11/pytypes.h
+6 −6 include/pybind11/stl.h
+16 −6 noxfile.py
+2 −1 pybind11/__init__.py
+8 −1 pybind11/__main__.py
+1 −1 pybind11/_version.py
+12 −0 pybind11/commands.py
+2 −1 setup.cfg
+1 −0 setup.py
+1 −0 tests/CMakeLists.txt
+14 −1 tests/conftest.py
+51 −0 tests/cross_module_interleaved_error_already_set.cpp
+68 −58 tests/extra_python_package/test_files.py
+25 −0 tests/pybind11_tests.cpp
+1 −1 tests/requirements.txt
+8 −2 tests/test_builtin_casters.cpp
+2 −2 tests/test_constants_and_functions.cpp
+7 −7 tests/test_custom_type_casters.cpp
+5 −2 tests/test_eigen.cpp
+7 −0 tests/test_eigen.py
+1 −1 tests/test_embed/CMakeLists.txt
+47 −2 tests/test_exceptions.cpp
+99 −3 tests/test_exceptions.py
+10 −1 tests/test_kwargs_and_defaults.cpp
+21 −9 tests/test_methods_and_attributes.py
+2 −0 tests/test_modules.cpp
+30 −0 tests/test_modules.py
+1 −1 tests/test_numpy_array.cpp
+1 −1 tests/test_numpy_dtypes.cpp
+1 −1 tests/test_numpy_vectorize.cpp
+183 −0 tests/test_pytypes.cpp
+129 −0 tests/test_pytypes.py
+2 −2 tests/test_smart_ptr.cpp
+15 −8 tests/test_stl.cpp
+2 −2 tests/test_tagbased_polymorphic.cpp
+2 −3 tests/test_virtual_functions.cpp
+21 −11 tools/FindPythonLibsNew.cmake
+23 −0 tools/JoinPaths.cmake
+7 −0 tools/pybind11.pc.in
+3 −1 tools/pybind11NewTools.cmake
+32 −11 tools/pybind11Tools.cmake
+2 −0 tools/setup_global.py.in
+2 −0 tools/setup_main.py.in

0 comments on commit 5b8a06f

Please sign in to comment.