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

nest: migrate to homebrew/core #21561

Closed
wants to merge 3 commits into from
Closed

nest: migrate to homebrew/core #21561

wants to merge 3 commits into from

Conversation

tammoippen
Copy link
Contributor

  • Have you followed the guidelines for contributing?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install <formula>)?

Migrating because of: https://github.com/Homebrew/homebrew-science/issues/6331

Companion PR: https://github.com/Homebrew/homebrew-science/pull/6489

@tammoippen
Copy link
Contributor Author

Failing because of dependency on matplotlib, which is also scheduled for migration (see top of list https://github.com/Homebrew/homebrew-science/issues/6331).

@ilovezfs
Copy link
Contributor

It's unlikely matplotlib will be accepted into homebrew/core. You should vendor as is done with most python resources.

@tammoippen
Copy link
Contributor Author

👍 will do so.

Formula/nest.rb Outdated

requires_py3 = []
requires_py3 << "with-python3" if build.with? "python3"
depends_on "numpy" => requires_py3
Copy link
Contributor

Choose a reason for hiding this comment

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

depends_on "foo" => "with-bar" is an audit failure, which this use of a variable manages to circumvent. It's also unnecessary here since numpy builds with both python2 and python3 by default. Unless we're building both python2 and python3 bindings by default for nest, numpy will need to be vendored.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Python for Formula Authors the matplotlib formula is given as an example for python dependencies and I followed their lead - and they use the variable to circumvent audit failure. Vendoring scipy and numpy now. matplotlib actually is not a necessary requirement - only used in examples, hence removing it from dependencies.

Copy link
Contributor

Choose a reason for hiding this comment

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

That documentation is dated.

Formula/nest.rb Outdated
requires_py3 = []
requires_py3 << "with-python3" if build.with? "python3"
depends_on "numpy" => requires_py3
depends_on "scipy" => requires_py3
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as above

Formula/nest.rb Outdated
end

def install
ENV.delete("CFLAGS")
Copy link
Contributor

Choose a reason for hiding this comment

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

This should never be needed. Ditto CXXFLAGS below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

Formula/nest.rb Outdated
option "without-openmp", "Build without OpenMP support."
needs :openmp if build.with? "openmp"

depends_on "gsl" => :recommended
Copy link
Contributor

Choose a reason for hiding this comment

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

just require it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Formula/nest.rb Outdated

option "with-python3", "Build Python3 bindings (PyNEST) instead of Python2 bindings."
option "without-openmp", "Build without OpenMP support."
needs :openmp if build.with? "openmp"
Copy link
Contributor

Choose a reason for hiding this comment

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

don't need this option

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not understand, why we don't need this option? nest can be build with or without OpenMP. Are you suggesting, we build with OpenMP by default?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm saying we should have no openmp option.

Formula/nest.rb Outdated
needs :openmp if build.with? "openmp"

depends_on "gsl" => :recommended
depends_on :mpi => [:optional, :cc, :cxx]
Copy link
Contributor

Choose a reason for hiding this comment

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

don't need this option

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same here. Are you suggesting we build with MPI by default?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm saying we should have no mpi option.

Formula/nest.rb Outdated
ENV.prepend_create_path "PATH", buildpath/"cython/bin"
ENV.prepend_create_path "PYTHONPATH", buildpath/"cython/lib/python#{python_version}/site-packages"

# "out of source" build
Copy link
Contributor

Choose a reason for hiding this comment

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

comment isn't needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

Formula/nest.rb Outdated
inreplace bin/"nest-config",
%r{#{HOMEBREW_REPOSITORY}/Library/Homebrew/shims.*/super},
"#{HOMEBREW_PREFIX}/bin",
FALSE
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what the deal is with this inreplace but any use of the false argument is essentially a bug by definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Formula/nest.rb Outdated
homepage "http://www.nest-simulator.org/"
url "https://github.com/nest/nest-simulator/archive/v2.14.0.tar.gz"
sha256 "afaf7d53c2d5305fac1257759cc0ea6d62c3cebf7d5cc4a07d4739af4dbb9caf"
head "https://github.com/nest/nest-simulator.git"
Copy link
Contributor

Choose a reason for hiding this comment

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

don't need this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this, the --HEAD option is gone. Is this intended?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes.

Formula/nest.rb Outdated
depends_on "matplotlib" => requires_py3

depends_on "libtool" => :run
depends_on "readline" => :run
Copy link
Contributor

Choose a reason for hiding this comment

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

the => :run isn't needed. readline would never be => :build

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

Formula/nest.rb Outdated

depends_on "libtool" => :run
depends_on "readline" => :run
depends_on "cmake" => :build
Copy link
Contributor

Choose a reason for hiding this comment

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

=> :build should go above the rest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved.

Formula/nest.rb Outdated

fails_with :clang do
cause <<-EOS.undent
Building NEST with clang is not stable. See https://github.com/nest/nest-simulator/issues/74 .
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is true, it doesn't belong in homebrew/core.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems fixed, see nest/nest-simulator#732. On the other hand, clang from macOS does not support OpenMP (last time i checked) and we would have to rely on gcc anyway. Removing fails_with part.

@ilovezfs ilovezfs added the science Formula was originally in Homebrew/homebrew-science label Dec 11, 2017
Formula/nest.rb Outdated
depends_on "libtool" => :run
depends_on "readline"

patch :DATA
Copy link
Contributor

Choose a reason for hiding this comment

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

New formulae must build without patching.

@sjackman
Copy link
Member

It's unlikely matplotlib will be accepted into homebrew/core. You should vendor as is done with most python resources.

numpy and scipy are both in Homebrew/core. What's the reason that matplotlib should not be migrated to core?

@ilovezfs
Copy link
Contributor

It takes under a minute to build and we don't usually package python libraries. I'm considering removing numpy and scipy too.

Formula/nest.rb Outdated
] {join} Fold
} Function def
EOS
File.open(ENV["HOME"]+"/.nestrc", "w") { |file| file.write(nestrc) }
Copy link
Member

@DomT4 DomT4 Dec 13, 2017

Choose a reason for hiding this comment

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

(testpath/".nestrc").write nestrc, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nest will look in HOME for .nestrc... if testpath is equal to HOME in the testing-sandbox, then this would be ok. But since there will not be a MPI build, .nestrc is not needed and those lines will go anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, testpath is HOME here, as is buildpath during def install, although the latter may one day change as it has some side-effects that aren't completely desirable.

@tammoippen
Copy link
Contributor Author

I will prepare a PR upstream with changes making the patch unnecessary, but I doubt there will be release in the near future (2.14 is relative fresh for nest ~20. Oct.). Also, I am a bit reluctant to vendor matplotlib: I found no other formula in core vendoring matplotlib; and besides the dead code in the tests (in the patch), matplotlib is actually not necessary for nest; also looking at matplotlib formula, there is some complexity I do not want to mirror in nest's formula just for vendoring.

I am ok with the other requests, but this might be a deal breaker until a new release of nest? I guess it is not possible to use a git-commit instead of a stable release?

@ilovezfs
Copy link
Contributor

If the patch has been accepted upstream, we can apply it with a patch do block and a url.

Due to `brew audit --strict homebrew/core/nest`:

* removing `revision 1`
* removing `depends_on :python unless OS.mac?`
* vendor python packages
* make OpenMP and MPI default
* some restructuring
@ilovezfs
Copy link
Contributor

@BrewTestBot test this please

end

# add nosetest executable to path
ENV.prepend_create_path "PATH", libexec/"bin"
Copy link
Contributor

Choose a reason for hiding this comment

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

should just be prepend_path

@stale
Copy link

stale bot commented Jan 15, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale No recent activity label Jan 15, 2018
@tammoippen
Copy link
Contributor Author

I am still working on an upstream PR. Please do not close.

@stale stale bot removed the stale No recent activity label Jan 15, 2018
@queengooborg
Copy link
Contributor

@tammoippen How's it going?

@tammoippen
Copy link
Contributor Author

@vinyldarkscratch Still waiting for the upstream PR...

@queengooborg
Copy link
Contributor

I see, thanks for the update, @tammoippen!

@stale
Copy link

stale bot commented Feb 21, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale No recent activity label Feb 21, 2018
@stale stale bot closed this Mar 1, 2018
@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
science Formula was originally in Homebrew/homebrew-science stale No recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants