Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build step on MacOS (workaround) #14

Merged
merged 3 commits into from
Oct 26, 2020
Merged

Conversation

sloede
Copy link
Member

@sloede sloede commented Oct 22, 2020

This PR should fix the issues on MacOS that were reported by @alexastanin and @andrewwinters5000 on Slack (at least for me).

@alexastanin @andrewwinters5000 Can you please confirm that it works for you if you check out this branch and build P4est.jl from it? Something like this should work:

git clone [email protected]:trixi-framework/P4est.jl.git
cd P4est.jl
git checkout msl/fix-build-on-macos
julia --project=. -e 'using Pkg; Pkg.build()'

If this works for you, we should discuss whether we want to use such a workaround at all, or if we want to use another way how to set up the C bindings for P4est.jl (e.g., by pre-generating them and storing them in the package).

@andrewwinters5000
Copy link
Member

Can you please confirm that it works for you if you check out this branch and build P4est.jl from it?

I can confirm it works on my machine using OSX Catalina version 10.15.7

@sloede
Copy link
Member Author

sloede commented Oct 22, 2020

OK, thanks. I suggest to merge this and to create a patch release such that @alexastanin can continue working from his machine, but I'll open a separate issue to discuss how we want to proceed in general.

@sloede sloede requested review from ranocha and alexastanin October 22, 2020 12:10
@alexastanin
Copy link

I have just Xcode command line tools. Now I get another Error

(base) alexanderastanin@MacBook-Pro test % git clone [email protected]:trixi-framework/P4est.jl.git

Cloning into 'P4est.jl'...
remote: Enumerating objects: 279, done.
remote: Counting objects: 100% (279/279), done.
remote: Compressing objects: 100% (192/192), done.
remote: Total 279 (delta 144), reused 201 (delta 80), pack-reused 0
Receiving objects: 100% (279/279), 47.41 KiB | 599.00 KiB/s, done.
Resolving deltas: 100% (144/144), done.
(base) alexanderastanin@MacBook-Pro test % cd P4est.jl
(base) alexanderastanin@MacBook-Pro P4est.jl % git checkout msl/fix-build-on-macos

Branch 'msl/fix-build-on-macos' set up to track remote branch 'msl/fix-build-on-macos' from 'origin'.
Switched to a new branch 'msl/fix-build-on-macos'
(base) alexanderastanin@MacBook-Pro P4est.jl % julia --project=. -e 'using Pkg; Pkg.build()'
   Updating registry at `~/.julia/registries/General`
######################################################################## 100.0%
   Updating registry at `~/.julia/registries/JuliaComputingRegistry`
Updating `~/Documents/Coding/julia/test/P4est.jl/Project.toml`
  [d43a6710] + CBinding v0.9.3
  [da04e1cc] + MPI v0.15.1
  [6b5a15aa] + P4est_jll v2.2.0+2
  [189a3867] + Reexport v0.2.0
Updating `~/Documents/Coding/julia/test/P4est.jl/Manifest.toml`
  [56f22d72] + Artifacts v1.3.0
  [d43a6710] + CBinding v0.9.3
  [e66e0078] + CompilerSupportLibraries_jll v0.3.4+0
  [ffbed154] + DocStringExtensions v0.8.3
  [692b3bcd] + JLLWrappers v1.1.2
  [da04e1cc] + MPI v0.15.1
  [7cb0a576] + MPICH_jll v3.3.2+10
  [9237b28f] + MicrosoftMPI_jll v10.1.2+3
  [656ef2d0] + OpenBLAS32_jll v0.3.10+0
  [fe0851c0] + OpenMPI_jll v4.0.2+2
  [6b5a15aa] + P4est_jll v2.2.0+2
  [189a3867] + Reexport v0.2.0
  [ae029012] + Requires v1.1.0
  [83775a58] + Zlib_jll v1.2.11+18
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [b77e0a4c] + InteractiveUtils
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
   Building MPI ──→ `~/.julia/packages/MPI/z1lDn/deps/build.log`
   Building P4est → `~/Documents/Coding/julia/test/P4est.jl/deps/build.log`
┌ Error: Error building `P4est`: 
│ ERROR: LoadError: MacOS SDK include path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/' does not exist. Have you installed Xcode?
│ Stacktrace:
│  [1] error(::String) at ./error.jl:33
│  [2] top-level scope at /Users/alexanderastanin/Documents/Coding/julia/test/P4est.jl/deps/build.jl:161
│  [3] include(::String) at ./client.jl:457
│  [4] top-level scope at none:5
│ in expression starting at /Users/alexanderastanin/Documents/Coding/julia/test/P4est.jl/deps/build.jl:159
│ Use p4est library provided by P4est_jll
│ Use p4est include path provided by P4est_jll
│ include_directories = ["/Users/alexanderastanin/.julia/artifacts/caafb6cdc58816c33aa4f41e555b04f25a6ac7e3/include"]
└ @ Pkg.Operations /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/Operations.jl:949

@sloede
Copy link
Member Author

sloede commented Oct 22, 2020

@alexastanin @andrewwinters5000 Could you please both try again whether the current branch works (same command to build as before)?

@alexastanin
Copy link

I can confirm it works on my Laptop using OSX Catalina version 10.15.7

@andrewwinters5000
Copy link
Member

The new version builds for me as well

Copy link
Member

@ranocha ranocha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay to me in general (except a minor comment). I can't test anything since don't have access to a Mac.

Should we also run some CI test on Mac?

deps/build.jl Outdated Show resolved Hide resolved
@sloede
Copy link
Member Author

sloede commented Oct 26, 2020

Should we also run some CI test on Mac?

I think this would be preferable, I just don't have the resources at the moment to figure out how to modify .travis.yml such that all dependencies are are met on MacOS as well (maybe via the homebrew module?), while not breaking the apt updates on Ubuntu.

If you want to give it a try, it would be excellent (I can also help where possible); otherwise I suggest to only create an issue for it right now.

@sloede sloede merged commit 818e50c into master Oct 26, 2020
@sloede sloede deleted the msl/fix-build-on-macos branch October 26, 2020 03:48
@lcw
Copy link
Contributor

lcw commented Oct 26, 2020

It may be helpful to look at https://github.com/lcw/p4est_occa_tutorial/blob/084c089328819c5c9ebdb6ae90507bfc2a379152/.travis.yml where I build p4est on the mac.

@sloede
Copy link
Member Author

sloede commented Oct 26, 2020

It may be helpful to look at https://github.com/lcw/p4est_occa_tutorial/blob/084c089328819c5c9ebdb6ae90507bfc2a379152/.travis.yml where I build p4est on the mac.

@lcw Thanks a lot for the feedback! It's a great starting point and we added it to #16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants