NOAA-GFDL / SHiELD_build

Other
7 stars 21 forks source link

Build nceplibs, use external libraries, and build different configurations in parallel #15

Closed laurenchilutti closed 2 years ago

laurenchilutti commented 2 years ago

Description

Fixes # (issue)

How Has This Been Tested?

I have tested this build on Gaea with gnu and intel. I have tested with the CI tests on Parallelworks to see that answers do reproduce

Checklist:

Please check all whether they apply or not

lharris4 commented 2 years ago

This is a good idea. Thanks.

Lucas

On Thu, Sep 8, 2022 at 4:04 PM Rusty Benson @.***> wrote:

@.**** approved this pull request.

In Build/COMPILE https://github.com/NOAA-GFDL/SHiELD_build/pull/15#discussion_r966368566:

#

check to make sure libFMS exists

if [ -d libFMS/${compiler} ] && [ -e libFMS/${compiler}/32bit/libFMS.a ] && [ -e libFMS/${compiler}/64bit/libFMS.a ] ; then echo " pre-built libFMS/${compiler} exists" else

  • echo " libFMS/${compiler} does not exist - building libFMS/${compiler}"
  • MAKE_libFMS ${compiler} >> buildlibFMS${compiler}.out 2>&1 # build 32bit and 64bit versions of libFMS
  • #
  • test and report on libFMS build success

  • if [ $? -ne 0 ] ; then
  • echo ">>> libFMS $compiler build failed"
  • exit 2
  • fi
  • echo " libFMS build successful"
  • echo " libFMS/${compiler} does not exist"
  • ./BUILDlibfms ${compiler}

I think you need to check the exit code from BUILDlibfms to ensure it completed correctly before continuing.

In Build/mk_scripts/mk_make https://github.com/NOAA-GFDL/SHiELD_build/pull/15#discussion_r966373144:

@@ -77,12 +84,12 @@ $FC --version NCEPLIBS="../../libFMS/${COMPILER}/${bit}/libFMS.a" if [ ${CONFIG} = 'shield' ] ; then NCEPLIBS+=" ./libgfs.a"

  • NCEPLIBS+=" -L../../nceplibs/${COMPILER}/ -lbacio_4 -lsp_v2.0.2_d -lw3emc_d -lw3nco_d"
  • NCEPLIBS+=" -L../../nceplibs/${COMPILER}/ -lbacio -lsp_d -lw3emc_d -lw3nco_d"

You could set a library path variable in Build/COMPILE that would point to internal or external locations and simply refer to it here. It would save you from managing the various links.

— Reply to this email directly, view it on GitHub https://github.com/NOAA-GFDL/SHiELD_build/pull/15#pullrequestreview-1101340594, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMUQRVGRUVISXJ6FZENFYXTV5JBDJANCNFSM6AAAAAAQIBULFA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

laurenchilutti commented 2 years ago

I would be supportive of removing the prebuild nceplibs and I can do that in this PR. Would we want to do that in this PR or wait to get input from Lucas and his team?

lharris4 commented 2 years ago

I would be fine with removing the pre-built NCEPLIBS as long as they are only built when absolutely necessary, as what is done with FRE.

Linjiong, Kai, Joseph: do you have any opinions on this?

Thanks, Lucas

On Fri, Sep 9, 2022 at 10:23 AM laurenchilutti @.***> wrote:

I would be supportive of removing the prebuild nceplibs and I can do that in this PR. Would we want to do that in this PR or wait to get input from Lucas and his team?

— Reply to this email directly, view it on GitHub https://github.com/NOAA-GFDL/SHiELD_build/pull/15#issuecomment-1242038269, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMUQRVGYBYRGWZ7PLRFVYL3V5NB5FANCNFSM6AAAAAAQIBULFA . You are receiving this because you commented.Message ID: @.***>

laurenchilutti commented 2 years ago

I would be fine with removing the pre-built NCEPLIBS as long as they are only built when absolutely necessary, as what is done with FRE. Linjiong, Kai, Joseph: do you have any opinions on this? Thanks, Lucas

@JosephMouallem @kaiyuan-cheng @linjiongzhou Would you be able to give your input on this? I can modify the COMPILE script so that the nceplibs gets built similarly to libFMS (when it does not exist or when you use the cleanall argment)

kaiyuan-cheng commented 2 years ago

I think building the NCEPlibs from the source code is neater than the prebuilt.

On Fri, Sep 9, 2022 at 1:21 PM laurenchilutti @.***> wrote:

I would be fine with removing the pre-built NCEPLIBS as long as they are only built when absolutely necessary, as what is done with FRE. Linjiong, Kai, Joseph: do you have any opinions on this? Thanks, Lucas

@JosephMouallem https://github.com/JosephMouallem @kaiyuan-cheng https://github.com/kaiyuan-cheng @linjiongzhou https://github.com/linjiongzhou Would you be able to give your input on this? I can modify the COMPILE script so that the nceplibs gets built similarly to libFMS (when it does not exist or when you use the cleanall argment)

— Reply to this email directly, view it on GitHub https://github.com/NOAA-GFDL/SHiELD_build/pull/15#issuecomment-1242253214, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2VX67RECPTTLVMPCEUEJDV5NW2VANCNFSM6AAAAAAQIBULFA . You are receiving this because you were mentioned.Message ID: @.***>

laurenchilutti commented 2 years ago

This should be my final commit for this PR - I have removed the prebuilt nceplibs. If you are compiling for the first time the nceplibs and libfms will be built. If you choose to compile with cleanall libfms, ncepplibs, and the build area (exec) will be deleted and rebuilt.

laurenchilutti commented 2 years ago

I had to make one more round of changes - on Parallelworks in testing I found that the nceplibs weren't building and adding the cmake flag -DCMAKE_C_STANDARD=99 fixes this issue. I also moved the module load cmake to the site/environment..sh files as different systems have different versions of cmake. I have tested on Gaea and Parallelworks and everything works

JosephMouallem commented 2 years ago

looks good and the compilation works on both gaea and orion

linjiongzhou commented 2 years ago

I am totally fine with that. Building it the same way as FMS would be great.

Linjiong

On Fri, Sep 9, 2022 at 1:21 PM laurenchilutti @.***> wrote:

I would be fine with removing the pre-built NCEPLIBS as long as they are only built when absolutely necessary, as what is done with FRE. Linjiong, Kai, Joseph: do you have any opinions on this? Thanks, Lucas

@JosephMouallem https://github.com/JosephMouallem @kaiyuan-cheng https://github.com/kaiyuan-cheng @linjiongzhou https://github.com/linjiongzhou Would you be able to give your input on this? I can modify the COMPILE script so that the nceplibs gets built similarly to libFMS (when it does not exist or when you use the cleanall argment)

— Reply to this email directly, view it on GitHub https://github.com/NOAA-GFDL/SHiELD_build/pull/15#issuecomment-1242253214, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVIY3SOVQWCD6AIZ57U2S3V5NW2VANCNFSM6AAAAAAQIBULFA . You are receiving this because you were mentioned.Message ID: @.***>