|
BuildInstructions
Build Instructions
Applies to: PhantomJS 1.5. Note: Starting for PhantomJS 1.5, there is a significant change in the build workflow. Before starting to build, ensure that the repository is clean from the build files of any previous versions. This can be done by using the Git clean command. Alternatively, get a fresh clone of the repository. Warning: Compiling PhantomJS from source takes a long time, mainly due to thousands of files in the WebKit module. With 4 parallel compile jobs on a modern machine, the entire process takes roughly 30 minutes. It is highly recommended to install the ready-made binary package if it is available. LinuxNote 1: build.sh by default will launch 4 (four) parallel compile jobs. When building on a virtual machine/server or other limited environment, reduce the jobs by passing a number, e.g ./build.sh --jobs 1 to set only one compile job at a time. Note 2: After finishing the build, run deploy/package-linux-dynamic.sh which creates phantomjs.tar.gz that can be moved around and/or extracted to a different location. This is the correct way to install the built binary into an arbitrary directory, i.e. do not simply copy the executable as it won't work. Ubuntu/Kubuntu (Tested on barebone server install of Ubuntu 10.04 Lucid Lynx and Ubuntu 11.04 Natty Narwhal) sudo apt-get install build-essential chrpath git-core libssl-dev libfontconfig1-dev git clone git://github.com/ariya/phantomjs.git && cd phantomjs git checkout 1.5 ./build.sh Amazon EC2 AMI (Tested on Amazon Linux AMI release 2011.09) sudo yum install gcc gcc-c++ git openssl-devel freetype-devel fontconfig-devel git clone git://github.com/ariya/phantomjs.git && cd phantomjs git checkout 1.5 ./build.sh --jobs 1 Mac OS XInstall Xcode and the necessary SDK for development (gcc, various tools, libraries, etc). git clone git://github.com/ariya/phantomjs.git && cd phantomjs git checkout 1.5 ./build.sh This produces a static build at bin/phantomjs. This executable can be moved to a different directory or transferred to another machine. Copy also Info.plist to avoid Dock icon showing up inadvertently (see issue 281 ). Warning: MacPorts and Homebrew do not have updated PhantomJS built yet. Installing via MacPorts or Homebrew is not the most recommended way (Learn more). WindowsTo be written. |