reverendbedford / neml2

GPU enabled material modeling and inference library
Other
8 stars 9 forks source link

build on mac #99

Closed lynnmunday closed 11 months ago

lynnmunday commented 12 months ago

These are now hitting a linker error that I cannot fix. This is the linker error:

[ 59%] Building CXX object src/neml2/CMakeFiles/neml2.dir/tensors/user_tensors/ZerosBatchTensor.cxx.o
[ 60%] Building CXX object src/neml2/CMakeFiles/neml2.dir/tensors/user_tensors/ZerosFixedDimTensor.cxx.o
[ 61%] Linking CXX shared library libneml2.dylib
ld: warning: directory not found for option '-L/lib/intel64'
ld: warning: directory not found for option '-L/lib/intel64_win'
ld: warning: directory not found for option '-L/lib/win-x64'
ld: unknown option: --no-as-needed
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/neml2/CMakeFiles/neml2.dir/build.make:1558: src/neml2/libneml2.dylib] Error 1
make[1]: *** [CMakeFiles/Makefile2:227: src/neml2/CMakeFiles/neml2.dir/all] Error 2
make: *** [Makefile:101: all] Error 2
(moose) inl652653:neml2 mundlb$ git status
On branch main
Your branch is up to date with 'origin/main'.

From what I found on google, the "--no-as-needed" option is not supported for Macs. I've tried using libtorch 1.12 that I download with the moose script and the libtorch that NEML2 downloads and neither work.

ref #98

lynnmunday commented 12 months ago

@hugary1995 this is how far I made it building NEML2 on my mac. I'm going to try pulling your NEML2 blackbear branch and building it. Or I'll try building NEML2 on linux.

hugary1995 commented 11 months ago

Can you try this libtorch instead (for resolving the linker error)? https://download.pytorch.org/libtorch/cpu/libtorch-macos-2.1.0.zip

You could pick a specific libtorch using the LIBTORCH_DIR variable, e.g.,

cmake -DLIBTORCH_DIR=/path/to/libtorch .
hugary1995 commented 11 months ago

I've also corrected the default URL for mac's libtorch. See if that works.

hugary1995 commented 11 months ago

Alright, the Mac tests seem to be passing now. We will wait for @reverendbedford to modify the list of expected checks and update the lcov credentials.

reverendbedford commented 11 months ago

Tests are, in fact, not passing.

hugary1995 commented 11 months ago

Tests are passing. The coverage workflow has bad credentials which I can't deal with.

reverendbedford commented 11 months ago

I can only assume that the coverage report isn't running because @lynnmunday isn't a member of the project... I added him and let's see what happens.

hugary1995 commented 11 months ago

I'll wait for @lynnmunday accepts the invite then.

@lynnmunday I joined

lynnmunday commented 11 months ago

@reverendbedford @hugary1995 Thanks for all this, I am able to build this pr on my mac with the 2.1 version of libtorch.

reverendbedford commented 11 months ago

Closed in favor of #103 -- @lynnmunday you're now a member of the project so in the future I guess just work in this repo. I wasn't able to figure out why "external" PRs from forks can't access the secret needed to upload the coverage report.