Difference between revisions of "LDC+Dub+Vibe.d on SmartOS 64bit"

From D Wiki
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 8: Line 8:
 
4. Install needed packages
 
4. Install needed packages
 
* ''# pkgin up''
 
* ''# pkgin up''
* ''# pkgin in binutils gmake cmake scmgit python35 autoconf gcc49 gcc49-libs unzip libconfig livevent''
+
* ''# pkgin in binutils gmake cmake scmgit python35 autoconf gcc49 gcc49-libs unzip libconfig libevent''
 
5. All manipulations I did from work directory, so create it
 
5. All manipulations I did from work directory, so create it
 
* ''# mkdir work''  
 
* ''# mkdir work''  
Line 18: Line 18:
 
* ''# cd llvm''
 
* ''# cd llvm''
 
* ''# git checkout release_38''
 
* ''# git checkout release_38''
8. Correct AddLLVM.cmake in ./llvm/cmake/modules/AddLLVM.cmake. Change phrase <''discard_unused=sections''> to <''ignore''>.
+
8. Correct AddLLVM.cmake in ./cmake/modules/AddLLVM.cmake. Change phrase <''discard_unused=sections''> to <''ignore''>.
 
+
* ''# vi cmake/modules/AddLLVM.cmake''
 +
or simply
 +
* ''# sed -i <nowiki>''</nowiki> 's/discard-unused=sections/ignore/g' cmake/modules/AddLLVM.cmake''
 
9. Configure llvm only for one platform because it will be very long time building :-)
 
9. Configure llvm only for one platform because it will be very long time building :-)
 
* ''# mkdir ~/work/build_llvm''
 
* ''# mkdir ~/work/build_llvm''
Line 28: Line 30:
 
* ''# gmake install''
 
* ''# gmake install''
 
11. For this moment (09.06.2016) in SmartOS package repositories libLLVM-3.7.0 is available. Alternatively you can try to install libLLVM-3.7.0 with pkgin manager, but this path not tested yet. Therefore in this howto used newer release of LLVM, that build from source.
 
11. For this moment (09.06.2016) in SmartOS package repositories libLLVM-3.7.0 is available. Alternatively you can try to install libLLVM-3.7.0 with pkgin manager, but this path not tested yet. Therefore in this howto used newer release of LLVM, that build from source.
 +
 +
12. Clone ldc and use branch ltsmaster.
 +
* ''# cd ~/work''
 +
* ''# git clone https://github.com/ldc-developers/ldc.git''
 +
* ''# cd ldc''
 +
* ''# git checkout ltsmaster''
 +
13. Clone phobos and druntime. For this moment (09.06.2016) pull requests, that already done in branches “ldc-ltsmaster” are enough for using Vibe.d on SmartOS 64bit.  Pull requests for working with serial port not commited yet, but if need it is available in https://github.com/tethyslab/druntime.git branch “lts-solaris-serial”.
 +
* ''# cd runtime''
 +
* ''# git clone https://github.com/ldc-developers/phobos.git''
 +
* ''# cd phobos''
 +
* ''# git checkout ldc-ltsmaster''
 +
* ''# cd ../runtime''
 +
* ''# git clone https://github.com/ldc-developers/druntime.git''
 +
* ''# cd druntime''
 +
* ''# git checkout ldc-ltsmaster''
 +
14. Config, build and install ldc
 +
* ''# cd ~/work''
 +
* ''# mkdir build_ldc''
 +
* ''# cd $_''
 +
* ''# cmake ../ldc''
 +
or you can use more interactive ccmake
 +
* ''# ccmake ../ldc''
 +
and inside it:
 +
 +
- type “c” on keyboard
 +
 +
- type “c” on keyboard once again
 +
 +
- type “g” on keyboard
 +
 +
* ''# gmake -j5''
 +
* ''# gmake install''
 +
15. Check for working ldc. Create “Hello world” program, compile and run it.
 +
* ''# cd ~/work''
 +
* ''# vi hello.d''
 +
* ''# ldc2 hello.d''
 +
* ''# ./hello''
 +
16. Clone and build Dub. For this moment (09.06.2016) changes for build Dub included in branch “master”
 +
* ''# cd ~/work''
 +
* ''# git clone https://github.com/dlang/dub.git''
 +
* ''# cd dub''
 +
* ''# ./build.sh''
 +
* ''# ln -s /root/work/dub/bin/dub /usr/local/bin''
 +
or you may copy dub to your choice directory and linked it. Check that it work:
 +
* ''# cd ~/work''
 +
* ''# dub –version''
 +
17. Next build any Vibe.d (since 0.7.30-alpha1)  project.
 +
* ''# cd ~/work''
 +
* ''# git clone https://github.com/rejectedsoftware/vibe.d.git''
 +
* ''# cd vibe.d/examples/http_server''
 +
* ''# dub build''
 +
18. Check that your application works fine
 +
* ''# ./http-server-example''
 +
Enjoy

Latest revision as of 05:47, 13 June 2016

1. Create “minimal-64-lts” zone with quota~10G and RAM~4G

2. If internet connection available only behind proxy, add proxy env to .bashrc

3. Restart bashrc

  • # . ~/.bashrc

4. Install needed packages

  • # pkgin up
  • # pkgin in binutils gmake cmake scmgit python35 autoconf gcc49 gcc49-libs unzip libconfig libevent

5. All manipulations I did from work directory, so create it

  • # mkdir work
  • # cd work

6. Set git protocol (need if proxy not work with git url)

7. Clone llvm repository and set last release

8. Correct AddLLVM.cmake in ./cmake/modules/AddLLVM.cmake. Change phrase <discard_unused=sections> to <ignore>.

  • # vi cmake/modules/AddLLVM.cmake

or simply

  • # sed -i '' 's/discard-unused=sections/ignore/g' cmake/modules/AddLLVM.cmake

9. Configure llvm only for one platform because it will be very long time building :-)

  • # mkdir ~/work/build_llvm
  • # cd $_
  • # cmake -DCMAKE_BUILD_TYPE=”Release” -DLLVM_TARGETS_TO_BUILD=”X86” ../llvm/

10. Build and install llvm

  • # gmake -j5
  • # gmake install

11. For this moment (09.06.2016) in SmartOS package repositories libLLVM-3.7.0 is available. Alternatively you can try to install libLLVM-3.7.0 with pkgin manager, but this path not tested yet. Therefore in this howto used newer release of LLVM, that build from source.

12. Clone ldc and use branch ltsmaster.

13. Clone phobos and druntime. For this moment (09.06.2016) pull requests, that already done in branches “ldc-ltsmaster” are enough for using Vibe.d on SmartOS 64bit. Pull requests for working with serial port not commited yet, but if need it is available in https://github.com/tethyslab/druntime.git branch “lts-solaris-serial”.

14. Config, build and install ldc

  • # cd ~/work
  • # mkdir build_ldc
  • # cd $_
  • # cmake ../ldc

or you can use more interactive ccmake

  • # ccmake ../ldc

and inside it:

- type “c” on keyboard

- type “c” on keyboard once again

- type “g” on keyboard

  • # gmake -j5
  • # gmake install

15. Check for working ldc. Create “Hello world” program, compile and run it.

  • # cd ~/work
  • # vi hello.d
  • # ldc2 hello.d
  • # ./hello

16. Clone and build Dub. For this moment (09.06.2016) changes for build Dub included in branch “master”

or you may copy dub to your choice directory and linked it. Check that it work:

  • # cd ~/work
  • # dub –version

17. Next build any Vibe.d (since 0.7.30-alpha1) project.

18. Check that your application works fine

  • # ./http-server-example

Enjoy