LLNL / serac

Serac is a high order nonlinear thermomechanical simulation code
BSD 3-Clause "New" or "Revised" License
179 stars 33 forks source link

Build of Serac #603

Closed makeclean closed 2 years ago

makeclean commented 2 years ago

Trying to build Serac from source, but complaining about a non-optional dependency Ascent, which I can't find any open reference for.

white238 commented 2 years ago

Ascent is here: https://github.com/Alpine-DAV/ascent

We have instructions on how to build Serac's TPLs here: https://serac.readthedocs.io/en/latest/sphinx/quickstart.html#building-serac-s-dependencies-via-spack-uberenv

If you have any questions please reach out!

makeclean commented 2 years ago

Ok, I've fought with building the packages myself, and I'm admitting defeat, I cannot get AXOM to detect LUA even though its installed. Im drawing a line underneath that, and maybe in a masochistic fit over the weekend I'll have another go.

I've followed the instructions you suggested

python3 scripts/uberenv/uberenv.py --prefix=../serac_libs
python3 ./config-build.py -hc j0818-linux-fedora35-zen-gcc@11.2.1.cmake
cd build-j0818-linux-fedora35-zen-gcc@11.2.1-debug
make -j 
Consolidate compiler generated dependencies of target gtest
[  2%] Built target gtest
Consolidate compiler generated dependencies of target gtest_main
[  3%] Built target gtest_main
Consolidate compiler generated dependencies of target blt_mpi_smoke
[  4%] Built target blt_mpi_smoke
Consolidate compiler generated dependencies of target blt_gtest_smoke
[  6%] Built target blt_gtest_smoke
Consolidate compiler generated dependencies of target serac_infrastructure
[  7%] Building CXX object src/serac/infrastructure/CMakeFiles/serac_infrastructure.dir/cli.cpp.o
In file included from /home/adavis/prod/serac/src/serac/infrastructure/cli.cpp:11:
/home/adavis/prod/serac/src/serac/infrastructure/../../serac/infrastructure/input.hpp:118:8: error: ‘optional’ in namespace ‘std’ does not name a template type
  118 |   std::optional<double> scalar_constant;
      |        ^~~~~~~~
/home/adavis/prod/serac/src/serac/infrastructure/../../serac/infrastructure/input.hpp:20:1: note: ‘std::optional’ is defined in header ‘<optional>’; did you forget to ‘#include <optional>’?
   19 | #include "axom/inlet.hpp"
  +++ |+#include <optional>
   20 | #include "axom/sidre.hpp"
/home/adavis/prod/serac/src/serac/infrastructure/../../serac/infrastructure/input.hpp:123:8: error: ‘optional’ in namespace ‘std’ does not name a template type
  123 |   std::optional<mfem::Vector> vector_constant;
      |        ^~~~~~~~
/home/adavis/prod/serac/src/serac/infrastructure/../../serac/infrastructure/input.hpp:123:3: note: ‘std::optional’ is defined in header ‘<optional>’; did you forget to ‘#include <optional>’?
  123 |   std::optional<mfem::Vector> vector_constant;
      |   ^~~
/home/adavis/prod/serac/src/serac/infrastructure/../../serac/infrastructure/input.hpp:138:8: error: ‘optional’ in namespace ‘std’ does not name a template type
  138 |   std::optional<int> component;
      |        ^~~~~~~~
/home/adavis/prod/serac/src/serac/infrastructure/../../serac/infrastructure/input.hpp:138:3: note: ‘std::optional’ is defined in header ‘<optional>’; did you forget to ‘#include <optional>’?
  138 |   std::optional<int> component;
      |   ^~~

I suspect its that I'm on a bleeding edge compiler, as following the helpful hint from the compiler, making that change then it gets further....

[ 42%] Building CXX object src/serac/numerics/functional/tests/CMakeFiles/tensor_unit_tests.dir/tensor_unit_tests.cpp.o
/home/adavis/prod/serac/src/serac/numerics/functional/tests/tensor_unit_tests.cpp: In function ‘void basic_tensor_tests()’:
/home/adavis/prod/serac/src/serac/numerics/functional/tests/tensor_unit_tests.cpp:39:31: sorry, unimplemented: unexpected AST of kind nontype_argument_pack
   39 |   static_assert(abs(sqnorm(dot(u, A) - uA)) < 1.0e-16);
      |                            ~~~^~~~~~
/home/adavis/prod/serac/src/serac/numerics/functional/tests/tensor_unit_tests.cpp:39: confused by earlier errors, bailing out
Preprocessed source stored into /tmp/ccrBxAQh.out file, please attach this to your bugreport.

Which actually makes the compiler barf, which doesnt happen all that much to me, congrats guys ;) I've had it with the flakier compilers, but never with GCC, I'll raise it as a bug report.

Disabling testing I can get further and build the main set of executables.

makeclean commented 2 years ago

With that 'succesfully' built exectuable, I can't get the conduction example to work

LD_LIBRARY_PATH=/home/adavis/prod/serac_libs/spack/opt/spack/linux-fedora35-zen/gcc-11.2.1/lua-5.3.5-c4yvyjbeanpwkxmabc6vjoqmfau4th4c/lib/ ./serac --input-file conduction.lua 
Logger activated: serac_serial_logger

******************************Command Line Options******************************
Input File: conduction.lua
Output Directory: conduction
********************************************************************************

[ERROR (/home/adavis/prod/serac/src/serac/mesh/mesh_utils.cpp:482)]
Specified type not supported: generate
** StackTrace of 8 frames **
Frame 1: axom::slic::logErrorMessage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)
Frame 2: FromInlet<serac::mesh::InputOptions>::operator()(axom::inlet::Container const&)
Frame 3: std::enable_if<(((!axom::inlet::detail::is_inlet_primitive<serac::mesh::InputOptions>::value)&&(!axom::inlet::detail::is_inlet_array<serac::mesh::InputOptions>::value))&&(!axom::inlet::detail::is_inlet_dict<serac::mesh::InputOptions>::value))&&(!axom::inlet::detail::is_std_vector<serac::mesh::InputOptions>::value), serac::mesh::InputOptions>::type axom::inlet::Container::get<serac::mesh::InputOptions>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const
Frame 4: std::enable_if<(!axom::inlet::detail::is_inlet_primitive<serac::mesh::InputOptions>::value)&&(!axom::inlet::detail::is_std_function<serac::mesh::InputOptions>::value), serac::mesh::InputOptions>::type axom::inlet::Proxy::get<serac::mesh::InputOptions>() const
Frame 5: main
Frame 6: 
Frame 7: __libc_start_main
Frame 8: _start
=====
samuelpmishLLNL commented 2 years ago

Hi @makeclean, thank you for the interest in serac and for clearly documenting your steps.

With that 'succesfully' built exectuable, I can't get the conduction example to work

I'm able to reproduce this issue on my local machine, and it looks like it is caused by a mistake in our example lua input file. The "main_mesh" entry should have type "box" rather than "generate". Can you try modifying that line of conduction.lua to match the code below and see if our outputs agree:

sam@provolone:~/code/serac/build/bin$ head ../../examples/simple_conduction/conduction.lua 
-- _output_type_start
output_type = "ParaView"
-- _output_type_end

-- Mesh information
-- _mesh_start
main_mesh = {
    type = "box",
    elements = {x = 10, y = 10}
}
sam@provolone:~/code/serac/build/bin$ ./serac --input-file ../../examples/simple_conduction/conduction.lua 
Logger activated: serac_serial_logger

******************************Command Line Options******************************
Input File: ../../examples/simple_conduction/conduction.lua
Output Directory: conduction
********************************************************************************

step 1, t = 0.25
Newton iteration  0 : ||r|| = 3.9444
Newton iteration  1 : ||r|| = 3.19523e-06, ||r||/||r_0|| = 8.10069e-07
step 2, t = 0.5
Newton iteration  0 : ||r|| = 3.19523e-06
Newton iteration  1 : ||r|| = 2.93056e-12, ||r||/||r_0|| = 9.17166e-07
step 3, t = 0.75
Newton iteration  0 : ||r|| = 2.93056e-12
step 4, t = 1
Newton iteration  0 : ||r|| = 2.93056e-12

unfortunately, our test suite doesn't cover the lua input files yet, so this problem has gone unnoticed for months! I've created a new issue to improve our test suite to catch these kind of mistakes in the future.


I suspect its that I'm on a bleeding edge compiler, as following the helpful hint from the compiler, making that change then it gets further...

[ 42%] Building CXX object src/serac/numerics/functional/tests/CMakeFiles/tensor_unit_tests.dir/tensor_unit_tests.cpp.o
/home/adavis/prod/serac/src/serac/numerics/functional/tests/tensor_unit_tests.cpp: In function ‘void basic_tensor_tests()’:
/home/adavis/prod/serac/src/serac/numerics/functional/tests/tensor_unit_tests.cpp:39:31: sorry, unimplemented: unexpected AST of kind nontype_argument_pack
39 |   static_assert(abs(sqnorm(dot(u, A) - uA)) < 1.0e-16);
|                            ~~~^~~~~~
/home/adavis/prod/serac/src/serac/numerics/functional/tests/tensor_unit_tests.cpp:39: confused by earlier errors, bailing out
Preprocessed source stored into /tmp/ccrBxAQh.out file, please attach this to your bugreport.

Currently, we are only testing with gcc 10.3 and clang 10.0, neither of which stumble on the static_assertion in that unit test. It appears that error message is unique to gcc ~11.2 (and appears to already be fixed in gcc trunk), with all other compilers having no issue, see: https://godbolt.org/z/c4bjEo3sY

white238 commented 2 years ago

607 should fix the input file. Sorry about that @makeclean

white238 commented 2 years ago

Closing because i think everything in this has been addressed. Please reach out if there are further problems!