Skip to content

Add cmake logic to support building of dependent C++/WASM projects#54

Merged
dbanks12 merged 10 commits intodefi-bridge-projectfrom
db/cmake_wasm_dependent_pj
Jan 24, 2023
Merged

Add cmake logic to support building of dependent C++/WASM projects#54
dbanks12 merged 10 commits intodefi-bridge-projectfrom
db/cmake_wasm_dependent_pj

Conversation

@dbanks12
Copy link
Copy Markdown

@dbanks12 dbanks12 commented Jan 12, 2023

Summary

CMake changes to support this along with minor C++ changes to prepare for move of rollup/ contents to a dependent project.

Prerequisite for AC PR #2269

Details

  1. CMake now generates library/archive files in build*/lib for each src/aztec/ subdirectory. It also generates a libbarretenberg.a which is a single barretenberg library file that can be used in a dependent project.
  2. This repo still generates its own WASM executable, but dependent projects can create a WASM executable that includes all of barretenberg's bindings by linking to libbarretenberg.a and using -Wl,--whole-archive.
  3. To prepare for the removal of rollup/, I copied a single constant from rollup/constants to stdlib/constants.

@dbanks12 dbanks12 added the enhancement New feature or request label Jan 12, 2023
@dbanks12 dbanks12 requested a review from charlielye January 12, 2023 02:26
@dbanks12 dbanks12 self-assigned this Jan 12, 2023
@dbanks12 dbanks12 marked this pull request as ready for review January 12, 2023 16:27
@dbanks12 dbanks12 force-pushed the db/cmake_wasm_dependent_pj branch from fb0ffad to fbaa923 Compare January 13, 2023 17:31
@dbanks12 dbanks12 changed the base branch from master to defi-bridge-project January 14, 2023 16:30
@dbanks12 dbanks12 force-pushed the db/cmake_wasm_dependent_pj branch from 01f35eb to cd79701 Compare January 19, 2023 20:31
@dbanks12 dbanks12 changed the title Draft: Add cmake logic to support building of dependent C++/WASM projects Add cmake logic to support building of dependent C++/WASM projects Jan 20, 2023
@dbanks12 dbanks12 force-pushed the db/cmake_wasm_dependent_pj branch from c16101a to b4c460b Compare January 23, 2023 17:29
@dbanks12 dbanks12 force-pushed the db/cmake_wasm_dependent_pj branch from b6365d0 to 7b79a31 Compare January 24, 2023 14:21
@dbanks12 dbanks12 merged commit 92e76c9 into defi-bridge-project Jan 24, 2023
@dbanks12 dbanks12 deleted the db/cmake_wasm_dependent_pj branch January 24, 2023 15:30
dbanks12 added a commit that referenced this pull request Jan 24, 2023
* cmake updates to support dependent projects (native + wasm)

* nothing should depend on constants from `rollup/`

* use `cmake --build <dir> --parallel`  everywhere instead of -j with nprocs

* forward all bootstrap args to cmake with --target prefix for each. Use cleaner subshell instead of cd'ing back up after ignition in bootstrap.

* allow dependent project to set WASI_SDK_PREFIX and have it be used in wasm-linux-clang.cmake

* update readme to use cmake
dbanks12 added a commit that referenced this pull request Jan 24, 2023
* cmake updates to support dependent projects (native + wasm)

* nothing should depend on constants from `rollup/`

* use `cmake --build <dir> --parallel`  everywhere instead of -j with nprocs

* forward all bootstrap args to cmake with --target prefix for each. Use cleaner subshell instead of cd'ing back up after ignition in bootstrap.

* allow dependent project to set WASI_SDK_PREFIX and have it be used in wasm-linux-clang.cmake

* update readme to use cmake
zac-williamson added a commit that referenced this pull request Jan 30, 2023
(compiles all of bberg into a single library)
dbanks12 added a commit that referenced this pull request Feb 7, 2023
…llup/ removal, kesha's bigfield fix) (#123)

* Target skylake but without avx.

* Fix indent.

* Fixing fuzzer build (#14)

* Add cmake logic to support building of dependent C++/WASM projects (#54)

* cmake updates to support dependent projects (native + wasm)

* nothing should depend on constants from `rollup/`

* use `cmake --build <dir> --parallel`  everywhere instead of -j with nprocs

* forward all bootstrap args to cmake with --target prefix for each. Use cleaner subshell instead of cd'ing back up after ignition in bootstrap.

* allow dependent project to set WASI_SDK_PREFIX and have it be used in wasm-linux-clang.cmake

* update readme to use cmake

* Removed all files in rollup/ not necessary for join split tests

* dockerfile, script, and ci changes now that rollup contents are gone except join split

* remove more unused code from rollup/js dir

* removed standard example

* rename rollup directory to join_split_example

* bigfield fix

* filter out longer join split tests (leave only one full proof test in) for CI. fix bb-tests

* fix dockerfile now that rollup executables were removed

* rename rollup namespace to join_split_example

* add blake 3 to executables/libraries in aztec cmakelists

* Removing non-join-split constants as per recommendation here https://github.com/AztecProtocol/barretenberg/pull/124\#discussion_r1098698470

* remove vk constants from join-split

---------

Co-authored-by: Charlie Lye <karl.lye@gmail.com>
Co-authored-by: Innokentii Sennovskii <isennovskiy@gmail.com>
Co-authored-by: Adam Domurad <adam.domurad@gmail.com>
Co-authored-by: ludamad <adam@aztecprotocol.com>
ludamad added a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 22, 2023
…llup/ removal, kesha's bigfield fix) (AztecProtocol/barretenberg#123)

* Target skylake but without avx.

* Fix indent.

* Fixing fuzzer build (AztecProtocol/barretenberg#14)

* Add cmake logic to support building of dependent C++/WASM projects (AztecProtocol/barretenberg#54)

* cmake updates to support dependent projects (native + wasm)

* nothing should depend on constants from `rollup/`

* use `cmake --build <dir> --parallel`  everywhere instead of -j with nprocs

* forward all bootstrap args to cmake with --target prefix for each. Use cleaner subshell instead of cd'ing back up after ignition in bootstrap.

* allow dependent project to set WASI_SDK_PREFIX and have it be used in wasm-linux-clang.cmake

* update readme to use cmake

* Removed all files in rollup/ not necessary for join split tests

* dockerfile, script, and ci changes now that rollup contents are gone except join split

* remove more unused code from rollup/js dir

* removed standard example

* rename rollup directory to join_split_example

* bigfield fix

* filter out longer join split tests (leave only one full proof test in) for CI. fix bb-tests

* fix dockerfile now that rollup executables were removed

* rename rollup namespace to join_split_example

* add blake 3 to executables/libraries in aztec cmakelists

* Removing non-join-split constants as per recommendation here https://github.com/AztecProtocol/barretenberg/pull/124\#discussion_r1098698470

* remove vk constants from join-split

---------

Co-authored-by: Charlie Lye <karl.lye@gmail.com>
Co-authored-by: Innokentii Sennovskii <isennovskiy@gmail.com>
Co-authored-by: Adam Domurad <adam.domurad@gmail.com>
Co-authored-by: ludamad <adam@aztecprotocol.com>
ludamad added a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 24, 2023
…llup/ removal, kesha's bigfield fix) (AztecProtocol/barretenberg#123)

* Target skylake but without avx.

* Fix indent.

* Fixing fuzzer build (AztecProtocol/barretenberg#14)

* Add cmake logic to support building of dependent C++/WASM projects (AztecProtocol/barretenberg#54)

* cmake updates to support dependent projects (native + wasm)

* nothing should depend on constants from `rollup/`

* use `cmake --build <dir> --parallel`  everywhere instead of -j with nprocs

* forward all bootstrap args to cmake with --target prefix for each. Use cleaner subshell instead of cd'ing back up after ignition in bootstrap.

* allow dependent project to set WASI_SDK_PREFIX and have it be used in wasm-linux-clang.cmake

* update readme to use cmake

* Removed all files in rollup/ not necessary for join split tests

* dockerfile, script, and ci changes now that rollup contents are gone except join split

* remove more unused code from rollup/js dir

* removed standard example

* rename rollup directory to join_split_example

* bigfield fix

* filter out longer join split tests (leave only one full proof test in) for CI. fix bb-tests

* fix dockerfile now that rollup executables were removed

* rename rollup namespace to join_split_example

* add blake 3 to executables/libraries in aztec cmakelists

* Removing non-join-split constants as per recommendation here https://github.com/AztecProtocol/barretenberg/pull/124\#discussion_r1098698470

* remove vk constants from join-split

---------

Co-authored-by: Charlie Lye <karl.lye@gmail.com>
Co-authored-by: Innokentii Sennovskii <isennovskiy@gmail.com>
Co-authored-by: Adam Domurad <adam.domurad@gmail.com>
Co-authored-by: ludamad <adam@aztecprotocol.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant