1
1
#! /bin/bash
2
2
#
3
3
# Dec 15, 2015 mjames@ucar Created
4
- # Sep 13, 2016 mjames@ucar Updated for 16.2.2 using awips2-ncep/viz/gov.noaa.nws.ncep.ui.nsharp
4
+ # Sep 13, 2016 mjames@ucar Updated for 16.2.2
5
5
#
6
- # 1. Create a Java project and source folder....
7
- #
8
- # 2. Configure build path (see M. Li's lecture note):
9
- # Right click the working project -> Build Path -> Configure build path
10
- # -> Libraries -> Add JARs -> com.sun.jna – jna.jar
11
- #
12
- # 3. cp /usr/lib/gcc/i386-redhat-linux/3.4.6/libg2c.so locally, e.g.,
13
- # $AWIPS2/tools/lib and make myLinkFlags to contain -L$AWIPS2/tools/lib
14
- #
15
- # 4. Use this script to create a shared library (.so)
16
- #
17
- # 5. Deploy the SL and add the path, e.g., AWIPS2/lib, to LD_LIBRARY_PATH
18
- # (in ~/.alias)
6
+ # awips2-ncep/viz/gov.noaa.nws.ncep.ui.nsharp
7
+ # awips2-ncep/viz/gov.noaa.nws.ncep.ui.nsharp.macosx
19
8
#
20
9
. ~ /gempak/Gemenviron.profile
21
10
export NSHARP=$GEMPAK /source/programs/gui/nsharp
@@ -28,8 +17,6 @@ echo "OS_INC = $OS_INC"
28
17
echo " OS_LIB = $OS_LIB "
29
18
echo " GEMPAK = $GEMPAK "
30
19
echo " NWX = $NWX "
31
- cd /Users/mj/awips2-gemlibs/nsharp
32
- echo " working in " ` pwd`
33
20
34
21
# check that libraries exist
35
22
libs=(snlist sflist nxmlib gemlib gplt cgemlib rsl device xwp xw ps gn nsharp netcdf textlib)
44
31
fi
45
32
done
46
33
47
- # rm -rf *.o glibnsharp.so Sndglib/*.o
48
-
49
- # -L/usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/ is for -lgfortran
50
-
51
- # myLinktail=" \
52
- # $OS_LIB/ginitp_alt.o $OS_LIB/gendp_alt.o -lnxmlib \
53
- # -lsndg -lsnlist -lsflist -lgemlib -lgplt -lcgemlib -ldevice -lxwp -lxw -lps -lgn -lnsharp -lgemlib -lrsl -lnetcdf \
54
- # -ltextlib -lxml2 -lxslt -liconv -lbz2 -lhdf5 -lgfortran -ljasper -lpng -liconv -lc -lXt -lX11 -lz -lm"
55
-
56
- #
57
34
# Set C flags. Include necessary *.h files from application and library functions, e.g., diaglib/dg/*.h
58
35
# gdlist/gdlist.h for gdldsp.c. Note that diaglib/dg/*.h has layers of *.h, de.h, dl.h, df.h, dv.h.
59
- #
60
- # We need to compile here, not link.
61
36
62
37
myLibs=" $OS_LIB /ginitp_alt.o $OS_LIB /gendp_alt.o"
63
38
@@ -70,29 +45,26 @@ myFflags="-I. -I$OS_INC -I$GEMPAK/include -I$NSHARP -fPIC -g -c -fno-second-unde
70
45
myLinkflags=" -L/usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/ -L/opt/local/lib -L$OS_LIB -L. -L./Sndglib -L/usr/X11R6/lib \
71
46
-shared -Wl -Wcomment -Wincompatible-pointer-types -Wimplicit-function-declaration -Wno-return-type,-install_name,libbignsharp.dylib -o libbignsharp.dylib"
72
47
73
- # INCLUDE
74
48
myLibsInc=" $OS_LIB /ginitp_alt.o $OS_LIB /gendp_alt.o $OS_LIB /libnxmlib.a $OS_LIB /libsnlist.a \
75
49
$OS_LIB /libsflist.a $OS_LIB /libgemlib.a $OS_LIB /libcgemlib.a $OS_LIB /libgplt.a $OS_LIB /libdevice.a \
76
50
$OS_LIB /libxwp.a $OS_LIB /libxw.a $OS_LIB /libps.a $OS_LIB /libgn.a $OS_LIB /libcgemlib.a $OS_LIB /libgemlib.a \
77
51
$OS_LIB /libnetcdf.a $OS_LIB /libtextlib.a $OS_LIB /libxml2.a $OS_LIB /libxslt.a \
78
52
$OS_LIB /libgemlib.a $OS_LIB /libcgemlib.a $OS_LIB /librsl.a $OS_LIB /libbz2.a"
79
53
80
- # TAIL
81
54
myLinktail=" -I$OS_INC \
82
55
-I$GEMPAK /include -I$NWX -I$NSHARP -I. -I./Sndglib -I/opt/X11/include/X11 -I/usr/include -I/usr/include/Xm -I/opt/local/include/ -I/opt/local/include -lhdf5 -lgfortran -ljasper -lpng -liconv -lc -lXt -lX11 -lz -lm -lXm"
83
- # # RUN
56
+
84
57
$CC $myCflags * .c Sndglib/* .c
85
58
$FC $myFflags * .f
86
59
$CC $myLinkflags * .o $myLibsInc $myLinktail
87
60
88
-
89
61
echo " "
90
62
echo " $CC $myCflags *.c Sndglib/*.c"
91
63
echo " "
92
64
echo " $FC $myFflags *.f"
93
65
echo " "
94
66
echo " $CC $myLinkflags *.o $myLibsInc $myLinktail "
95
- pwd
96
- cp libbignsharp.dylib ~ /awips2-ncep/viz/gov.noaa.nws.ncep.ui.nsharp.macosx/
67
+
68
+ # cp libbignsharp.dylib ~/awips2-ncep/viz/gov.noaa.nws.ncep.ui.nsharp.macosx/
97
69
98
70
exit
0 commit comments