NCAR / ncl

The NCAR Command Language (NCL) is a scripting language for the analysis and visualization of climate and weather data.
http://www.ncl.ucar.edu
Other
268 stars 65 forks source link

Autotools build system for NCL #4

Open edhartnett opened 6 years ago

edhartnett commented 6 years ago

It would be nice if NCL had an autotools based build system. ;-)

@marylhaley and I have been discussing in email, but I am transferring the discussion here so that the info is in one place.

The initial goals are:

khallock commented 6 years ago

Hi @edhartnett,

Thanks for working on this! We really appreciate your effort!

I merged your pull request into a new autotools branch and will take a closer look at it soon.

Please feel free to ping us with updates on this page or just create new pull requests (based on the new NCAR:autotools branch) with additional commits as needed.

edhartnett commented 6 years ago

Here's something in the build that is not currently working (it is commented out).

When building in ncarg23d/src/bin/ezmapdemo I get the following link error. Where can these functions be found?

/bin/bash ../../../../libtool  --tag=F77   --mode=link f77  -g -O2  -L/usr/local/hdfeos/lib -L/usr/local/hdf-4.2.13/lib -o ezmapdemo EzmapDemo.o ../../../../ncarg2d/src/libncarg/libncarg.la ../../../../ncarg2d/src/libncarg_gks/libncarg_gks.la ../../../../common/src/libncarg_c/libncarg_c.la -lgdal -lproj -lgrib2c -ljasper -lGctp -lmfhdf -ldf -ludunits2 -lpixman-1 -lfreetype -lpng -lcairo -lz -ljpeg -lnetcdf -lm -lXext -lX11 
libtool: link: f77 -g -O2 -o .libs/ezmapdemo EzmapDemo.o  -L/usr/local/hdfeos/lib -L/usr/local/hdf-4.2.13/lib ../../../../ncarg2d/src/libncarg/.libs/libncarg.so ../../../../ncarg2d/src/libncarg_gks/.libs/libncarg_gks.so ../../../../common/src/libncarg_c/.libs/libncarg_c.so -lgdal /usr/lib/x86_64-linux-gnu/libproj.so -lgrib2c -ljasper /usr/local/hdfeos/lib/libGctp.a /usr/local/hdf-4.2.13/lib/libmfhdf.so /usr/local/hdf-4.2.13/lib/libdf.so -ludunits2 -lpixman-1 /usr/lib/x86_64-linux-gnu/libfreetype.so -lpng -lcairo -lz -ljpeg -lnetcdf -lm -lXext -lX11 -Wl,-rpath -Wl,/home/ed/local/ncarg/lib -Wl,-rpath -Wl,/usr/local/hdf-4.2.13/lib
EzmapDemo.o: In function `MAIN__':
/home/ed/tmp/ncl/ncarg2d/src/bin/ezmapdemo/EzmapDemo.f:2615: undefined reference to `arinam_'
/home/ed/tmp/ncl/ncarg2d/src/bin/ezmapdemo/EzmapDemo.f:2620: undefined reference to `arscam_'
/home/ed/tmp/ncl/ncarg2d/src/bin/ezmapdemo/EzmapDemo.f:522: undefined reference to `arinam_'
/home/ed/tmp/ncl/ncarg2d/src/bin/ezmapdemo/EzmapDemo.f:2780: undefined reference to `argtai_'
/home/ed/tmp/ncl/ncarg2d/src/bin/ezmapdemo/EzmapDemo.f:555: undefined reference to `arinam_'
/home/ed/tmp/ncl/ncarg2d/src/bin/ezmapdemo/EzmapDemo.f:559: undefined reference to `arscam_'
EzmapDemo.o: In function `igetai_':
/home/ed/tmp/ncl/ncarg2d/src/bin/ezmapdemo/EzmapDemo.f:4453: undefined reference to `argtai_'
EzmapDemo.o: In function `MAIN__':
/home/ed/tmp/ncl/ncarg2d/src/bin/ezmapdemo/EzmapDemo.f:530: undefined reference to `arscam_'
EzmapDemo.o: In function `igetai_':
/home/ed/tmp/ncl/ncarg2d/src/bin/ezmapdemo/EzmapDemo.f:4453: undefined reference to `argtai_'
EzmapDemo.o: In function `MAIN__':
/home/ed/tmp/ncl/ncarg2d/src/bin/ezmapdemo/EzmapDemo.f:2632: undefined reference to `arinam_'
/home/ed/tmp/ncl/ncarg2d/src/bin/ezmapdemo/EzmapDemo.f:2634: undefined reference to `arscam_'
EzmapDemo.o: In function `igetai_':
/home/ed/tmp/ncl/ncarg2d/src/bin/ezmapdemo/EzmapDemo.f:4453: undefined reference to `argtai_'
../../../../ncarg2d/src/libncarg_gks/.libs/libncarg_gks.so: undefined reference to `lstwks_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `gcell_array'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `pcfcls_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `argetr_'
../../../../ncarg2d/src/libncarg_gks/.libs/libncarg_gks.so: undefined reference to `wrtwks_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `openpw_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `pcfred_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `arseti_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `ardbpa_'
../../../../ncarg2d/src/libncarg_gks/.libs/libncarg_gks.so: undefined reference to `rdwks_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `curvs1_'
../../../../ncarg2d/src/libncarg_gks/.libs/libncarg_gks.so: undefined reference to `ggkwdr_'
../../../../ncarg2d/src/libncarg_gks/.libs/libncarg_gks.so: undefined reference to `flswks_'
../../../../ncarg2d/src/libncarg_gks/.libs/libncarg_gks.so: undefined reference to `begwks_'
../../../../ncarg2d/src/libncarg_gks/.libs/libncarg_gks.so: undefined reference to `delfil_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `arrat2_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `ardrln_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `veldat_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `curvs2_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `armvam_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `pcfopn_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `aredam_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `mangle_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `arpram_'
../../../../ncarg2d/src/libncarg_gks/.libs/libncarg_gks.so: undefined reference to `gzgids_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `arsetr_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `argeti_'
../../../../ncarg2d/src/libncarg/.libs/libncarg.so: undefined reference to `mpdbdi_'
../../../../ncarg2d/src/libncarg_gks/.libs/libncarg_gks.so: undefined reference to `clswks_'
../../../../ncarg2d/src/libncarg_gks/.libs/libncarg_gks.so: undefined reference to `opnwks_'
collect2: error: ld returned 1 exit status
Makefile:394: recipe for target 'ezmapdemo' failed
make: *** [ezmapdemo] Error 1
ed@mikado:~/tmp/ncl/ncarg2d/src/bin/ezmapdemo$ 
edhartnett commented 6 years ago

Also what is going on with man pages in NCL? Here's some commands that the current build uses to install man pages. What is going on? What does ymake-install do here?

I would have expected the man page to be copied to the correct place, and then mandb run after all man pages are installed...

ed@mikado:~/tmp/master_ncl/ncarg2d/man/areas$ make install
if (test ! -d /home/ed/local/ncarg/man/man3); then (mkdir -p /home/ed/local/ncarg/man/man3); fi
for file in ardbpa ardrln areas areas_params aredam argeti argetr argtai arinam     armvam arpram arscam arseti arsetr; do \
echo "Installing ${file}.3"; \
../../.././config/ymake-install -c -m 0644 ${file}.m /home/ed/local/ncarg/man/man3/${file}.3;\
done
Installing ardbpa.3
Installing ardrln.3
Installing areas.3
Installing areas_params.3
Installing aredam.3
Installing argeti.3
Installing argetr.3
Installing argtai.3
Installing arinam.3
Installing armvam.3
Installing arpram.3
Installing arscam.3
Installing arseti.3
Installing arsetr.3
installing in ./ncarg2d/man/areas
rbrownrigg commented 6 years ago

Hi Ed,

Regarding the link errors, those undefined references are an assortment of routines that come the libncarg/libncarg_gks/libncargc libraries; for example all the files starting with "a" are coming from libncarg/areas, the delfil reference is coming from libncarg_gks/bwi, etc. I see you have references to the ".so"s in the link line (I am unfamiliar with libtool's use of the .la files?).

I don't know what's going on with the man pages -- I'll look into that.

Rick

On Wed, Sep 5, 2018 at 6:33 AM, Ed Hartnett notifications@github.com wrote:

Also what is going on with man pages in NCL? Here's some commands that the current build uses to install man pages. What is going on? What does ymake-install do here?

I would have expected the man page to be copied to the correct place, and then mandb run after all man pages are installed...

ed@mikado:~/tmp/master_ncl/ncarg2d/man/areas$ make install if (test ! -d /home/ed/local/ncarg/man/man3); then (mkdir -p /home/ed/local/ncarg/man/man3); fi for file in ardbpa ardrln areas areas_params aredam argeti argetr argtai arinam armvam arpram arscam arseti arsetr; do \ echo "Installing ${file}.3"; \ ../../.././config/ymake-install -c -m 0644 ${file}.m /home/ed/local/ncarg/man/man3/${file}.3;\ done Installing ardbpa.3 Installing ardrln.3 Installing areas.3 Installing areas_params.3 Installing aredam.3 Installing argeti.3 Installing argetr.3 Installing argtai.3 Installing arinam.3 Installing armvam.3 Installing arpram.3 Installing arscam.3 Installing arseti.3 Installing arsetr.3 installing in ./ncarg2d/man/areas

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NCAR/ncl/issues/4#issuecomment-418713324, or mute the thread https://github.com/notifications/unsubscribe-auth/ANdnXjgR6LfKo7eOk_LxAWMCB7oBe37iks5uX8SAgaJpZM4WZNbm .

edhartnett commented 6 years ago

I have resolved the issues mentioned above. There are some data location issues that are still being worked on.