Skip to content

tests/octopus: convert to new stand-alone test process#38010

Closed
tldahlgren wants to merge 3 commits intospack:developfrom
tldahlgren:test_update_octopus
Closed

tests/octopus: convert to new stand-alone test process#38010
tldahlgren wants to merge 3 commits intospack:developfrom
tldahlgren:test_update_octopus

Conversation

@tldahlgren
Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren commented May 31, 2023

Converted tests to use new stand-alone test process. Unfortunately, I cannot yet build the package:

UPDATE:
According to configure, gdlib can be disabled so this PR also adds a variant so I can test the package again.

Installing with the new variant:

$ spack install --test=root octopus~gdlib
...
==> Installing octopus-13.0-dbslafrveqvzxvif2xjuaxagu6dj3k7m [26/26]
==> No binary for octopus-13.0-dbslafrveqvzxvif2xjuaxagu6dj3k7m found: installing from source
==> Using cached archive: SPACK_ROOT/var/spack/cache/_source-cache/archive/b4/b4d0fd496c31a9c4aa4677360e631765049373131e61f396b00048235057aeb1.tar.gz
==> No patches needed for octopus
==> octopus: Executing phase: 'autoreconf'
==> octopus: Executing phase: 'configure'
==> octopus: Executing phase: 'build'
==> octopus: Executing phase: 'install'
==> octopus: Successfully installed octopus-13.0-dbslafrveqvzxvif2xjuaxagu6dj3k7m
  Stage: 1.48s.  Autoreconf: 0.00s.  Configure: 39.11s.  Build: 5m 29.54s.  Install: 23.47s.  Post-install: 10.69s.  Total: 6m 46.49s
[+] SPACK_ROOT/opt/spack/linux-rhel8-x86_64_v3/gcc-12.1.1/octopus-13.0-dbslafrveqvzxvif2xjuaxagu6dj3k7m
1148.388u 95.702s 7:49.25 265.1%    0+0k 525856+804912io 127pf+0w

And testing the above installation:

$ spack -v test run octopus
==> Spack test xoajsveoxu6qltmlvnihzc3hwtoske4i
==> Testing package octopus-13.0-dbslafr
==> [2023-07-27-16:06:13.556589] test: test_he: run tiny calculation for He
Current working directory (in example-he)
copying he.inp from SPACK_ROOT/var/spack/repos/builtin/packages/octopus/test
==> [2023-07-27-16:06:13.560508] Copying SPACK_ROOT/var/spack/repos/builtin/packages/octopus/test/he.inp to inp
==> [2023-07-27-16:06:13.571785] 'SPACK_ROOT/opt/spack/linux-rhel8-x86_64_v3/gcc-12.1.1/octopus-13.0-dbslafrveqvzxvif2xjuaxagu6dj3k7m/bin/octopus' 
    <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
                                ___
                             .-'   `'.
                            /         \
                            |         ;
                            |         |           ___.--,
                   _.._     |0) ~ (0) |    _.---'`__.-( (_.
            __.--'`_.. '.__.\    '--. \_.-' ,.--'`     `""`
           ( ,.--'`   ',__ /./;   ;, '.__.'`    __
           _`) )  .---.__.' / |   |\   \__..--""  """--.,_
          `---' .'.''-._.-'`_./  /\ '.  \ _.-~~~````~~~-._`-.__.'
                | |  .' _.-' |  |  \  \  '.               `~---`
                 \ \/ .'     \  \   '. '-._)
...
PASSED: Octopus::test_recipe
==> [2023-07-27-16:06:17.074766] test: test_version: check version output
==> [2023-07-27-16:06:17.075524] 'SPACK_ROOT/opt/spack/linux-rhel8-x86_64_v3/gcc-12.1.1/octopus-13.0-dbslafrveqvzxvif2xjuaxagu6dj3k7m/bin/octopus' '--version'
octopus 13.0 (git commit )   
PASSED: Octopus::test_version         
==> [2023-07-27-16:06:17.126298] Completed testing
==> [2023-07-27-16:06:17.126473]      
======================== SUMMARY: octopus-13.0-dbslafr =========================
Octopus::test_he .. PASSED
Octopus::test_recipe .. PASSED
Octopus::test_version .. PASSED   
============================= 3 passed of 3 parts ==============================
============================== 1 passed of 1 spec ==============================

@spackbot-app spackbot-app bot added stand-alone-tests Stand-alone (or smoke) tests for installed packages update-package labels May 31, 2023
@tldahlgren tldahlgren marked this pull request as draft May 31, 2023 00:51
@fangohr
Copy link
Copy Markdown
Member

fangohr commented Jun 2, 2023

@tldahlgren - thanks for advancing the testing framework. The new code looks nice.

Initial feedback regarding the compilation failure (before the weekend, if that is helpful...): I think I managed to reproduce the compilation error you report above once but didn't record the process accurately, and can now not reproduce it. What I see is that compilation of octopus (without the --test=root argument) in your branch works for me.

When using the full command (spack install --test=root octopus) I think the following happens: it appears that the installation process triggers a call of the make check target from Octopus. This then runs for a long time (we talk hours; hasn't finished yet). It is likely to fail (in the sense that perhaps a few of the many tests might fail due to too tight numerical constraints) - I'll report back when this has finished.

So my questions are: (i) does the compilation still fail for you?

(ii) is the (implicit?) call of make check intended when --test=root is used?

@tldahlgren
Copy link
Copy Markdown
Contributor Author

@tldahlgren - thanks for advancing the testing framework. The new code looks nice.

Initial feedback regarding the compilation failure (before the weekend, if that is helpful...): I think I managed to reproduce the compilation error you report above once but didn't record the process accurately, and can now not reproduce it. What I see is that compilation of octopus (without the --test=root argument) in your branch works for me.

When using the full command (spack install --test=root octopus) I think the following happens: it appears that the installation process triggers a call of the make check target from Octopus. This then runs for a long time (we talk hours; hasn't finished yet). It is likely to fail (in the sense that perhaps a few of the many tests might fail due to too tight numerical constraints) - I'll report back when this has finished.

Running tests for hours isn't so good.

So my questions are: (i) does the compilation still fail for you?

If I compile without --test=root, I get the following error:

...
     7369    /bin/sh ../libtool  --tag=CXX   --mode=link /usr/WS1/dahlgren/rele
             ases/spack/lib/spack/env/gcc/g++ -I/var/tmp/dahlgren/spack-stage/s
             pack-stage-octopus-12.2-jxs2vi2kdxgw36tetoapou6jngmrtoxt/spack-src
             /external_libs/rapidxml -O2 -fallow-argument-mismatch -fallow-inva
             lid-boz   -o liboct.la -rpath /usr/WS1/dahlgren/releases/spack/opt
...
             lo  ../external_libs/qshep/libqshep.la ../external_libs/spglib-1.9
             .9/src/libsymspg.la ../external_libs/bpdn/libbpdn.la ../external_l
             ibs/dftd3/libdftd3.la  ../external_libs/metis-5.1/libmetis/libmeti
             s.la ../external_libs/metis-5.1/GKlib/libgk.la   -lyaml -L -lgd  -
             lgd -lm -lz -lpng16 -lz -lfreetype -lfontconfig -lfreetype -ljpeg 
...
     7370    $SPACK_ROOT/opt/spack/linux-rhel8-broadwell/g
             cc-10.3.1/openmpi-4.1.5-3age6xsh53nhbuxmuc46a67zm6jqe2md/bin/mpif9
             0 -O2 -ffree-line-length-none -fallow-argument-mismatch -fallow-in
             valid-boz -fopenmp -I ../external_libs/bpdn -I ../external_libs/df
             td3 -I ../external_libs/spglib-1.9.9/src/ -I $SPACK_ROOT/
             opt/spack/linux-rhel8-broadwell/gcc-10.3.1/libxc-6.1.0
             -eocmr3ns4gnqgwdrhrnlm5e4bpiqyife/include -I$SPACK_ROOT/
             /linux-rhel8-broadwell/gcc-10.3.1/fftw-3.3.10-
             cx2hzunpru2tkbwoldi2zgh2qq7ezvco/include  -c  -o main/main.o main/
             main_oct.f90
     7371    libtool:   error: require no space between '-L' and '-lgd'

(ii) is the (implicit?) call of make check intended when --test=root is used?

Yes, it is inherited behavior from AutotoolsPackage (see https://spack.readthedocs.io/en/latest/packaging_guide.html#adding-installation-phase-tests).

You should be able to disable it by adding the build_time_test_callbacks = [] # type: List[str] (as shown for hpctoolkit at

build_time_test_callbacks = [] # type: List[str]
) or setting self.build_time_test_callbacks = [] as shown for netpbm (as shown at https://github.com/spack/spack/blob/4c2531d5fbc2022dd144d1c59dd6faa7ce2c9607/var/spack/repos/builtin/packages/netpbm/package.py#LL162C15-L162C15).

@tldahlgren tldahlgren force-pushed the test_update_octopus branch from b68b4ee to a2a49e0 Compare July 12, 2023 01:13
@tldahlgren tldahlgren marked this pull request as ready for review July 12, 2023 01:13
@tldahlgren
Copy link
Copy Markdown
Contributor Author

I marked this as Ready for Review though I am still getting the build error reported above.

@fangohr @RemiLacroix-IDRIS Do you have recommendations for how I can build the package so I can test it? Or would you care to run the changes in this PR?

@fangohr
Copy link
Copy Markdown
Member

fangohr commented Jul 12, 2023

Thanks @tldahlgren - sorry for dropping the ball on this.

I don't know why the compilation fails for you, and it would be good of course to understand this. I can't look into this myself at the moment, but we have two options:

(i) We have a CI like framework at https://github.com/fangohr/spack-ci-octopus where we build Octopus using Spack. We use a Debian-based Docker container. You can either use this as a recipe for succesfull compilation, or use the same environment as is to test your changes of this pull request. For the latter, the relevant target in the Makefile is probably spack-develop. You may need to modify lines 45 to 47 it the Dockerfile to make sure it is using your fork/branch relevant to the problem. You could either run this locally (if you have Docker), or fork the repo and let GitHub compile.

(ii) @iamashwin99 may be able to help out (perhaps also using the above).

The primary aim would be to see if this pull request works for Octopus. If, along the way, we can understand why the Octopus build fails on @tldahlgren Red Hat system, that would be nice, too!

@iamashwin99
Copy link
Copy Markdown
Contributor

iamashwin99 commented Jul 12, 2023

Hi @fangohr,
I tested this branch with spack install --test=root octopus and I see the same issue as you, where the build takes a long time because it goes through the make check . Since it did endup running the make checks I assume the actual octopus build goes well.
I will now test without the --test=root.
I am building on zen3 in Fedora 38 with [email protected].
@tldahlgren I see that you are using [email protected] on a rhel8, is that correct?
Since this MR is about refactoring the tests, would it be a good idea to define self.build_time_test_callbacks = [] here itself? I have an MR on this tldahlgren#83

@tldahlgren
Copy link
Copy Markdown
Contributor Author

@tldahlgren I see that you are using [email protected] on a rhel8, is that correct?

Yes. I'm trying a newer compiler but running into issues.

@tldahlgren
Copy link
Copy Markdown
Contributor Author

@tldahlgren I see that you are using [email protected] on a rhel8, is that correct?

Yes. I'm trying a newer compiler but running into issues.

I run into a new problem when I constrain gcc (and python to an external due to an issue with one of its dependencies). I am confused by the Type Mismatch error since the -fallow-argument-mismatch option is set.

$ spack install --test=root octopus %gcc@12 ^[email protected]
...
==> Installing octopus-13.0-3ujkht446emsk5v2sej4vd3u3kz4eiee
==> No binary for octopus-13.0-3ujkht446emsk5v2sej4vd3u3kz4eiee found: installing from source
==> Using cached archive: SPACK_ROOT/var/spack/cache/_source-cache/archive/b4/b4d0fd496c31a9c4aa4677360e631765049373131e61f396b00048235057aeb1.tar.gz
==> No patches needed for octopus
==> octopus: Executing phase: 'autoreconf'
==> octopus: Executing phase: 'configure'
==> octopus: Executing phase: 'build'
==> Error: ProcessError: Command exited with status 2:
    'make' '-j16' 'V=1'

11 errors found in build log:
     5367       --mode=compile \
     5368      SPACK_ROOT/opt/spack/linux-rhel8-broadwell/gcc-12.1
             .1/mpich-4.1.1-hpcs2yg5xhuby4o2wgscx2bh3tv34cyv/bin/mpif90 -O2 -ff
             ree-line-length-none -fallow-argument-mismatch -fallow-invalid-boz
              -fopenmp -I ../external_libs/bpdn -I ../external_libs/dftd3 -I ..
             /external_libs/spglib-1.9.9/src/ -I SPACK_ROOT/opt/sp
             ack/linux-rhel8-broadwell/gcc-12.1.1/libxc-6.1.0-itl2v3ezglzx2tu7s
             7rjcx75m5aeqaeb/include -ISPACK_ROOT/opt/spack/linux-
             rhel8-broadwell/gcc-12.1.1/fftw-3.3.10-hemkpy6imfolahdoebivfu7bbby
             yptwp/include  -c  -o basic/lookup.lo basic/lookup_oct.f90
     5369    basic/mpi_lib_inc.F90:95:45:
     5370    
     5371       95 |     intranode_grp%comm, ptr, window, mpi_err)
     5372          |                                             1
  >> 5373    Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_p
             tr) to INTEGER(8)
     5374    basic/mpi_lib_inc.F90:97:76:
     5375    
     5376       97 |   call MPI_Win_shared_query(window, 0, window_size, disp_u
             nit, ptr, mpi_err)
     5377          |                                                           
                              1
  >> 5378    Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_p
             tr) to INTEGER(8)
     5379    basic/mpi_lib_inc.F90:95:45:
     5380    
     5381       95 |     intranode_grp%comm, ptr, window, mpi_err)
     5382          |                                             1
  >> 5383    Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_p
             tr) to INTEGER(8)
     5384    basic/mpi_lib_inc.F90:97:76:
     5385    
     5386       97 |   call MPI_Win_shared_query(window, 0, window_size, disp_u
             nit, ptr, mpi_err)
     5387          |                                                           
                              1
  >> 5388    Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_p
             tr) to INTEGER(8)
     5389    basic/mpi_lib_inc.F90:95:45:
     5390    
     5391       95 |     intranode_grp%comm, ptr, window, mpi_err)
     5392          |                                             1
  >> 5393    Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_p
             tr) to INTEGER(8)
     5394    basic/mpi_lib_inc.F90:97:76:
     5395    
     5396       97 |   call MPI_Win_shared_query(window, 0, window_size, disp_u
             nit, ptr, mpi_err)
     5397          |                                                           
                              1
  >> 5398    Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_p
             tr) to INTEGER(8)
     5399    basic/mpi_lib_inc.F90:95:45:
     5400    
     5401       95 |     intranode_grp%comm, ptr, window, mpi_err)
     5402          |                                             1
  >> 5403    Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_p
             tr) to INTEGER(8)
     5404    basic/mpi_lib_inc.F90:97:76:
     5405    
     5406       97 |   call MPI_Win_shared_query(window, 0, window_size, disp_u
             nit, ptr, mpi_err)
     5407          |                                                           
                              1
  >> 5408    Error: Type mismatch in argument 'baseptr' at (1); passed TYPE(c_p
             tr) to INTEGER(8)
...

@iamashwin99
Copy link
Copy Markdown
Contributor

I see the string mpich in your message. are you using mpich for the virtual dependency mpi? Octopus is tested and only supported on openmpi. Could that be the issue?

@tldahlgren tldahlgren force-pushed the test_update_octopus branch from ad6dd3b to cabb4c5 Compare July 13, 2023 18:36
@tldahlgren
Copy link
Copy Markdown
Contributor Author

tldahlgren commented Jul 13, 2023

I see the string mpich in your message. are you using mpich for the virtual dependency mpi? Octopus is tested and only supported on openmpi. Could that be the issue?

Helps in some respects but doesn't look like it is sufficient for me. (I iterated with initially using --fresh on the build so I wasn't using a different openmpi that was causing other problems.)

$ spack install octopus ^openmpi
...
==> Installing octopus-13.0-nbbkihurjzjgrkn4nddrqtwnp2rl5iqq [26/26]
==> No binary for octopus-13.0-nbbkihurjzjgrkn4nddrqtwnp2rl5iqq found: installing from source
==> Using cached archive: SPACK_ROOT/var/spack/cache/_source-cache/archive/b4/b4d0fd496c31a9c4aa4677360e631765049373131e61f396b00048235057aeb1.tar.gz
==> No patches needed for octopus
==> octopus: Executing phase: 'autoreconf'
==> octopus: Executing phase: 'configure'
==> octopus: Executing phase: 'build'
==> Error: ProcessError: Command exited with status 2:
    'make' '-j16' 'V=1'
...
     7676    SPACK_ROOT/opt/spack/linux-rhel8-x86_64_v3/gcc-12.1.1
             /openmpi-4.1.5-zq5vqifl2tassijpbyeekjj4onaqvxsc/bin/mpif90 -O2 -ff
             ree-line-length-none -fallow-argument-mismatch -fallow-invalid-boz
              -fopenmp -I ../external_libs/bpdn -I ../external_libs/dftd3 -I ..
             /external_libs/spglib-1.9.9/src/ -I SPACK_ROOT/opt/sp
             ack/linux-rhel8-x86_64_v3/gcc-12.1.1/libxc-6.1.0-ee6unhd3ku3hp3ube
             quz6fv346lmqk5w/include -ISPACK_ROOT/opt/spack/linux-
             rhel8-x86_64_v3/gcc-12.1.1/fftw-3.3.10-rh7xr4hskmj7ppvmnlqqzlkmcmk
             6zfmk/include  -c  -o main/main.o main/main_oct.f90
     7677    libtool:   error: require no space between '-L' and '-lgd'
  >> 7678    make[2]: *** [Makefile:2726: liboct.la] Error 1
...

@iamashwin99
Copy link
Copy Markdown
Contributor

iamashwin99 commented Jul 28, 2023

SPACK_ROOT/opt/spack/linux-rhel8-x86_64_v3/gcc-12.1.1
/openmpi-4.1.5-zq5vqifl2tassijpbyeekjj4onaqvxsc/bin/mpif90

@tldahlgren can you post the complete stdout for reference

spack -v install octopus%[email protected] ^openmpi

Update: lets test with [email protected] as thats a well tested compiler with octopus

@tldahlgren
Copy link
Copy Markdown
Contributor Author

SPACK_ROOT/opt/spack/linux-rhel8-x86_64_v3/gcc-12.1.1
/openmpi-4.1.5-zq5vqifl2tassijpbyeekjj4onaqvxsc/bin/mpif90

@tldahlgren can you post the complete stdout for reference

spack -v install octopus%[email protected] ^openmpi

Update: lets test with [email protected] as thats a well tested compiler with octopus

Sure. spack-build-out.txt

@iamashwin99
Copy link
Copy Markdown
Contributor

I can see that the complaint is from libtool not getting the path for libgd.

  -lyaml -L -lgd  -lgd -lm -lz /bin/sh ../libtool  --tag=CXX   --mode=link SPACK_ROOT/lib/spack/env/gcc/g++ ........... -lyaml -L -lgd  -lgd -lm -lz

This is passed in the m4/gdlib.m4 macro of octopus code:

       if test "x$GD_LIBS" = x; then
        GD_LIBS="-L`$GDLIB_CONFIG --libdir` -lgd `$GDLIB_CONFIG --ldflags` `$GDLIB_CONFIG --libs | awk '{if($NF=="@LIBICONV@"){$NF=""} print}'`"
      # Sometimes GD installation strangely leaves this token @LIBICONV@ in --libs, which must be removed
      fi

So somehow GDLIB_CONFIG is empty.

Nonetheless libgd is a depreciated dependency in octopus.
The spack package dosent have a dependency on libgd nor does it actually '--enable-gdlib' but i can see that from your verbose output '--enable-gdlib' is passed and that is probably because the configure script detects gdlib from your system unfortunately.

checking for gdlib-config... /usr/bin/gdlib-config
checking whether gdlib can be linked... yes

In case of a clean install on a debian docker image this dosent happen:

checking for gdlib-config... no

We have two options to solve this:

  • explicitly enable gdlib

    • set $GD_LIBS (from pkg-config --libs gd or so)
    • set GDLIB_CONFIG ( the path of gdlib-config) 🤞
  • explicitly disable gdlib

    • set acx_gdlib_ok=no 🤞
    • pass --disable-gdlib
      I find disabling gdlib much easier aproach

@tldahlgren
Copy link
Copy Markdown
Contributor Author

Closing due to #45143

@tldahlgren tldahlgren closed this Jul 12, 2024
@tldahlgren tldahlgren deleted the test_update_octopus branch August 27, 2024 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-variant stand-alone-tests Stand-alone (or smoke) tests for installed packages update-package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants