TheochemUI / eOn

eOn v3 and beyond
https://theochemui.github.io/eOn/
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

BUG: compilation with fmt=11.0.1 #159

Closed mgoonde closed 1 month ago

mgoonde commented 1 month ago

On the branch main_fin, i followed the compilation instructions:

micromamba create -f environment.yml
micromamba activate eongit

and then:

meson setup bbdir --prefix=$CONDA_PREFIX
meson install -C bbdir

The setup command seems to pass fine, but getting a bunch of errors at compilation, first one being:

[31/156] Compiling C++ object client/potentials/EAM/libeam.so.p/EAM.cpp.o
FAILED: client/potentials/EAM/libeam.so.p/EAM.cpp.o 

/home/user/micromamba/envs/eongit/bin/x86_64-conda-linux-gnu-c++ -Iclient/potentials/EAM/libeam.so.p -Iclient/potentials/EAM -I../client/potentials/EAM -I../client/thirdparty -I/home/user/micromamba/envs/eongit/include/eigen3 -I/home/user/micromamba/envs/eongit/include -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_FILE_OFFSET_BITS=64 -std=c++17 -O0 -g -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/user/micromamba/envs/eongit/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/user/micromamba/envs/eongit/include -fPIC -DSPDLOG_SHARED_LIB -DFMT_SHARED -DSPDLOG_COMPILED_LIB -pthread -Wno-class-memaccess -Wno-unused-function -Wno-reorder -Wno-sign-compare -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-result -Wno-unused-variable -g3 -O0 -DEON_CHECKS=TRUE -DSPDLOG_FMT_EXTERNAL -MD -MQ client/potentials/EAM/libeam.so.p/EAM.cpp.o -MF client/potentials/EAM/libeam.so.p/EAM.cpp.o.d -o client/potentials/EAM/libeam.so.p/EAM.cpp.o -c ../client/potentials/EAM/EAM.cpp

In file included from /home/user/micromamba/envs/eongit/x86_64-conda-linux-gnu/sysroot/usr/include/limits.h:26,
                 from /home/user/micromamba/envs/eongit/lib/gcc/x86_64-conda-linux-gnu/12.4.0/include-fixed/limits.h:203,
                 from /home/user/micromamba/envs/eongit/lib/gcc/x86_64-conda-linux-gnu/12.4.0/include-fixed/syslimits.h:7,
                 from /home/user/micromamba/envs/eongit/lib/gcc/x86_64-conda-linux-gnu/12.4.0/include-fixed/limits.h:34,
                 from ../client/potentials/EAM/EAM.cpp:2:
/home/user/micromamba/envs/eongit/x86_64-conda-linux-gnu/sysroot/usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  330 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~
In file included from /home/user/micromamba/envs/eongit/include/spdlog/cfg/helpers.h:6,
                 from /home/user/micromamba/envs/eongit/include/spdlog/cfg/env.h:5,
                 from ../client/potentials/EAM/../../BaseStructures.h:14,
                 from ../client/potentials/EAM/../../Parameters.h:4,
                 from ../client/potentials/EAM/../../Potential.h:5,
                 from ../client/potentials/EAM/EAM.h:5,
                 from ../client/potentials/EAM/EAM.cpp:8:
/home/user/micromamba/envs/eongit/include/spdlog/common.h:168:111: error: 'basic_runtime' is not a member of 'fmt'
  168 |           std::is_convertible<T, fmt::basic_string_view<Char>>::value || std::is_same<remove_cvref_t<T>, fmt::basic_runtime<Char>>::value>
      |                                                                                                               ^~~~~~~~~~~~~                                                                                                                        

The output of meson setup:

$ meson setup bbdir --prefix=$CONDA_PREFIX
The Meson build system
Version: 1.5.0
Source dir: /home/user/eOn
Build dir: /home/user/eOn/bbdir
Build type: native build
Project name: eon
Project version: 2.1
C++ compiler for the host machine: /home/user/micromamba/envs/eongit/bin/x86_64-conda-linux-gnu-c++ (gcc 12.4.0 "x86_64-conda-linux-gnu-c++ (conda-forge gcc 12.4.0-0) 12.4.0")
C++ linker for the host machine: /home/user/micromamba/envs/eongit/bin/x86_64-conda-linux-gnu-c++ ld.bfd 2.40
Host machine cpu family: x86_64
Host machine cpu: x86_64
C compiler for the host machine: /home/user/micromamba/envs/eongit/bin/x86_64-conda-linux-gnu-cc (gcc 12.4.0 "x86_64-conda-linux-gnu-cc (conda-forge gcc 12.4.0-0) 12.4.0")
C linker for the host machine: /home/user/micromamba/envs/eongit/bin/x86_64-conda-linux-gnu-cc ld.bfd 2.40
Fortran compiler for the host machine: /home/user/micromamba/envs/eongit/bin/x86_64-conda-linux-gnu-gfortran (gcc 12.4.0 "GNU Fortran (conda-forge gcc 12.4.0-0) 12.4.0")
Fortran linker for the host machine: /home/user/micromamba/envs/eongit/bin/x86_64-conda-linux-gnu-gfortran ld.bfd 2.40
Compiler for C++ supports arguments -Wno-class-memaccess: YES 
Compiler for C++ supports arguments -Wno-unused-function: YES 
Compiler for C++ supports arguments -Wno-reorder: YES 
Compiler for C++ supports arguments -Wno-sign-compare: YES 
Compiler for C++ supports arguments -Wno-unused-but-set-parameter: YES 
Compiler for C++ supports arguments -Wno-unused-but-set-variable: YES 
Compiler for C++ supports arguments -Wno-unused-parameter: YES 
Compiler for C++ supports arguments -Wno-unused-result: YES 
Compiler for C++ supports arguments -Wno-unused-variable: YES 
Compiler for Fortran supports arguments -Wno-compare-reals: YES 
Compiler for Fortran supports arguments -Wno-conversion: YES 
Compiler for Fortran supports arguments -Wno-line-truncation: YES 
Compiler for Fortran supports arguments -Wno-surprising: YES 
Compiler for Fortran supports arguments -Wno-unused-dummy-argument: YES 
Compiler for Fortran supports arguments -Wno-deprecated: YES 
Compiler for Fortran supports arguments -Wno-unused-label: YES 
Compiler for Fortran supports arguments -w: YES 
Compiler for Fortran supports arguments -Wno-maybe-uninitialized: YES 
Compiler for Fortran supports arguments -Wno-uninitialized: YES 
Compiler for Fortran supports arguments -Wno-unused-but-set-parameter: YES 
Compiler for Fortran supports arguments -Wno-unused-but-set-variable: YES 
Compiler for Fortran supports arguments -Wno-unused-parameter: YES 
Compiler for Fortran supports arguments -Wno-unused-variable: YES 
Program get_version.py found: YES (/home/user/micromamba/envs/eongit/bin/python3.12 /home/user/eOn/client/get_version.py)
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300
Message: linux
Message: x86_64
Configuring version.h using configuration
Library m found: YES
Run-time dependency threads found: YES
Found CMake: /home/user/micromamba/envs/eongit/bin/cmake (3.30.1)
Run-time dependency eigen3 (modules: Eigen3::Eigen) found: YES 3.4.0
Found pkg-config: YES (/home/user/micromamba/envs/eongit/bin/pkg-config) 0.29.2
Run-time dependency fmt found: YES 11.0.1
Run-time dependency spdlog found: YES 1.10.0
Program python3 found: YES (/home/user/micromamba/envs/eongit/bin/python3.12)
Build targets in project: 24

eon 2.1

  User defined options
    prefix: /home/user/micromamba/envs/eongit

Found ninja-1.12.1 at /home/user/micromamba/envs/eongit/bin/ninja
HaoZeke commented 1 month ago

Thanks, I think this should be fixed by #160 now, needed to pin fmt for spdlog.

Run-time dependency fmt found: YES 10.0.0
Run-time dependency spdlog found: YES 1.12.0

Also it should be:

meson setup bbdir --prefix=$CONDA_PREFIX --libdir=lib
mgoonde commented 1 month ago

Great, that worked!