Skip to content

Commit

Permalink
macos setup notes; also get build working on macos by fixing a few wa…
Browse files Browse the repository at this point in the history
…rned-about conditions.
  • Loading branch information
ixchow committed Oct 28, 2023
1 parent 328144c commit 5d0b444
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Maekfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const schedule_names = [
//extra flags for finding Eigen:
const interpolate_values_CPPFlags = [...maek.options.CPPFlags];
if (maek.OS === "macos") {
interpolate_values_CPPFlags.push('-I/usr/local/include/eigen3');
interpolate_values_CPPFlags.push('-I/opt/homebrew/include/eigen3', '-Wno-unused-but-set-variable');
} else if (maek.OS === "windows") {
interpolate_values_CPPFlags.push('/Ieigen', '/D_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING',
`/wd4459` //local definition hides global
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ Building autoknit is handled with the single-file build tool [maek](https://gith
### <a name="mac"></a>MacOS setup
```
#install eigen library and nodejs (used for build script and to post-process scheduled output):
brew eigen node
brew install eigen node
#extract nest-libs package as a sibling of autoknit folder:
curl 'https://github.com/15-466/nest-libs/releases/download/v0.13/nest-libs-macos-v0.13.tar.gz'
curl 'https://github.com/15-466/nest-libs/releases/download/v0.13/nest-libs-macos-v0.13.tar.gz' -L -O
tar xvfz nest-libs-macos-v0.13.tar.gz
#clone repository:
Expand All @@ -41,7 +41,7 @@ git submodule update
sudo apt-get install libeigen3-dev nodejs
#extract nest-libs package as a sibling of autoknit folder:
curl 'https://github.com/15-466/nest-libs/releases/download/v0.13/nest-libs-linux-v0.13.tar.gz'
curl 'https://github.com/15-466/nest-libs/releases/download/v0.13/nest-libs-linux-v0.13.tar.gz' -L -O
tar xvfz nest-libs-macos-v0.13.tar.gz
#clone repository:
Expand Down Expand Up @@ -81,6 +81,7 @@ node Maekfile.js
Command line flags for maek include:
- `-j8` run with 8 compilation jobs in parallel. Adjust the number to suit your machine. Defaults to number of cores + 1.
- `-q` quit on first error
- Specifically, `node Maekfile.js -j1 -q` is useful when you want to work on one error at a time during development!

Note that maek is a small build system, entirely contained in [Maekfile.js](Maekfile.js). You can read the file to see more about command line options or to see how the build is structured.

Expand Down
7 changes: 6 additions & 1 deletion ak-embed_constraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,13 @@ void ak::embed_constraints(
}

//clear adj + re-create from min_dis:

/* //DEBUG:
uint32_t old_adj = 0;
for (auto const &a : adj) {
old_adj += a.size();
}
*/

adj.assign(verts.size(), std::vector< std::pair< uint32_t, float > >());

Expand All @@ -479,12 +482,14 @@ void ak::embed_constraints(
adj[xyd.first.y].emplace_back(xyd.first.x, xyd.second);
}

/* //DEBUG:
uint32_t new_adj = 0;
for (auto const &a : adj) {
new_adj += a.size();
}
*/

//std::cout << "Went from " << old_adj << " to " << new_adj << " by unfolding triangles." << std::endl;
//std::cout << "Went from " << old_adj << " to " << new_adj << " by unfolding triangles." << std::endl; //DEBUG

//for consistency:
for (auto &a : adj) {
Expand Down
4 changes: 2 additions & 2 deletions test_plan_transfers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ bool simulate_transfers(
//stitches are oriented ccw:

//count the various sorts of edges:
uint32_t back_left = 0;
[[maybe_unused]] uint32_t back_left = 0;
uint32_t back_right = 0;
uint32_t back_front = 0;
uint32_t front_left = 0;
[[maybe_unused]] uint32_t front_right = 0;
[[maybe_unused]] uint32_t front_back = 0;
uint32_t front_back = 0;

auto is_front = [&ccw](uint32_t i) {
if (ccw[i].bed == BedNeedle::Front) {
Expand Down

0 comments on commit 5d0b444

Please sign in to comment.