Giter VIP home page Giter VIP logo

seams-core's Introduction

d-SEAMS

Deferred Structural Elucidation Analysis for Molecular Simulations

Build Status

built with nix

\brief The C++ core of d-SEAMS, a molecular dynamics trajectory analysis engine.

\note The related pages describe the examples and how to obtain the data-sets (trajectories) from figshare.

\warning If you are unwilling to use the nix build system, then please note that you must manage the dependencies MANUALLY, including the compiler versions. Optionally, use the provided conda environment.

Citation

If you use this software please cite the following:

Goswami, R., Goswami, A., & Singh, J. K. (2020). d-SEAMS: Deferred Structural Elucidation Analysis for Molecular Simulations. Journal of Chemical Information and Modeling. https://doi.org/10.1021/acs.jcim.0c00031

The corresponding bibtex entry is:

@Article{Goswami2020,
author={Goswami, Rohit and Goswami, Amrita and Singh, Jayant Kumar},
title={d-SEAMS: Deferred Structural Elucidation Analysis for Molecular Simulations},
journal={Journal of Chemical Information and Modeling},
year={2020},
month={Mar},
day={20},
publisher={American Chemical Society},
issn={1549-9596},
doi={10.1021/acs.jcim.0c00031},
url={https://doi.org/10.1021/acs.jcim.0c00031}
}

Compilation

We use a deterministic build system to generate both bug reports and uniform usage statistics. This also handles the lua scripting engine.

\note The lua functions are documented on the on the API Docs

We also provide a conda environment as a fallback, which is also recommended for MacOS users.

Build

Conda (working now)

Although we strongly suggest using nix, for MacOS systems, the following instructions may be more suitable. We will assume the presence of micromamba:

cd ~/seams-core
micromamba create -f environment.yml
micromamba activate dseams
luarocks install luafilesystem

Now the installation can proceed.

\note we do not install lua-luafilesystem within the conda environment because it is outdated on osx

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=YES -DCMAKE_INSTALL_PREFIX:PATH=$CONDA_PREFIX ../
make -j$(nproc)
make install
$CONDA_PREFIX/bin/yodaStruct -c lua_inputs/config.yml

We have opted to install into the conda environment, if this is not the intended behavior, use /usr/local instead.

Spack (not working at the moment)

Manually this can be done in a painful way as follows:

spack install [email protected] [email protected]
spack install catch2 fmt yaml-cpp openblas boost cmake ninja meson
spack load catch2 fmt yaml-cpp openblas boost cmake ninja meson [email protected] [email protected]
luarocks install luafilesystem

Or better:

spack env activate $(pwd)
# After loading the packages
luarocks install luafilesystem

Now we can build and install as usual.

cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo \
 -DCMAKE_EXPORT_COMPILE_COMMANDS=YES -GNinja \
 -DCMAKE_INSTALL_PREFIX=$HOME/.local \
 -DCMAKE_CXX_FLAGS="-pg -fsanitize=address " \
 -DCMAKE_EXE_LINKER_FLAGS=-pg -DCMAKE_SHARED_LINKER_FLAGS=-pg \
 -DBUILD_TESTING=NO
cmake --build build

Or more reasonably:

export INST_DIR=$HOME/.local
cd src
meson setup bbdir --prefix $INST_DIR
meson compile -C bbdir
meson install -C bbdir
# if not done
export PATH=$PATH:$INST_DIR/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INST_DIR/lib
cd ../
yodaStruct -c lua_inputs/config.yml

Nix (not working at the moment)

Since this project is built with nix, we can simply do the following from the root directory (longer method):

# Make sure there are no artifacts
rm -rf build
# This will take a long time the first time as it builds the dependencies
nix-build . # Optional
# Install into your path
nix-env -if . # Required
# Run the command anywhere
yodaStruct -c lua_inputs/config.yml

A faster method of building the software is by using the cachix binary cache as shown:

# Install cachix
nix-env -iA cachix -f https://cachix.org/api/v1/install
# Use the binary cache
cachix use dseams
# Faster with the cache than building from scratch
nix-build . # Optional
# Install into your path
nix-env -if . # Required
# Run the command anywhere
yodaStruct -c lua_inputs/config.yml

Usage

Having installed the yodaStruct binary and library, we can now use it.

yodaStruct -c lua_inputs/config.yml

\note The paths in the .yml should be relative to the folder from which the binary is called.

If you're confused about how to handle the relative paths, run the command yodaStruct -c lua_inputs/config.yml in the top-level directory, and set the paths relative to the top-level directory. This is the convention used in the examples as well.

Language Server Support

To generate a compile_commands.json file for working with a language server like ccls use the following commands:

# Pure environment
nix-shell --pure
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=YES ../
cp compile_commands.json ../

Note that there is no need to actually compile the project if you simply need to get the compiler database for the language server.

Do Not commit the .json file.

Development

We can simply use the nix environment:

# From the project root
nix-shell --pure

Running

This is built completely with nix:

# Install systemwide
nix-env -if .

To run the sample inputs, simply install the software, and ensure that input/ is a child directory.

# Assuming you are in the src directory
# Check help with -h
yodaStruct -c lua_inputs/config.yml

Tests

Apart from the examples, the test-suite can be run with the yodaStruct_test binary, which will drop into the nix environment before building and executing gdb:

# Just run this
./testBuild.sh
# At this point the binary and library are copied into the root
# One might, in a foolhardy attempt, use gdb at this point
# Here be dragons :)
# USE NIX
# Anyway
gdb --args ./yodaStruct -c lua_inputs/config.yml
# quit gdb with quit
# Go run the test binary
cd shellBuild
./yodaStruct_test

Do note that the regular installation via nix-env runs the tests before the installation

Developer Documentation

While developing, it is sometimes expedient to update the packages used. It is then useful to note that we use niv to handle our pinned packages (apart from the ones built from Github). Thus, one might need, say:

niv update nixpkgs -b nixpkgs-unstable

Test the build with nix:

nix-build .
# Outputs are in ./result
# If you get a CMake error
rm -rf build
nix-store --delete /nix/store/$whatever # $whatever is the derivation complaining
nix-collect-garbage # then try again [worst case scenario]

Leaks and performance

While testing for leaks, use clang (for AddressSanitizer and LeakSanitizer) and the following:

# From the developer shell
export CXX=/usr/bin/clang++ && export CC=/usr/bin/clang
cmake .. -DCMAKE_CXX_FLAGS="-pg -fsanitize=address " -DCMAKE_EXE_LINKER_FLAGS=-pg -DCMAKE_SHARED_LINKER_FLAGS=-pg

Overview

As of Mon Jan 20 15:57:18 2020, the lines of code calculated by cloc are as follows:

Cloc Lines

Contributing

Please ensure that all contributions are formatted according to the clang-format configuration file.

Specifically, consider using the following:

Where some of the above suggestions are derived from this depreciated githook.

Also, do note that we have a CONTRIBUTING file you need to read to contribute, for certain reasons, like, common sense.

Commit Hook

Note that we expect compliance with the clang-format as mentioned above, and this may be enforced by using the provided scripts for a pre-commit hook:

./scripts/git-pre-commit-format install

This will ensure that new commits are in accordance to the clang-format file.

Development Builds

The general idea is to drop into an interactive shell with the dependencies and then use cmake as usual.

nix-shell --pure --run bash --show-trace --verbose
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DNO_WARN=TRUE \
 -DFIND_EIGEN=TRUE \
 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
 -G "Ninja"
ninja
# Test
cd ../
yodaStruct -c lua_inputs/config.yml
# Debug
gdb --args yodaStruct -c lua_inputs/config.yml

To load debugging symbols from the shared library, when you are inside gdb (from the top-level directory, for instance), use the following command:

add-symbol-file build/libyodaLib.so

Then you can set breakpoints in the C++ code; for instance:

b seams_input.cpp:408

Acknowledgements

The following tools are used in this project:

Third Party Libraries

The libraries used are:

seams-core's People

Contributors

amritagos avatar clarkszw avatar haozeke avatar ruhirg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

seams-core's Issues

Spack installation failed in the last step with cmake..

    Spack took me 5 hours to install the dependencies to a new VM..

I was stopped in the last step of the spack path, here is the report:

$ cmake --build build
[1/42] Building CXX object src/CMakeFiles/yodaLib.dir/seams_input.cpp.o
FAILED: src/CMakeFiles/yodaLib.dir/seams_input.cpp.o 
/usr/bin/c++ -DBOOST_ERROR_CODE_HEADER_ONLY -DyodaLib_EXPORTS -I/home/clarkszw/seams-core/src/include/internal -I/home/clarkszw/seams-core/src/include/external -I/home/clarkszw/spack/opt/spack/linux-ubuntu20.04-x86_64_v4/gcc-9.4.0/boost-1.81.0-mrcd6ui7dmzh3vlv2tmmk2uxhbywq3qs/include -pg -fsanitize=address -O2 -g -DNDEBUG -fPIC -std=gnu++17 -MD -MT src/CMakeFiles/yodaLib.dir/seams_input.cpp.o -MF src/CMakeFiles/yodaLib.dir/seams_input.cpp.o.d -o src/CMakeFiles/yodaLib.dir/seams_input.cpp.o -c /home/clarkszw/seams-core/src/seams_input.cpp
In file included from /home/clarkszw/seams-core/src/seams_input.cpp:15:
/home/clarkszw/seams-core/src/include/internal/generic.hpp:26:10: fatal error: eigen3/Eigen/Core: No such file or directory
   26 | #include <eigen3/Eigen/Core>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
[2/42] Building CXX object src/CMakeFiles/yodaStruct.dir/main.cpp.o
FAILED: src/CMakeFiles/yodaStruct.dir/main.cpp.o 
/usr/bin/c++ -DBOOST_ERROR_CODE_HEADER_ONLY -I/home/clarkszw/seams-core/src/include/internal -I/home/clarkszw/seams-core/src/include/external -I/home/clarkszw/spack/opt/spack/linux-ubuntu20.04-x86_64_v4/gcc-9.4.0/boost-1.81.0-mrcd6ui7dmzh3vlv2tmmk2uxhbywq3qs/include -pg -fsanitize=address -O2 -g -DNDEBUG -std=gnu++17 -MD -MT src/CMakeFiles/yodaStruct.dir/main.cpp.o -MF src/CMakeFiles/yodaStruct.dir/main.cpp.o.d -o src/CMakeFiles/yodaStruct.dir/main.cpp.o -c /home/clarkszw/seams-core/src/main.cpp
In file included from /home/clarkszw/seams-core/src/include/internal/seams_output.hpp:21,
                 from /home/clarkszw/seams-core/src/include/internal/ring.hpp:33,
                 from /home/clarkszw/seams-core/src/include/internal/seams_input.hpp:21,
                 from /home/clarkszw/seams-core/src/include/internal/bond.hpp:33,
                 from /home/clarkszw/seams-core/src/main.cpp:28:
/home/clarkszw/seams-core/src/include/internal/generic.hpp:26:10: fatal error: eigen3/Eigen/Core: No such file or directory
   26 | #include <eigen3/Eigen/Core>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
[3/42] Building CXX object src/CMakeFiles/yodaLib.dir/mol_sys.cpp.o
ninja: build stopped: subcommand failed.

I have clone the latest repository this morning.

Originally posted by @Clarkszw in #12 (reply in thread)

DOC: Conda `luarocks` not present on M1 macos

Describe the bug
luarocks is not directly available to download through micromamba.

To Reproduce
So I tried to download it manually by using the following commands:

$ wget https://luarocks.org/releases/luarocks-3.9.2.tar.gz
$ tar zxpf luarocks-3.9.2.tar.gz
$ cd luarocks-3.9.2
$ ./configure && make && sudo make install
$ sudo luarocks install luasocket
$ lua
Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio
> require "socket"

Expected behavior
This worked with a little bit of path change with 'conda'.

Screenshots
Screenshot 2023-06-19 at 4 18 43 AM

Desktop (please complete the following information):
Screenshot 2023-06-19 at 2 35 05 AM

Additional context
It was successfully installed in the M1 macos but it doesn't build. when I tried to use the following commands:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=YES -DCMAKE_INSTALL_PREFIX:PATH=$CONDA_PREFIX ../
make -j$(nproc)

It gave me the following error:

Screenshot 2023-06-19 at 4 32 50 AM

BLD: Nix builds are not idempotent

    Here is the error message from build via `nix-build .`

builder for '/nix/store/vb245y6zalkacd779w8yd6h00f2fhs7d-yodaStruct.drv' failed with exit code 2

It gives the same output when I use nix-env if . to install.

Could anyone give me some hint to fix it?

Thanks in advance.

Scanning dependencies of target yodaStruct
Scanning dependencies of target yodaStruct_test
[ 56%] Building CXX object src/CMakeFiles/yodaStruct.dir/main.cpp.o
[ 58%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/main.cpp.o
[ 60%] Linking CXX executable ../yodaStruct
/nix/store/p792j5f44l3f0xi7ai5jllwnxqwnka88-binutils-2.31.1/bin/ld: CMakeFiles/yodaStruct.dir/main.cpp.o: in function `main':
main.cpp:(.text+0x2f28): undefined reference to `fmt::v9::vformat[abi:cxx11](fmt::v9::basic_string_view<char>, fmt::v9::basic_format_args<fmt::v9::basic_format_context<fmt::v9::appender, char> >)'
/nix/store/p792j5f44l3f0xi7ai5jllwnxqwnka88-binutils-2.31.1/bin/ld: main.cpp:(.text+0x2fe4): undefined reference to `fmt::v9::vformat[abi:cxx11](fmt::v9::basic_string_view<char>, fmt::v9::basic_format_args<fmt::v9::basic_format_context<fmt::v9::appender, char> >)'
/nix/store/p792j5f44l3f0xi7ai5jllwnxqwnka88-binutils-2.31.1/bin/ld: main.cpp:(.text+0x308e): undefined reference to `fmt::v9::vformat[abi:cxx11](fmt::v9::basic_string_view<char>, fmt::v9::basic_format_args<fmt::v9::basic_format_context<fmt::v9::appender, char> >)'
/nix/store/p792j5f44l3f0xi7ai5jllwnxqwnka88-binutils-2.31.1/bin/ld: main.cpp:(.text+0x3138): undefined reference to `fmt::v9::vformat[abi:cxx11](fmt::v9::basic_string_view<char>, fmt::v9::basic_format_args<fmt::v9::basic_format_context<fmt::v9::appender, char> >)'
/nix/store/p792j5f44l3f0xi7ai5jllwnxqwnka88-binutils-2.31.1/bin/ld: CMakeFiles/yodaStruct.dir/main.cpp.o: in function `YAML::detail::node& YAML::detail::node_data::get<char [11]>(char const (&) [11], std::shared_ptr<YAML::detail::memory_holder>)':
main.cpp:(.text._ZN4YAML6detail9node_data3getIA11_cEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getIA11_cEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x102): undefined reference to `YAML::detail::node_data::convert_to_map(std::shared_ptr<YAML::detail::memory_holder> const&)'
/nix/store/p792j5f44l3f0xi7ai5jllwnxqwnka88-binutils-2.31.1/bin/ld: CMakeFiles/yodaStruct.dir/main.cpp.o: in function `YAML::detail::node& YAML::detail::node_data::get<char [10]>(char const (&) [10], std::shared_ptr<YAML::detail::memory_holder>)':
main.cpp:(.text._ZN4YAML6detail9node_data3getIA10_cEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getIA10_cEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x102): undefined reference to `YAML::detail::node_data::convert_to_map(std::shared_ptr<YAML::detail::memory_holder> const&)'
/nix/store/p792j5f44l3f0xi7ai5jllwnxqwnka88-binutils-2.31.1/bin/ld: CMakeFiles/yodaStruct.dir/main.cpp.o: in function `YAML::detail::node& YAML::detail::node_data::get<char [4]>(char const (&) [4], std::shared_ptr<YAML::detail::memory_holder>)':
main.cpp:(.text._ZN4YAML6detail9node_data3getIA4_cEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getIA4_cEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x102): undefined reference to `YAML::detail::node_data::convert_to_map(std::shared_ptr<YAML::detail::memory_holder> const&)'
/nix/store/p792j5f44l3f0xi7ai5jllwnxqwnka88-binutils-2.31.1/bin/ld: CMakeFiles/yodaStruct.dir/main.cpp.o: in function `YAML::detail::node& YAML::detail::node_data::get<char [5]>(char const (&) [5], std::shared_ptr<YAML::detail::memory_holder>)':
main.cpp:(.text._ZN4YAML6detail9node_data3getIA5_cEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getIA5_cEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x102): undefined reference to `YAML::detail::node_data::convert_to_map(std::shared_ptr<YAML::detail::memory_holder> const&)'
/nix/store/p792j5f44l3f0xi7ai5jllwnxqwnka88-binutils-2.31.1/bin/ld: CMakeFiles/yodaStruct.dir/main.cpp.o: in function `YAML::detail::node& YAML::detail::node_data::get<char [20]>(char const (&) [20], std::shared_ptr<YAML::detail::memory_holder>)':
main.cpp:(.text._ZN4YAML6detail9node_data3getIA20_cEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getIA20_cEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x102): undefined reference to `YAML::detail::node_data::convert_to_map(std::shared_ptr<YAML::detail::memory_holder> const&)'
/nix/store/p792j5f44l3f0xi7ai5jllwnxqwnka88-binutils-2.31.1/bin/ld: CMakeFiles/yodaStruct.dir/main.cpp.o:main.cpp:(.text._ZN4YAML6detail9node_data3getIA28_cEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE[_ZN4YAML6detail9node_data3getIA28_cEERNS0_4nodeERKT_St10shared_ptrINS0_13memory_holderEE]+0x102): more undefined references to `YAML::detail::node_data::convert_to_map(std::shared_ptr<YAML::detail::memory_holder> const&)' follow
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/CMakeFiles/yodaStruct.dir/build.make:106: yodaStruct] Error 1
make[1]: *** [CMakeFiles/Makefile2:191: src/CMakeFiles/yodaStruct.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 63%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/franzblau-test.cpp.o
[ 65%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/topo_one_dim-test.cpp.o
[ 68%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/topo_bulk-test.cpp.o
[ 70%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/absor-test.cpp.o
[ 73%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/__/src/franzblau.cpp.o
[ 75%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/__/src/topo_one_dim.cpp.o
[ 78%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/__/src/topo_bulk.cpp.o
[ 80%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/__/src/ring.cpp.o
[ 82%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/__/src/neighbours.cpp.o
[ 85%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/__/src/mol_sys.cpp.o
[ 87%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/__/src/absOrientation.cpp.o
[ 90%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/__/src/seams_input.cpp.o
[ 92%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/__/src/seams_output.cpp.o
[ 95%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/__/src/pntCorrespondence.cpp.o
[ 97%] Building CXX object tests/CMakeFiles/yodaStruct_test.dir/__/src/bulkTUM.cpp.o
[100%] Linking CXX executable ../yodaStruct_test
[100%] Built target yodaStruct_test
make: *** [Makefile:160: all] Error 2
error: builder for '/nix/store/vb245y6zalkacd779w8yd6h00f2fhs7d-yodaStruct.drv' failed with exit code 2

Originally posted by @Clarkszw in #12 (comment)

This seems to be happening in PR runs as well. Hints towards a deeper issue with the dependency pinning. Looks like a linker issue for fmt and yaml-cpp.

CI: Broken `cachix`?

Warning: The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Cachix: installing
  /usr/bin/bash -c nix-env --quiet -j[8](https://github.com/d-SEAMS/seams-core/actions/runs/5308074653/jobs/9607199482?pr=27#step:6:9) -iA cachix -f https://cachix.org/api/v1/install
Cachix: using cache dseams
  Error: Action failed with error: Error: Unable to locate executable file: cachix. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.

Needs an update. Would be nice to perhaps step away from nix for now..

Installation via `micromamba` needs some help..

Describe the bug

When I try to install via micromamba, this is the response.

Is this meaning something wrong in the yaml file?

(base) clarkszw@aiida:~/seams-core$ micromamba create -f environment.yml 

Command ' ' not found, but can be installed with:

sudo apt install mailutils-mh  # version 1:3.7-2.1, or
sudo apt install meshio-tools  # version 4.0.4-1
sudo apt install mmh           # version 0.4-2
sudo apt install nmh           # version 1.7.1-6
sudo apt install termtris      # version 1.3-1

Ubuntu 20.04.1
x86_64

BUG: fmt version error in linux

Describe the bug
I was trying to work with d-seams in linux as it did not work with M1 macos.

To Reproduce
I was trying to build d-seams using the following commands:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=YES -DCMAKE_INSTALL_PREFIX:PATH=$CONDA_PREFIX ../
make -j$(nproc)

Expected behavior
It was supposed to work in linux, but it gave an error stating fmt==9 was undefined.

Screenshots

Screenshot 2023-06-19 at 4 49 02 AM

Desktop (please complete the following information):

Screenshot 2023-06-19 at 4 58 26 AM

Additional context
The problem here was my linux machine had fmt==10 version installed and the code didn't support fmt==10 version and is restricted to fmt==9.

ENH: Deprecate `cmake` for `meson`

I like meson. Also beyond that, as shown in pypotlib meson subprojects make wrapper generation easier by:

  • Separation of concerns (bindings in a separate repo)
  • Less janky dependency handling (compared to git submodules)
  • Generally being more readable / playing with environments better

The last one is subjective, but regardless, I think moving away from cmake would be a good step in modularity. Some considerations will probably come up in the migration related to the way meson handles sub-directories. @RuhiRG this could be a good starting point or a parallel task while you work on the bindings with existing installations :)

ENH,BIND: Return more `PointCloud`s

In dSEAMS raw pointers have been used, but in pybind11 when I bind a function with raw pointers. It gives segmentation error. Here is the git commit I made. The error it shows when I try to use ipython is as follows:

In [1]: cyoda.clearPointCloud(mpt)
Out[1]: <bbdir.cyoda.PointCloudDouble at 0x7f72d1e91130>

In [2]: mpt = cyoda.clearPointCloud(mpt)

In [3]: mpt
Out[3]: <bbdir.cyoda.PointCloudDouble at 0x7f72d1c333f0>

In [4]: cyoda.readXYZ("conftest.xyz", mpt)
Stack trace (most recent call last):
#31   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e8aa08d, in _PyRun_SimpleFileObject
#30   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e8aa70f, in 
#29   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e895772, in 
#28   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e899369, in 
#27   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e87a9de, in PyEval_EvalCode
#26   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e87b325, in 
#25   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e7c73ce, in _PyEval_EvalFrameDefault
#24   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e7efc70, in PyObject_Call
#23   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e806802, in 
#22   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e806a73, in 
#21   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e7c385c, in _PyEval_EvalFrameDefault
#20   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e7d04cb, in PyObject_Vectorcall
#19   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e7ee728, in 
#18   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e88f996, in 
#17   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e88edb8, in 
#16   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e7c6478, in _PyEval_EvalFrameDefault
#15   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e88edb8, in 
#14   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e7c6478, in _PyEval_EvalFrameDefault
#13   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e88edb8, in 
#12   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e7c385c, in _PyEval_EvalFrameDefault
#11   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e7d04cb, in PyObject_Vectorcall
#10   Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e7d05de, in 
#9    Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e89208d, in 
#8    Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e87a9de, in PyEval_EvalCode
#7    Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e87b325, in 
#6    Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e7c385c, in _PyEval_EvalFrameDefault
#5    Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e7b6e12, in _PyObject_MakeTpCall
#4    Object "/users/home/ruhila/micromamba/envs/dseams/bin/python3.11", at 0x56400e7d6d45, in 
#3    Object "/users/home/ruhila/Git/Github/dSEAMS/pyseams/bbdir/cyoda.cpython-311-x86_64-linux-gnu.so", at 0x7f72d1be08a7, in 
#2    Object "/users/home/ruhila/Git/Github/dSEAMS/pyseams/bbdir/cyoda.cpython-311-x86_64-linux-gnu.so", at 0x7f72d1be94a3, in 
#1    Object "/users/home/ruhila/micromamba/envs/dseams/lib/libyodaLib.so", at 0x7f72d1aef46c, in sinp::readXYZ(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, molSys::PointCloud<molSys::Point<double>, double>*)
#0    Object "/lib64/libc.so.6", at 0x7f72e1700e0b, in 
Segmentation fault (Address not mapped to object [0x30])
Segmentation fault (core dumped)

The C++ function code takes the input and process the object in place, returning an integer status code. The pybind11 documentation notes that there are issues with changes to native containers. The simplest solution would be to change the seams-core function to take a single input string (filename) and return a populated PointCloud object instead of an int.

RFC: Removing `lua` bindings

Since the refactors for #35, the lua bindings to functions have stopped working. This is expected, the lua bindings relied on objects being constructed in C++ and provided to the lua environment. With pyseams however, this is no longer required.

As currently written, the functions.lua files are used to call C++ functions, but they can be removed, the CLI should be used with the lua variables and yaml files to run the analysis in functions.lua.

For backwards compatibility I would propose adding these C++ only workflows to the CLI while removing the lua bindings.

MAINT, BLD: Update sol2 --> sol3

Even as we move away from lua, the sol2 requirement pins the build system to 5.2 which is hard to enforce. Upgrading makes sense just to be able to build more robustly for the future.

Add coverage metrics

Is your feature request related to a problem? Please describe.
Currently it is difficult to keep track of which tests are present and which should be implemented.
Describe the solution you'd like

  • Given that it is a C++ project, it makes sense to use lcov

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.