fangohr / octopus-in-spack

Develop Octopus in spack (software packaging)
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

Add boost prefix when compiling with cgal #73

Closed iamashwin99 closed 1 year ago

iamashwin99 commented 1 year ago

When octopus is installed with cgal, cgal pulls in boost as a dependency, for eg:

$ spack spec octopus+cgal
Input spec
--------------------------------
octopus+cgal

Concretized
--------------------------------
octopus@12.1%gcc@11.3.0~arpack+cgal~cuda~debug~elpa~libvdwxc~libyaml~likwid~metis+mpi~netcdf~nlopt~parmetis~pfft~python~scalapack build_system=autotools arch=linux-debian11-sandybridge
    ^cgal@5.0.3%gcc@11.3.0~core~demos+eigen~header_only~imageio~ipo+shared build_system=cmake build_type=Release arch=linux-debian11-sandybridge
        ^boost@1.80.0%gcc@11.3.0~atomic~chrono~clanglibcpp+container~context~contract~coroutine~date_time~debug+exception~fiber~filesystem~graph~graph_parallel~icu~iostreams~json~locale~log+math~mpi+multithreaded~nowide~numpy~pic~program_options~python+random~regex~serialization+shared~signals~singlethreaded~stacktrace+system~taggedlayout~test+thread~timer~type_erasure~versionedlayout~wave build_system=generic cxxstd=98 patches=a440f96 visibility=hidden arch=linux-debian11-sandybridge
        ^cmake@3.24.3%gcc@11.3.0~doc+ncurses+ownlibs~qt build_system=generic build_type=Release arch=linux-debian11-sandybridge 
            ^ncurses@6.3%gcc@11.3.0~symlinks+termlib abi=none build_system=autotools arch=linux-debian11-sandybridge

This MR explicitly passes the boost prefix as a configure argument and fixes #63

fangohr commented 1 year ago

Thank you.

Have you checked if Octopus recognises boost? (For example: does "ldd octopus" point to boost?)

iamashwin99 commented 1 year ago

In this case ldd dosent help:

user@693333a2927b:~$ ldd `which octopus`
        linux-vdso.so.1 (0x00007ffed3b4e000)
        libpfft.so.0 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/pfft-1.0.8-alpha-gw3ajct26eel5bkaj7hv6v5bkkisf6fj/lib/libpfft.so.0 (0x00007f12825d3000)
        libnetcdff.so.7 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/netcdf-fortran-4.6.0-d6jvl25b7exlrvzinezjhp6e4mlwcw3v/lib/libnetcdff.so.7 (0x00007f1282535000)
        libnlopt.so.0 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/nlopt-2.7.0-s7rz4ei7vjpgz55l23ud7naqyzgiumsx/lib/libnlopt.so.0 (0x00007f12824b8000)
        libparmetis.so => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/parmetis-4.0.3-xuxnwnhyz6fpmcq2lxxqebx542u75nhu/lib/libparmetis.so (0x00007f128247d000)
        libmetis.so => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/metis-5.1.0-mzcgvjqijtv6o32hge2jpovknox7a77n/lib/libmetis.so (0x00007f1282415000)
        liblikwid.so.5.2 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/likwid-5.2.2-qr4jlxcyoqaznszpxdj7avshgd7viakx/lib/liblikwid.so.5.2 (0x00007f12812e9000)
        libfftw3_threads.so.3 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/fftw-3.3.10-xnulxfhigmyk6uo53crdppo4wrl3ept5/lib/libfftw3_threads.so.3 (0x00007f12812df000)
        libfftw3_mpi.so.3 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/fftw-3.3.10-xnulxfhigmyk6uo53crdppo4wrl3ept5/lib/libfftw3_mpi.so.3 (0x00007f12812c4000)
        libfftw3.so.3 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/fftw-3.3.10-xnulxfhigmyk6uo53crdppo4wrl3ept5/lib/libfftw3.so.3 (0x00007f1280ff0000)
        libopenblas.so.0 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/openblas-0.3.21-ufdhsztuykiufo3b4b7gjaxrkalqwvu2/lib/libopenblas.so.0 (0x00007f1280428000)
        libgsl.so.27 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/gsl-2.7.1-vb3xipt26em5jsah5un2sleumtymztvu/lib/libgsl.so.27 (0x00007f1280164000)
        libxcf03.so.9 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/libxc-5.2.3-osc35nn3oxqtyh3s7lgvudla4awyuz2y/lib/libxcf03.so.9 (0x00007f128015b000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f127ff8b000)
        libgfortran.so.5 => /usr/lib/x86_64-linux-gnu/libgfortran.so.5 (0x00007f127fcd5000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f127fb91000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f127fb75000)
        libmpi_mpifh.so.40 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/openmpi-4.1.5-pocpzoqvu4bjxfb4x6v5lqenwvk7rlyw/lib/libmpi_mpifh.so.40 (0x00007f127fb10000)
        libmpi.so.40 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/openmpi-4.1.5-pocpzoqvu4bjxfb4x6v5lqenwvk7rlyw/lib/libmpi.so.40 (0x00007f127f80c000)
        libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f127f7cc000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f127f7aa000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f127f5d5000)
        libnetcdf.so.19 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/netcdf-c-4.9.0-2hv7vl434cgjhmzofljrbc2kwrv36pfa/lib/libnetcdf.so.19 (0x00007f127f421000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f128384e000)
        liblua.so.5.4 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/lua-5.4.4-dtegrbbigage3ghryt4ozkumpkhr2svw/lib/liblua.so.5.4 (0x00007f127f3dd000)
        libhwloc.so.15 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/hwloc-2.9.0-gesgq3yb7jevwmfgpaz5hlwfuvynot5o/lib/libhwloc.so.15 (0x00007f127f37d000)
        libxc.so.9 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/libxc-5.2.3-osc35nn3oxqtyh3s7lgvudla4awyuz2y/lib/libxc.so.9 (0x00007f127e4b6000)
        libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007f127e46d000)
        libopen-pal.so.40 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/openmpi-4.1.5-pocpzoqvu4bjxfb4x6v5lqenwvk7rlyw/lib/libopen-pal.so.40 (0x00007f127e36d000)
        libopen-rte.so.40 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/openmpi-4.1.5-pocpzoqvu4bjxfb4x6v5lqenwvk7rlyw/lib/libopen-rte.so.40 (0x00007f127e24e000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f127e244000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f127e23e000)
        libhdf5_hl.so.310 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/hdf5-1.14.0-nh3eh3uyy72ucpmdqx5dfmwmm5cv77ji/lib/libhdf5_hl.so.310 (0x00007f127e219000)
        libhdf5.so.310 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/hdf5-1.14.0-nh3eh3uyy72ucpmdqx5dfmwmm5cv77ji/lib/libhdf5.so.310 (0x00007f127de01000)
        libpciaccess.so.0 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/libpciaccess-0.16-6txnnarahmnkttcaj3cwpnvtaghc537p/lib/libpciaccess.so.0 (0x00007f127ddf4000)
        libxml2.so.2 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/libxml2-2.10.3-fhhfregykvigtyg3uionir6suervhpdq/lib/libxml2.so.2 (0x00007f127dc91000)
        libpmix.so.2 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/pmix-4.1.2-fvrrxan2o5vql3tppvd6zkwu3nsfzdb7/lib/libpmix.so.2 (0x00007f127daa9000)
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f127daa4000)
        libevent_core-2.1.so.7 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/libevent-2.1.12-xr4onrrr7zfclrrricqu65urstgzxrv6/lib/libevent_core-2.1.so.7 (0x00007f127da6b000)
        libevent_pthreads-2.1.so.7 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/libevent-2.1.12-xr4onrrr7zfclrrricqu65urstgzxrv6/lib/libevent_pthreads-2.1.so.7 (0x00007f127da66000)
        libz.so.1 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/zlib-1.2.13-zrjyhe6c6y3kpdzngvacvozl7gg7nxmv/lib/libz.so.1 (0x00007f127da4c000)
        liblzma.so.5 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/xz-5.4.1-cj2gtz6n3v7fz6jp2dlxlo7rma5ni2b2/lib/liblzma.so.5 (0x00007f127da1c000)
        libiconv.so.2 => /home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/libiconv-1.17-quck7dyqo3yxmkn6kx3voyizbyngnvhd/lib/libiconv.so.2 (0x00007f127d90e000)

but the configure output does show that its picked up:

user@693333a2927b:~$ cd `spack location -i octopus`
user@693333a2927b:~/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/octopus-12.1-27do7qzocxwlpr4gqyfjky566dz7b6hp$ cd .spack/
ser@693333a2927b:~/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/octopus-12.1-27do7qzocxwlpr4gqyfjky566dz7b6hp/.spack$ ls
archived-files            install_manifest.json  repos                              spack-build-02-configure-out.txt  spack-build-04-install-out.txt  spack-build-out.txt       spec.json
install_environment.json  install_times.json     spack-build-01-autoreconf-out.txt  spack-build-03-build-out.txt      spack-build-env.txt             spack-configure-args.txt
user@693333a2927b:~/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/octopus-12.1-27do7qzocxwlpr4gqyfjky566dz7b6hp/.spack$ cat spack-build-02-configure-out.txt 

..........
checking for boostlib >= 1.62 (106200) includes in "/home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/boost-1.80.0-kqoqkqb3xlvhh3bhymkgpqmz4tvzjiu3/include"... yes
checking for boostlib >= 1.62 (106200) lib path in "/home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/boost-1.80.0-kqoqkqb3xlvhh3bhymkgpqmz4tvzjiu3/lib/x86_64-linux-gnu"... no
checking for boostlib >= 1.62 (106200) lib path in "/home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/boost-1.80.0-kqoqkqb3xlvhh3bhymkgpqmz4tvzjiu3/lib64"... no
checking for boostlib >= 1.62 (106200) lib path in "/home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/boost-1.80.0-kqoqkqb3xlvhh3bhymkgpqmz4tvzjiu3/libx32"... no
checking for boostlib >= 1.62 (106200) lib path in "/home/user/spack/opt/spack/linux-debian11-haswell/gcc-10.2.1/boost-1.80.0-kqoqkqb3xlvhh3bhymkgpqmz4tvzjiu3/lib"... yes
......
fangohr commented 1 year ago

If we do not let Octopus discover boost, is CGAL support provided? What is the connection here?

iamashwin99 commented 1 year ago

Its the cgal that requires boost and not octopus. In this MR I am just explicitly passing the boost prefix to the configure script. I found this option out by looking at the configure --help Im not sure if when the boost prefix is not explicitly specified, then the octopus configure wrappers picks up the system cgal or the system boost ( which is present in MPSD laptops), I need to check this. We should also talk to the octopus developers about weather it makes sense to have this Boost prefix in the configure in the first place, Sebastian seems to have written this part.

iamashwin99 commented 1 year ago

In the octopus developer meet today, Sebastian said that boost path has to be explicitly mentioned because the code has to be explicitly linked against it and they do this at MPCDF as well. So this MR is in alignment with that