[CWB] easier CWB compilation with Spack

David Lukeš david.lukes at ff.cuni.cz
Sat Nov 4 21:44:43 CET 2017


Just FYI, I tweaked the Spack package for CWB so that it builds on 
macOS. As usual, if you want to compile stuff on a Mac, you'll need to 
install Xcode first (through the App Store), or at least Xcode command 
line tools (via the command line):

$ xcode-select --install

David

On 03/11/2017 16:08, David Lukeš wrote:
>
> Oh god, it looks like mailman butchers HTML mail beyond my wildest 
> expectations… :) If you’d like a more readable version of the previous 
> post, please follow this link:
>
> https://trnka.korpus.cz/~lukes/cwb.html 
> <https://trnka.korpus.cz/%7Elukes/cwb.html>
>
> Best,
>
> David
>
>> On 11/03/2017 03:55 PM, David Lukeš wrote:
>>
>> Hi all,
>>
>> in light of this recent thread 
>> <http://liste.sslmit.unibo.it/pipermail/cwb/2017-November/002953.html> 
>> re: compiling CWB from source, it occurred to me it might be useful 
>> to create a CWB package for Spack <http://spack.readthedocs.io/>. 
>> Spack is a cross-platform package manager which builds software from 
>> source, *automatically resolving dependencies* so you don’t have to. 
>> A second advantage is that *it doesn’t need to run with admin 
>> privileges*. You just need Git and a fairly recent version of Python 
>> 2 (preferably, Python 3 works as well but you might hit snags).
>>
>> I added |cwb| and |cwb-perl| packages to a fork of Spack I maintain, 
>> so installing trunk CWB can now be done like this:
>>
>> |git clone --depth 1 https://github.com/dlukes/spack.git cd spack # 
>> cwb is installed automatically as a dependency of cwb-perl 
>> ./bin/spack install cwb-perl # symlink the cwb-perl package into perl 
>> ./bin/spack activate cwb-perl # create a prefix where all relevant 
>> binaries will be symlinked # (change /path/to/prefix to a directory 
>> of your choice) ./bin/spack view symlink /path/to/prefix cwb-perl # 
>> update your PATH export PATH="/path/to/prefix/bin:$PATH" # use cwb 
>> cwb-encode ... cwb-make ... cqp ... |
>>
>> A practical note: when testing this on Arch Linux, I found out that 
>> flex 2.6.4 doesn’t compile on my system. Fortunately, with Spack, you 
>> can request a specific version of a dependency:
>>
>> |# list information about the flex package in Spack, including # 
>> available versions ./bin/spack info flex # install cwb-perl with 
>> specific version of flex ./bin/spack install 'cwb-perl^flex at 2.6.3' # 
>> etc. |
>>
>> If you’d rather use Spack’s official repository 
>> <https://github.com/LLNL/spack> (though my fork differs only 
>> slightly), you can, just manually add the |cwb| and |cwb-perl| 
>> package definitions where they belong in Spack’s directory tree:
>>
>> |git clone --depth 1 https://github.com/LLNL/spack.git cd spack mkdir 
>> -p var/spack/repos/builtin/packages/{cwb,cwb-perl} 
>> cwb=var/spack/repos/builtin/packages/cwb/package.py 
>> cwb_perl=var/spack/repos/builtin/packages/cwb-perl/package.py curl 
>> https://raw.githubusercontent.com/dlukes/spack/develop/$cwb -o $cwb 
>> curl https://raw.githubusercontent.com/dlukes/spack/develop/$cwb_perl 
>> -o $cwb_perl ./bin/spack install cwb-perl # etc. |
>>
>> Note that if you have a working setup for installing CWB from source, 
>> you might as well keep using it :) But if you’re starting from 
>> scratch, you might find this easier, depending on circumstances. If 
>> this method doesn’t work for you, let me know via the issue tracker 
>> <https://github.com/dlukes/spack/issues/new> on GitHub.
>>
>> Best,
>>
>> David
>>
>>>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://liste.sslmit.unibo.it/pipermail/cwb/attachments/20171104/f164b587/attachment.html>


More information about the CWB mailing list