Skip to content

Commit

Permalink
[NEW] Init UNIX build script
Browse files Browse the repository at this point in the history
  • Loading branch information
miEsMar committed Dec 29, 2024
1 parent 8191651 commit d410bfe
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 7 deletions.
12 changes: 5 additions & 7 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
@echo off

setlocal
if not exist "build_cmake" mkdir "build_cmake"

set "cleanfirst=--clean-first"
set "cleanfirst="
set "builddir=build_cmake"
if not exist "%builddir%" mkdir "%builddir%"

rem -D CMAKE_BUILD_TYPE=Debug ^

Expand All @@ -16,12 +14,12 @@ cmake ^
-D enable-gpu-code=OFF ^
-D enable-cuda=ON ^
-D enable-gpu-double=OFF ^
-S . -B build_cmake %~1
-S . -B %builddir%
if not "%errorlevel%"=="0" exit /b 1

cmake --build build_cmake --config Debug %cleanfirst%
cmake --build %builddir% --config Debug %*
if not "%errorlevel%"=="0" exit /b 1

cmake --build build_cmake --config Release %cleanfirst%
cmake --build %builddir% --config Release %*
if not "%errorlevel%"=="0" exit /b 1
endlocal
48 changes: 48 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/sh
#

# Setup
builddir="build"
if [ ! -d ./${builddir} ]; then mkdir ${builddir}; fi


# CLI loop
gen_args=""
bld_args=""
while [ "$1" != "" ]
do
case "$1" in
-c | --clean)
bld_args="${bld_args}--clean-first "
;;
*)
gen_args="${gen_args}$1 "
esac
shift
done
echo ${gen_args}


# Generation
cmake \
${gen_args} \
-D CMAKE_Fortran_COMPILER=gfortran \
-D BUILD_SHARED_LIBS=OFF \
-D enable-openmp=ON \
-D enable-sym-ev-routine=OFF \
-D enable-single=OFF \
-D enable-gpu-code=OFF \
-D enable-cuda=ON \
-D enable-gpu-double=OFF \
-S . -B ${builddir}
if [ "$?" != "0" ]; then exit 1; fi


# Build
cmake --build ${builddir} --config Debug ${bld_args}
if [ "$?" != "0" ]; then exit 1; fi

cmake --build ${builddir} --config Release ${bld_args}
if [ "$?" != "0" ]; then exit 1; fi


0 comments on commit d410bfe

Please sign in to comment.