-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathmakeMac.sh
More file actions
62 lines (44 loc) · 1.67 KB
/
makeMac.sh
File metadata and controls
62 lines (44 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# NOTE if fail in nataf_gsa on Mac it is because clang still not working with omp, you need a brew install of libomp, issue:
# brew install libomp
# define the compilers
export CC=clang
export CXX=clang++
export CMAKE_ARGS=-DCMAKE_POLICY_VERSION_MINIMUM=3.5
#
# following is temp until conan2 fully tested
#
cp conanfile.py conanfile.py.ORIG
cp CMakeLists.txt CMakeLists.txt.ORIG
cp cmake/SimCenterFunctions.cmake ./cmake/SimCenterFunctions.cmake.ORIG
cp conanfile2.py conanfile.py
cp CMakeLists2.txt CMakeLists.txt
cp cmake/SimCenterFunctions2.cmake ./cmake/SimCenterFunctions.cmake
#
# run conan to install dependencies
#
conan install . --output-folder=build --build=missing
#
# run cmake to generate CMakefiles, then build & finally install
#
cmake -B build -DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build --prefix ./applications
#
# Bundle libomp.dylib with nataf_gsa so it runs without needing a brew install on user machine
#
NATAF_DIR="applications/performUQ/SimCenterUQ"
LIBOMP_DIR="$(brew --prefix libomp)/lib"
LIBOMP_SRC="${LIBOMP_DIR}/libomp.dylib"
if [ -f "${NATAF_DIR}/nataf_gsa" ] && [ -f "${LIBOMP_SRC}" ]; then
cp "${LIBOMP_SRC}" "${NATAF_DIR}/libomp.dylib"
install_name_tool -change "${LIBOMP_SRC}" "@executable_path/libomp.dylib" "${NATAF_DIR}/nataf_gsa"
echo "Bundled libomp.dylib into ${NATAF_DIR}"
else
echo "WARNING: nataf_gsa or libomp.dylib not found — skipping libomp bundling"
fi
#
# again temp until migration to conan2 complete
#
mv conanfile.py.ORIG conanfile.py
mv CMakeLists.txt.ORIG CMakeLists.txt
mv cmake/SimCenterFunctions.cmake.ORIG ./cmake/SimCenterFunctions.cmake