Coder Social home page Coder Social logo

Comments (10)

ryandesign avatar ryandesign commented on May 30, 2024

Pure requires LLVM 3.5 or older. Does Homebrew have this?

from pure-lang.

shakfu avatar shakfu commented on May 30, 2024

I think so:

$ brew info llvm
llvm: stable 13.0.0 (bottled), HEAD [keg-only]
Next-gen compiler infrastructure
https://llvm.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/llvm.rb
License: Apache-2.0 with LLVM-exception
==> Dependencies
Build: cmake ✔, swig ✔
Required: [email protected] ✔
==> Options
--HEAD
	Install HEAD version
==> Caveats
To use the bundled libc++ please add the following LDFLAGS:
  LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"

llvm is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

from pure-lang.

ryandesign avatar ryandesign commented on May 30, 2024
llvm: stable 13.0.0 (bottled), HEAD [keg-only]

llvm 13 is way too new. Only version 3.5 and earlier will work.

from pure-lang.

shakfu avatar shakfu commented on May 30, 2024

Fair enough. I guess that's the end of it then.

from pure-lang.

ryandesign avatar ryandesign commented on May 30, 2024

Unfortunately the developers of LLVM decided in version 3.6 to remove the fundamental feature that Pure was built upon. See #6 for more on that.

From a technical standpoint it should be possible to add a formula for LLVM 3.5 and then Pure to Homebrew but I don't know what their policies are, whether they would allow that. I think Homebrew also has a concept of separate collections of formulas that anyone can maintain in their own repository, so LLVM 3.5 and Pure formulas need not necessarily come from the central Homebrew repository, need not necessarily be subject to their requirements. And they need not come from Albert or anyone associated with the Pure project, so you could for example create them yourself if you want. I may be slightly off on my understanding of things. I haven't investigated Homebrew very much, since I am heavily involved with its competitor, MacPorts, and maintain the Pure ports there.

from pure-lang.

shakfu avatar shakfu commented on May 30, 2024

Thanks Ryan, that's very helpful.

I may just build llvm3.5 independently and then try build pure myself. My interest as mentioned earlier is really to use the faust2pd tool which is written in pure.

from pure-lang.

ryandesign avatar ryandesign commented on May 30, 2024

If you've resigned yourself to building from source, you can make it easier by letting MacPorts do it for you, since we've already worked out the details and written the instructions into our Portfiles.

Yes, it's recommend not to install MacPorts and Homebrew on the same machine because they can conflict, but that applies primarily to when they are installed in their default locations. If you primarily use Homebrew, then you might want to keep it in its default location (/usr/local for Intel systems, /opt/homebrew on Apple Silicon) and install MacPorts in a different location (such as /opt/pure or even within your home directory), that way what you install with MacPorts shouldn't conflict with what you do in Homebrew.

What you have installed with Homebrew in its default location could conflict with what you want to install with MacPorts, but you could temporarily move the Homebrew stuff aside (sudo mv /usr/local /usr/local.off) before installing or upgrading things with MacPorts, then move it back later (sudo mv /usr/local.off /usr/local). These extra steps shouldn't be too inconvenient if you don't update your MacPorts ports often, which is probably fine given how infrequently releases of Pure software are happening these days.

So for example, after installing the Xcode command line tools (you probably don't need a full install of Xcode), you might use:

curl -OL https://distfiles.macports.org/MacPorts/MacPorts-2.7.1.tar.bz2
tar xjf MacPorts-2.7.1.tar.bz2
cd MacPorts-2.7.1
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
./configure --prefix=/opt/pure --with-applications-dir=/opt/pure/Applications --enable-readline
make -j$(sysctl -n hw.activecpu)
sudo make install
sudo /opt/pure/bin/port sync
sudo /opt/pure/bin/port install faust2pd

After that you can find out what was installed and where by running:

/opt/pure/bin/port contents faust2pd

If you like, you can add /opt/pure/bin to your shell's PATH environment variable. For example, if you're using zsh, you might use:

echo 'export PATH="$PATH:/opt/pure/bin:/opt/pure/sbin"' >> ~/.zprofile

You didn't mention your Mac model so I should also mention that in MacPorts we haven't been able to build LLVM versions as old as 3.5 for Apple Silicon systems. It just predates them by too long. So if you have an Apple Silicon Mac and your purpose for installing MacPorts is to use LLVM 3.5 (through Pure), you should tell MacPorts to behave like it would on an Intel system by editing macports.conf and setting build_arch x86_64 before installing any ports. This is not done often so if you encounter build failures please report them to MacPorts, but I suspect that the x86_64 versions of Pure and LLVM should work fine on Apple Silicon through the Rosetta 2 dynamic recompiler built into macOS.

from pure-lang.

ryandesign avatar ryandesign commented on May 30, 2024

(I keep saying LLVM 3.5 because that's the last version Pure works with. In MacPorts, LLVM 3.5 was deleted some time ago, I think before we realized that it was the last version Pure would work with, so in MacPorts Pure uses LLVM 3.4.)

from pure-lang.

shakfu avatar shakfu commented on May 30, 2024

Thanks Ryan. You've been very helpful indeed. I will probably go via your recommended macports route then.

from pure-lang.

agraef avatar agraef commented on May 30, 2024

Ryan, thanks a lot for the detailed explanation. And yes, I'm only using MacPorts myself, so Homebrew won't happen unless someone else does it. ;-) IIRC there actually was a formula for pure in Homebrew a long while ago, but it never had all the addon modules, and eventually got dropped.

from pure-lang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.