NOAA-EMC / NCEPLIBS

Top level repo containing submodules for NCEPLIBS and associated dependencies for superproject builds
Other
42 stars 18 forks source link

How to use -DDOWNLOAD_ONLY=ON to download source? #181

Closed pmspire closed 3 years ago

pmspire commented 3 years ago

Describe the bug I try to use -DDOWNLOAD_ONLY=ON as described in README.md to download the source code for the libraries, but the download directory thus created is a shallow hierarchy of empty directories, with no source files.

To Reproduce

~ % git clone --recursive https://github.com/NOAA-EMC/NCEPLIBS.git
Cloning into 'NCEPLIBS'...
remote: Enumerating objects: 117, done.
remote: Counting objects: 100% (117/117), done.
remote: Compressing objects: 100% (89/89), done.
remote: Total 9349 (delta 43), reused 69 (delta 22), pack-reused 9232
Receiving objects: 100% (9349/9349), 26.67 MiB | 18.30 MiB/s, done.
Resolving deltas: 100% (3170/3170), done.

~ % cd NCEPLIBS/

~/NCEPLIBS % git checkout v1.3.0
HEAD is now at f9d26ec Merge pull request #179 from NOAA-EMC/cleanup/prod_util-components

~/NCEPLIBS % cmake -DDOWNLOAD_ONLY=ON .
-- The C compiler identification is GNU 4.8.5
-- The Fortran compiler identification is GNU 4.8.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/gfortran - skipped
-- Checking whether /usr/bin/gfortran supports Fortran 90
-- Checking whether /usr/bin/gfortran supports Fortran 90 - yes
-- Setting build type to 'Release' as none was specified.
-- Installing NCEPLIBS from /users/PYS0343/pmadden/NCEPLIBS/COMPONENTS
-- Installing NCEPLIBS at /usr/local
-- Configuring done
-- Generating done
-- Build files have been written to: /users/PYS0343/pmadden/NCEPLIBS

~/NCEPLIBS % tree download/
download/
├── emc_crtm
├── emc_post
├── nceplibs-bacio
├── nceplibs-bufr
├── nceplibs-g2
├── nceplibs-g2c
├── nceplibs-g2tmpl
├── nceplibs-gfsio
├── nceplibs-ip
├── nceplibs-ip2
├── nceplibs-landsfcutil
├── nceplibs-nemsio
├── nceplibs-nemsiogfs
├── nceplibs-sfcio
├── nceplibs-sigio
├── nceplibs-sp
├── nceplibs-w3emc
├── nceplibs-w3nco
├── nceplibs-wgrib2
└── nceplibs-wrf_io

20 directories, 0 files

Expected behavior A download directory populated with source code.

Build Information See above.

System Linux (RHEL 7.7)

kgerheiser commented 3 years ago

Perhaps counterintuitive, but you need to run make tarball and it will start the download process (without building) and create a tarball in the main directory.

We can update the documentation to make this more clear.

We use ExternalProject_Add to do the download and it starts at build time when you run make instead of configure time when you run CMake.

pmspire commented 3 years ago

Thank you, @kgerheiser! I should have read further and realized that an extra step is necessary, instead of stopping short after examining the download directory. A slight tweak to the docs might help someone, but this one's on me.

pmspire commented 3 years ago

Pushing my luck a bit, do you happen to know if there's a strong correspondence between the libsrc submodule in https://github.com/NOAA-EMC/GSI (which, unfortunately, is not yet public as far as I can tell, and is only available via NOAA-private git) and this NCEPLIBS repo here? I'm trying to build GSI and have had trouble getting it to find pre-built bacio, bufr, etc., as described in https://github.com/NOAA-EMC/GSI/issues/93. In addition to the approach I describe in that issue, I also tried building NCEPLIBS from this repo as a first step (successful) and then getting GSI to find it (unsuccessful so far). So, my current interest in getting the NCEPLIBS source tarball is in hopes that I can populate GSI's libsrc directory with its contents, maybe with some renaming, and get GSI to build the support libraries itself, as if git had been able to populate the libsrc directory from the submodule.

Probably my question is out of scope here, but it never hurts to ask.