|
1 | 1 | help([[
|
2 |
| -loads UFS Model prerequisites for MacOS clang/gcc ("gnu") |
| 2 | +loads UFS Model modules for MacOSX |
3 | 3 | ]])
|
4 |
| - |
5 |
| -prepend_path("MODULEPATH", "/Users/username/spack-stack/spack-stack-1.8.0/envs/ufs-srw-env/install/modulefiles/Core") |
| 4 | +-- Replace the stackpath below by the path of the local spack-stack environment build: |
| 5 | +local stackpath = "/Users/username/spack-stack/spack-stack-1.8.0/envs/ufs-srw-env" |
| 6 | +local modulepath = stackpath .. "/install/modulefiles/Core" |
| 7 | +prepend_path("MODULEPATH", modulepath) |
6 | 8 |
|
7 | 9 | stack_gnu_ver=os.getenv("stack_apple_clang_ver") or "15.0.0"
|
8 | 10 | load(pathJoin("stack-apple-clang", stack_gnu_ver))
|
9 | 11 |
|
10 |
| -stack_openmpi_ver=os.getenv("stack_openmpi_ver") or "5.0.3" |
| 12 | +stack_openmpi_ver=os.getenv("stack_openmpi_ver") or "4.1.6" |
11 | 13 | load(pathJoin("stack-openmpi", stack_openmpi_ver))
|
12 | 14 |
|
13 | 15 | cmake_ver=os.getenv("cmake_ver") or "3.27.9"
|
@@ -54,12 +56,17 @@ setenv("CMAKE_Fortran_COMPILER_ID", "GNU")
|
54 | 56 | osx_sysroot=os.getenv("OSX_SYSROOT")
|
55 | 57 | setenv("CMAKE_OSX_SYSROOT","OSX_SYSROOT")
|
56 | 58 |
|
57 |
| -setenv("CFLAGS"," -Wno-implicit-function-declaration ") |
58 | 59 |
|
59 |
| -if mode() == "load" then |
60 |
| - LmodMsgRaw([===[ |
61 |
| - Please export these env. variables after the module is successfully loaded: |
62 |
| - > export LDFLAGS+=" -L${libjpeg_turbo_ROOT}/lib -ljpeg -Wl,-rpath,$libjpeg_turbo_ROOT}/lib -L${jasper_ROOT}/lib -ljasper -Wl,-rpath,${jasper_ROOT}/lib -L${libpng_ROOT}/lib -lpng -Wl,-rpath,${libpng_ROOT}/lib " |
63 |
| - ]===]) |
| 60 | +local libjpeg_ROOT = os.getenv("libjpeg_turbo_ROOT") |
| 61 | +local jasper_ROOT = os.getenv("jasper_ROOT") |
| 62 | +local libpng_ROOT = os.getenv("libpng_ROOT") |
| 63 | +local ldflags0 = os.getenv("LDFLAGS") or "" |
| 64 | +local ldflags_add = " -Wl,-no_compact_unwind" |
| 65 | + |
| 66 | +if jasper_ROOT and libpng_ROOT and libjpeg_ROOT then |
| 67 | + local ldflags1 = " -L" .. libjpeg_ROOT .. "/lib -ljpeg -Wl,-rpath," .. libjpeg_ROOT .. "/lib" |
| 68 | + local ldflags2 = " -L" .. jasper_ROOT .. "/lib -ljasper -Wl,-rpath," .. jasper_ROOT .. "/lib" |
| 69 | + local ldflags3 = " -L" .. libpng_ROOT .. "/lib -lpng -Wl,-rpath," .. libpng_ROOT .. "/lib" |
| 70 | + local ldflags = ldflags0 .. ldflags_add .. ldflags1 .. ldflags2 .. ldflags3 |
| 71 | + setenv("LDFLAGS", ldflags) |
64 | 72 | end
|
65 |
| -whatis("Description: UFS build environment") |
|
0 commit comments