Skip to content

Commit adb03a3

Browse files
committed
Added a simple sh-script showing how to build dae-cpp static library and then build and run examples without cmake.
1 parent 5db1317 commit adb03a3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

build_static_lib.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Build a static library:
4+
mkdir build_static_lib
5+
cd build_static_lib
6+
g++ -c -O3 -Wall -std=c++11 -m64 -fopenmp ../src/*.cpp -I/opt/intel/mkl/include -I../src -I../src/external
7+
ar rcs libdaecpp.a *.o
8+
rm *.o
9+
10+
# Compile examples
11+
g++ -O3 -Wall -std=c++11 -m64 -fopenmp ../examples/perovskite/*.cpp -o perovskite -I/opt/intel/mkl/include -I../examples/perovskite -I../src -I../src/external -L/opt/intel/mkl/lib/intel64 -L. -ldaecpp -Wl,--no-as-needed -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl
12+
g++ -O3 -Wall -std=c++11 -m64 -fopenmp ../examples/diffusion_2d/*.cpp -o diffusion_2d -I/opt/intel/mkl/include -I../examples/diffusion_2d -I../src -I../src/external -L/opt/intel/mkl/lib/intel64 -L. -ldaecpp -Wl,--no-as-needed -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl
13+
g++ -O3 -Wall -std=c++11 -m64 -fopenmp ../examples/robertson/*.cpp -o robertson -I/opt/intel/mkl/include -I../examples/robertson -I../src -I../src/external -L/opt/intel/mkl/lib/intel64 -L. -ldaecpp -Wl,--no-as-needed -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl
14+
15+
echo 'How to run an example using 4 cores:'
16+
echo 'cd build_static_lib/'
17+
echo 'source ../set_MKL_env'
18+
echo 'OMP_NUM_THREADS=4 ./perovskite'

0 commit comments

Comments
 (0)